org.extex.interpreter
Class FlagsImpl

java.lang.Object
  extended by org.extex.interpreter.FlagsImpl
All Implemented Interfaces:
Flags

public class FlagsImpl
extends java.lang.Object
implements Flags

This class implements a set of flags. This is needed to pass controlling information to primitives.

Version:
$Revision: 4728 $
Author:
Gerd Neugebauer

Field Summary
 
Fields inherited from interface org.extex.interpreter.Flags
NONE
 
Constructor Summary
FlagsImpl()
          Creates a new object.
 
Method Summary
 void clear()
          This method clears all flags.
 boolean clearGlobal()
          Setter for the global flag.
 boolean clearImmediate()
          Setter for the immediate flag.
 boolean clearLong()
          Setter for the long flag.
 boolean clearOuter()
          Setter for the outer flag.
 boolean clearProtected()
          Setter for the protected flag.
 Flags copy()
          Clone an instance.
 java.lang.String[] get()
          Getter for the text representations of the flags currently set.
 boolean isDirty()
          Test if all flags are cleared.
 boolean isGlobal()
          Getter for the global flag.
 boolean isImmediate()
          Getter for the immediate flag.
 boolean isLong()
          Getter for the long flag.
 boolean isOuter()
          Getter for the outer flag.
 boolean isProtected()
          Getter for the protected flag.
 void set(Flags flags)
          Copy the flag settings from a given instance int this instance.
 void setGlobal()
          Setter for the global flag.
 void setGlobal(boolean value)
          Setter for the global flag.
 void setImmediate()
          Setter for the immediate flag.
 void setLong()
          Setter for the long flag.
 void setOuter()
          Setter for the outer flag.
 void setProtected()
          Setter for the protected flag.
 java.lang.String toString()
          Determine a printable representation of the instance.
 java.lang.String toText()
          Determine a printable representation of the flags set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FlagsImpl

public FlagsImpl()
Creates a new object. Initially no flags are set.

Method Detail

clear

public void clear()
This method clears all flags.

Specified by:
clear in interface Flags
See Also:
Flags.clear()

clearGlobal

public boolean clearGlobal()
Setter for the global flag. The flag is reset to false.

Specified by:
clearGlobal in interface Flags
Returns:
the old value of the global flag
See Also:
Flags.clearGlobal()

clearImmediate

public boolean clearImmediate()
Setter for the immediate flag. The flag is reset to false.

Specified by:
clearImmediate in interface Flags
Returns:
the old value of the immediate flag
See Also:
Flags.clearImmediate()

clearLong

public boolean clearLong()
Setter for the long flag. The flag is reset to false.

Specified by:
clearLong in interface Flags
Returns:
the old value of the long flag
See Also:
Flags.clearLong()

clearOuter

public boolean clearOuter()
Setter for the outer flag. The flag is reset to false.

Specified by:
clearOuter in interface Flags
Returns:
the old value of the outer flag
See Also:
Flags.clearOuter()

clearProtected

public boolean clearProtected()
Setter for the protected flag. The flag is reset to false.

Specified by:
clearProtected in interface Flags
Returns:
the old value of the protected flag
See Also:
Flags.clearProtected()

copy

public Flags copy()
Clone an instance.

Specified by:
copy in interface Flags
Returns:
a copy of the instance
See Also:
Flags.copy()

get

public java.lang.String[] get()
Getter for the text representations of the flags currently set.

Specified by:
get in interface Flags
Returns:
the array of flag names
See Also:
Flags.get()

isDirty

public boolean isDirty()
Test if all flags are cleared.

Specified by:
isDirty in interface Flags
Returns:
true iff not all flags are cleared
See Also:
Flags.isDirty()

isGlobal

public boolean isGlobal()
Getter for the global flag.

Specified by:
isGlobal in interface Flags
Returns:
the current value of the global flag
See Also:
Flags.clearGlobal(), Flags.setGlobal(), Flags.setGlobal(boolean)

isImmediate

public boolean isImmediate()
Getter for the immediate flag.

Specified by:
isImmediate in interface Flags
Returns:
the current value of the immediate flag
See Also:
Flags.clearImmediate(), Flags.setImmediate()

isLong

public boolean isLong()
Getter for the long flag.

Specified by:
isLong in interface Flags
Returns:
the current value of the long flag
See Also:
Flags.clearLong(), Flags.setLong()

isOuter

public boolean isOuter()
Getter for the outer flag.

Specified by:
isOuter in interface Flags
Returns:
the current value of the outer flag
See Also:
Flags.clearOuter(), Flags.setOuter()

isProtected

public boolean isProtected()
Getter for the protected flag.

Specified by:
isProtected in interface Flags
Returns:
the current value of the protected flag
See Also:
Flags.isProtected()

set

public void set(Flags flags)
Copy the flag settings from a given instance int this instance.

Specified by:
set in interface Flags
Parameters:
flags - the flags to copy
See Also:
Flags.set( org.extex.interpreter.Flags)

setGlobal

public void setGlobal()
Setter for the global flag.

Specified by:
setGlobal in interface Flags
See Also:
Flags.clearGlobal(), Flags.isGlobal(), Flags.setGlobal(boolean)

setGlobal

public void setGlobal(boolean value)
Setter for the global flag.

Specified by:
setGlobal in interface Flags
Parameters:
value - the new value for the global flag
See Also:
Flags.clearGlobal(), Flags.isGlobal(), Flags.setGlobal()

setImmediate

public void setImmediate()
Setter for the immediate flag.

Specified by:
setImmediate in interface Flags
See Also:
Flags.clearImmediate(), Flags.isImmediate()

setLong

public void setLong()
Setter for the long flag.

Specified by:
setLong in interface Flags
See Also:
Flags.clearLong(), Flags.isLong()

setOuter

public void setOuter()
Setter for the outer flag.

Specified by:
setOuter in interface Flags
See Also:
Flags.clearOuter(), Flags.isOuter()

setProtected

public void setProtected()
Description copied from interface: Flags
Setter for the protected flag. The flag is set to true.

Specified by:
setProtected in interface Flags
See Also:
Flags.setProtected()

toString

public java.lang.String toString()
Determine a printable representation of the instance.

Overrides:
toString in class java.lang.Object
Returns:
the printable representation
See Also:
Object.toString()

toText

public java.lang.String toText()
Determine a printable representation of the flags set. The representation takes into account the current locale.

Specified by:
toText in interface Flags
Returns:
the list
See Also:
Flags.toText()