hep.wired.cut
Class StringCondition

java.lang.Object
  extended by hep.wired.cut.AbstractCondition
      extended by hep.wired.cut.StringCondition
All Implemented Interfaces:
Condition

public class StringCondition
extends AbstractCondition

Condition based on comparison with String set.

Version:
$Id: StringCondition.java 13824 2011-05-04 18:30:02Z onoprien $
Author:
Mark Donszelmann, Dmitry Onoprienko

Field Summary
 
Fields inherited from class hep.wired.cut.AbstractCondition
_definition, _enabled, _inverted, _set
 
Constructor Summary
StringCondition(StringConditionDefinition definition)
           
StringCondition(StringConditionDefinition definition, boolean enabled, boolean inverted)
           
StringCondition(StringConditionDefinition definition, boolean enabled, boolean inverted, Collection<String> pass)
           
StringCondition(StringConditionDefinition definition, Collection<String> pass)
           
 
Method Summary
 Set<String> get()
          Returns the set of strings that satisfy this condition.
 StringConditionDefinition getDefinition()
          Returns ConditionDefinition associated with this condition.
 String getStatus()
          Returns status string describing what attribute values satisfy this condition in its current state.
 boolean pass(org.freehep.util.Value value)
          Returns true is the value satisfies this condition.
 void reset()
          Resets condition to its default state.
 void set(Collection<String> pass)
          Sets the set of strings that satisfy this condition.
 void set(Object value)
          Sets criteria to be used by this condition.
 
Methods inherited from class hep.wired.cut.AbstractCondition
fireStateChanged, getCut, isEnabled, isInverted, setCut, setEnabled, setInverted, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringCondition

public StringCondition(StringConditionDefinition definition)

StringCondition

public StringCondition(StringConditionDefinition definition,
                       boolean enabled,
                       boolean inverted)

StringCondition

public StringCondition(StringConditionDefinition definition,
                       Collection<String> pass)

StringCondition

public StringCondition(StringConditionDefinition definition,
                       boolean enabled,
                       boolean inverted,
                       Collection<String> pass)
Method Detail

pass

public boolean pass(org.freehep.util.Value value)
Returns true is the value satisfies this condition. If the condition is not inverted, value.getString() must be contained in String set associated with this condition. If the condition is inverted, the value must not be contained in the set.


set

public void set(Collection<String> pass)
Sets the set of strings that satisfy this condition.


set

public void set(Object value)
Sets criteria to be used by this condition. The actual type of the argument should be Collection<String>, otherwise ClassCastException is thrown.


reset

public void reset()
Resets condition to its default state.

Specified by:
reset in interface Condition
Overrides:
reset in class AbstractCondition

getDefinition

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

Specified by:
getDefinition in interface Condition
Overrides:
getDefinition in class AbstractCondition

get

public Set<String> get()
Returns the set of strings that satisfy this condition.


getStatus

public String getStatus()
Returns status string describing what attribute values satisfy this condition in its current state.



Copyright © 1996-2013 FreeHEP. All Rights Reserved.