app.spa
Class EDTState

java.lang.Object
  extended by app.spa.EDTState

public class EDTState
extends java.lang.Object

The internal state of the SiGMLPlayerApplet's event dispatch thread, represented as a set of StateFlags. (This would be a subclass of EnumSet<StateFlag> were the latter not an abstract class.)


Constructor Summary
EDTState()
          Constructs a new state with no flags and no logger.
EDTState(Logger logger)
          Constructs a new state with no flags, and using the given logger (which may be null if logging is not required).
 
Method Summary
 boolean has(StateFlag s)
          Indicates whether this state has the given flag.
 boolean hasBasicPlay()
          Indicates whether this state is one in which animation is is progress.
 boolean hasBoth(StateFlag s0, StateFlag s1)
          Indicates whether this state has both the given flags.
 boolean hasSome(java.util.EnumSet<StateFlag> ss)
          Indicates whether this state has at least one of the given flags.
 boolean hasSome(StateFlag s0, StateFlag s1)
          Indicates whether this state has at least one of the given flags.
 boolean hasSome(StateFlag s0, StateFlag s1, StateFlag s2)
          Indicates whether this state has at least one of the given flags.
 boolean hasSteadyPlay()
          Indicates whether this state is one in which an animation is being played, without a pending request to stop the player.
 void include(StateFlag s)
          Adds the given flag to this state, if it is not already present, leaving all others unchanged.
 void logChange()
          Records on this state's logger, if it has one, the change between the most recently logged state and the current state, provided the two states differ from one another.
 void oneOutOneIn(StateFlag sout, StateFlag sin)
           
 void remove(StateFlag s)
          Removes the given flag from this state, if it is present, leaving all others unchanged.
 void removeAllPlaying()
          Removes all currently included playing flags from this state, leaving all others unchanged.
 void setOnly(StateFlag s)
          Ensures that this state includes the given flag but no others.
 void setPlayingSiGMLPiped()
           
 void setPlayingSiGMLText()
          Adjusts this state as required for a switch to playing a SiGML text.
 void setPlayingSiGMLURL()
          Adjusts this state as required for a switch to playing a SiGML URL.
 java.lang.String toString()
          Returns a string representation of this state, with one character per flag: an underscore if the flag is not present, the flag's tag character if it is.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EDTState

public EDTState()
Constructs a new state with no flags and no logger.


EDTState

public EDTState(Logger logger)
Constructs a new state with no flags, and using the given logger (which may be null if logging is not required).

Method Detail

toString

public java.lang.String toString()
Returns a string representation of this state, with one character per flag: an underscore if the flag is not present, the flag's tag character if it is.

Overrides:
toString in class java.lang.Object

has

public boolean has(StateFlag s)
Indicates whether this state has the given flag.


hasBoth

public boolean hasBoth(StateFlag s0,
                       StateFlag s1)
Indicates whether this state has both the given flags.


hasSome

public boolean hasSome(StateFlag s0,
                       StateFlag s1)
Indicates whether this state has at least one of the given flags.


hasSome

public boolean hasSome(StateFlag s0,
                       StateFlag s1,
                       StateFlag s2)
Indicates whether this state has at least one of the given flags.


hasSome

public boolean hasSome(java.util.EnumSet<StateFlag> ss)
Indicates whether this state has at least one of the given flags.


hasBasicPlay

public boolean hasBasicPlay()
Indicates whether this state is one in which animation is is progress.


hasSteadyPlay

public boolean hasSteadyPlay()
Indicates whether this state is one in which an animation is being played, without a pending request to stop the player.


remove

public void remove(StateFlag s)
Removes the given flag from this state, if it is present, leaving all others unchanged.


setOnly

public void setOnly(StateFlag s)
Ensures that this state includes the given flag but no others.


include

public void include(StateFlag s)
Adds the given flag to this state, if it is not already present, leaving all others unchanged.


oneOutOneIn

public void oneOutOneIn(StateFlag sout,
                        StateFlag sin)

setPlayingSiGMLURL

public void setPlayingSiGMLURL()
Adjusts this state as required for a switch to playing a SiGML URL.


setPlayingSiGMLText

public void setPlayingSiGMLText()
Adjusts this state as required for a switch to playing a SiGML text.


setPlayingSiGMLPiped

public void setPlayingSiGMLPiped()

removeAllPlaying

public void removeAllPlaying()
Removes all currently included playing flags from this state, leaving all others unchanged.


logChange

public void logChange()
Records on this state's logger, if it has one, the change between the most recently logged state and the current state, provided the two states differ from one another.