Package hec.model
Class Conditional
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.model.Conditional
- All Implemented Interfaces:
AsciiSerializable
,FieldAccessor
,Serializable
,Cloneable
,Comparable
,Observer
,Modifiable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConditionalBlock
protected List<ConditionalItem>
list of ConditionalItemsprotected List
static final int
static final int
static final int
Fields inherited from class hec.lang.NamedType
_description, _ignoreModifiedEvents, _index, _isValid, _modified, _name, defaultDescription, defaultName, DESCRIPTION_CHANGED, NAME_CHANGED, RENAME_EVENT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
clone()
Creates a new object of the same class as this object.void
deleteConditionalBlock
(int cbBlockIndex) boolean
evaluate
(RunTimeStep rts) Evaluates the conditions and returns true or false depending on the value of the ConditionalItem expressions that this object contains.int
return the number of Conditional items this conditional holdsReturns a list of children that are part of this object.getConditionalObjects
(boolean evaluateSubBlocks) return the Objects held by this conditionalgetConditionalObjects
(List objectList, boolean recurse, RunTimeStep rts, boolean evaluateSubBlocks) int
getFieldObject
(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.override to return correct Parent elementvoid
boolean
void
void
moveToTopPriority
(Object obj) protected void
printErrorMessage
(String msg) boolean
boolean
setFieldObject
(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.void
void
setTreeNodeExpanded
(boolean expanded) boolean
toString()
void
Methods inherited from class hec.lang.NamedType
addModifiableListener, compareTo, fireModifiedStateChanged, getDescription, getDisplayName, getIgnoreModifiedEvents, getIndex, getName, isModified, isValid, readResolve, removeModifiableListener, rename, set, setDescription, setIgnoreModifiedEvents, setIndex, setModified, setName, setValid, update, useRecursiveModifiedTest
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
IF_CONDITIONAL
public static final int IF_CONDITIONAL- See Also:
-
ELSE_IF_CONDITIONAL
public static final int ELSE_IF_CONDITIONAL- See Also:
-
ELSE_CONDITIONAL
public static final int ELSE_CONDITIONAL- See Also:
-
_rulesList
-
_conditionalList
list of ConditionalItems -
_conditionalBlock
-
-
Constructor Details
-
Conditional
public Conditional() -
Conditional
public Conditional(int conditionalType) Create a new Conditional object
-
-
Method Details
-
decreaseConditionalObjectPriority
-
increaseConditionalObjectPriority
-
moveToBottomPriority
-
moveToTopPriority
-
updateParentData
public void updateParentData() -
setParent
-
getParent
-
getParentElement
override to return correct Parent element- Returns:
-
removeCondtionalObject
-
clone
Description copied from class:NamedType
Creates a new object of the same class as this object.
It then initializes each of the new object's fields by assigning it the same value as the corresponding field in this object. No
constructor is called. -
getConditionalType
public int getConditionalType() -
getConditionalTypeString
-
conditionalTreeToString
-
toString
-
getConditionalObjects
return the Objects held by this conditional- Returns:
-
getConditionalObjects
public List getConditionalObjects(List objectList, boolean recurse, RunTimeStep rts, boolean evaluateSubBlocks) -
initializeCompute
-
evaluate
Evaluates the conditions and returns true or false depending on the value of the ConditionalItem expressions that this object contains.- Returns:
-
printErrorMessage
-
clearConditionalItems
public void clearConditionalItems() -
addConditionalItem
-
addConditionalBlock
-
getContitionalBlocks
-
getConditionalChildren
Returns a list of children that are part of this object. This would include all ConditionalBlocks or other objects that are dependant on this conditional.- Returns:
-
deleteConditionalBlock
-
getChildCount
public int getChildCount()return the number of Conditional items this conditional holds- Returns:
-
getConditionalItems
-
getFieldObject
Description copied from interface:FieldAccessor
This method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObject
in interfaceFieldAccessor
- Overrides:
getFieldObject
in classNamedType
- Parameters:
fld
- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessor
This allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObject
in interfaceFieldAccessor
- Overrides:
setFieldObject
in classNamedType
- Parameters:
fld
- The java field object representing the member field to be setfobj
- The data to set in that field- Returns:
- returns true if successful
-
shouldTreeNodeExpand
public boolean shouldTreeNodeExpand()- Returns:
-
setTreeNodeExpanded
public void setTreeNodeExpanded(boolean expanded) - Parameters:
expanded
-
-