hep.wired.cut
Class AbstractCondition

java.lang.Object
  extended by hep.wired.cut.AbstractCondition
All Implemented Interfaces:
Condition
Direct Known Subclasses:
BooleanCondition, DoubleCondition, IntegerCondition, LongCondition, StringCondition

public abstract class AbstractCondition
extends Object
implements Condition

Adapter for implementing Condition.

Version:
$Id: AbstractCondition.java 13845 2011-06-09 00:14:38Z onoprien $
Author:
Mark Donszelmann, Dmitry Onoprienko

Field Summary
protected  ConditionDefinition _definition
           
protected  boolean _enabled
           
protected  boolean _inverted
           
protected  boolean _set
           
 
Constructor Summary
AbstractCondition(ConditionDefinition definition, boolean enabled, boolean inverted)
           
 
Method Summary
protected  void fireStateChanged()
          Makes the Cut associated with this Condition fire a ChangeEvent with this Condition as a source.
 Cut getCut()
          Returns the Cut this Condition belongs to.
 ConditionDefinition getDefinition()
          Returns ConditionDefinition associated with this condition.
 boolean isEnabled()
          Returns true is this condition is enabled.
 boolean isInverted()
          Returns true is this condition is inverted.
 void reset()
          Resets condition to its default state.
 void setCut(Cut cut)
          Sets the Cut this Condition belongs to.
 void setEnabled(boolean state)
          Enables or disables this condition.
 void setInverted(boolean state)
          Sets inversion state of this condition.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hep.wired.cut.Condition
get, getStatus, pass, set
 

Field Detail

_definition

protected ConditionDefinition _definition

_enabled

protected boolean _enabled

_inverted

protected boolean _inverted

_set

protected boolean _set
Constructor Detail

AbstractCondition

public AbstractCondition(ConditionDefinition definition,
                         boolean enabled,
                         boolean inverted)
Method Detail

getCut

public Cut getCut()
Returns the Cut this Condition belongs to.

Specified by:
getCut in interface Condition

isEnabled

public boolean isEnabled()
Returns true is this condition is enabled.

Specified by:
isEnabled in interface Condition

isInverted

public boolean isInverted()
Returns true is this condition is inverted.

Specified by:
isInverted in interface Condition

getDefinition

public ConditionDefinition getDefinition()
Returns ConditionDefinition associated with this condition.

Specified by:
getDefinition in interface Condition

setCut

public void setCut(Cut cut)
Sets the Cut this Condition belongs to.

Specified by:
setCut in interface Condition

setEnabled

public void setEnabled(boolean state)
Enables or disables this condition.

Specified by:
setEnabled in interface Condition

setInverted

public void setInverted(boolean state)
Sets inversion state of this condition.

Specified by:
setInverted in interface Condition

reset

public void reset()
Resets condition to its default state. For most kinds of conditions, that means nothing (everything) is cut if the condition is not (is) inverted. Boolean conditions are an exception since their state is fixed.

Specified by:
reset in interface Condition

fireStateChanged

protected void fireStateChanged()
Makes the Cut associated with this Condition fire a ChangeEvent with this Condition as a source.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 1996-2013 FreeHEP. All Rights Reserved.