fi.helsinki.dacopan.ui.tsc
Class NoticeTrigger

java.lang.Object
  extended by fi.helsinki.dacopan.ui.tsc.NoticeTrigger

public class NoticeTrigger
extends java.lang.Object

A class to store an occurrence of some VariableDefinition and its Value in a Transfer Unit, which triggers a notice to be displayed in the TSC animation.


Field Summary
static int EQUALS
          Key for equality test
static int EXISTS
          Key for testing if a variable exists for the transfer unit
static int GREATER
          Key for greater than test
static int GREATER_OR_EQUALS
          Greater than or equals test
static int SMALLER
          Smaller than
static int SMALLER_OR_EQUALS
          Smaller than or equals
 
Constructor Summary
NoticeTrigger(NoticeTrigger sourceTrigger)
          Copy constructor
NoticeTrigger(VariableDefinition variable, java.lang.String value, int type, java.lang.String notice)
          Constructor to be used when creating a new NoticeTrigger
 
Method Summary
 java.lang.String getNotice()
          Getter for the notice text
 int getType()
           
 java.lang.String getValue()
           
 VariableDefinition getVariable()
           
 boolean isEnabled()
           
 void setEnabled(boolean enabled)
           
 void setNotice(java.lang.String notice)
           
 void setType(int type)
           
 void setValue(java.lang.String value)
           
 void setVariable(VariableDefinition variable)
           
 java.lang.String toString()
           
 boolean triggered(TransferUnit unit)
          Tests if the notice has been triggered for a given TransferUnit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EQUALS

public static final int EQUALS
Key for equality test

See Also:
Constant Field Values

EXISTS

public static final int EXISTS
Key for testing if a variable exists for the transfer unit

See Also:
Constant Field Values

GREATER

public static final int GREATER
Key for greater than test

See Also:
Constant Field Values

GREATER_OR_EQUALS

public static final int GREATER_OR_EQUALS
Greater than or equals test

See Also:
Constant Field Values

SMALLER

public static final int SMALLER
Smaller than

See Also:
Constant Field Values

SMALLER_OR_EQUALS

public static final int SMALLER_OR_EQUALS
Smaller than or equals

See Also:
Constant Field Values
Constructor Detail

NoticeTrigger

public NoticeTrigger(VariableDefinition variable,
                     java.lang.String value,
                     int type,
                     java.lang.String notice)
Constructor to be used when creating a new NoticeTrigger

Parameters:
variable - The VariableDefinition to test.
value - The value to test.
type - The type of test
notice - The notice text for the notice.

NoticeTrigger

public NoticeTrigger(NoticeTrigger sourceTrigger)
Copy constructor

Parameters:
sourceTrigger -
Method Detail

triggered

public boolean triggered(TransferUnit unit)
Tests if the notice has been triggered for a given TransferUnit.

Parameters:
unit - Testable unit.
Returns:
Returns true if the trigger is enabled and if the test result is true, otherwise false.

getNotice

public java.lang.String getNotice()
Getter for the notice text

Returns:
The text.

isEnabled

public boolean isEnabled()
Returns:
Returns true if enabled.

setEnabled

public void setEnabled(boolean enabled)
Parameters:
enabled - The enabled to set.

getType

public int getType()
Returns:
Returns the type.

getValue

public java.lang.String getValue()
Returns:
Returns the value.

getVariable

public VariableDefinition getVariable()
Returns:
Returns the variable.

setNotice

public void setNotice(java.lang.String notice)
Parameters:
notice - The notice to set.

setType

public void setType(int type)
Parameters:
type - The type to set.

setValue

public void setValue(java.lang.String value)
Parameters:
value - The value to set.

setVariable

public void setVariable(VariableDefinition variable)
Parameters:
variable - The variable to set.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


© Dacopan2 team, 2005-