net.sf.magicproject.tools
Class ReferencePager

java.lang.Object
  extended by net.sf.magicproject.tools.ReferencePager

public class ReferencePager
extends java.lang.Object

This class is used to maintain references between reference name and offsets.
When the pager is enabled, reference name are not written to the given output stream, but the reference is added and would be written later as an index.
When the pager is disabled, reference name are directly written to the given output stream.

Since:
0.94
Author:
Fabrice Daugan

Field Summary
static int MAX_OFFSET
          The maximum offset position.
 
Constructor Summary
ReferencePager()
          Create a new instance of this class.
 
Method Summary
 void addReference(java.io.OutputStream out, java.lang.String referenceName)
          Add a reference to this pager.
 void enable(boolean enabled)
          Enable/Disable this pager.
 boolean isEnabled()
          Return true if this pager is enabled.
 void write(java.io.OutputStream out)
          Write the pager content.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_OFFSET

public static final int MAX_OFFSET
The maximum offset position. Incraese this value assuming pager implementation has been updated.

See Also:
Constant Field Values
Constructor Detail

ReferencePager

public ReferencePager()
Create a new instance of this class.
As default, pager is enabled.

Method Detail

addReference

public void addReference(java.io.OutputStream out,
                         java.lang.String referenceName)
Add a reference to this pager.

Parameters:
out - the destination output stream.
referenceName - the reference to write.

write

public void write(java.io.OutputStream out)
Write the pager content.

Parameters:
out - the destination output stream.

enable

public void enable(boolean enabled)
Enable/Disable this pager.

Parameters:
enabled - the boolean flag.

isEnabled

public boolean isEnabled()
Return true if this pager is enabled.

Returns:
true if this pager is enabled.


Copyright © 2003-2007 Magic-Project. All Rights Reserved.