Package hec.model
Class ConditionalBlock
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.model.ConditionalBlock
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,Serializable,Cloneable,Comparable,Observer,Modifiable
- See Also:
-
Field Summary
FieldsFields 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 TypeMethodDescriptionvoidaddConditional(int index, Conditional c) Inserts the specified Conditional at the specified position in this list (optional operation).voidvoidclone()Creates a new object of the same class as this object.voiddeleteConditionalBlock(int cbBlockIndex) voidduplicateConditionals(ConditionalBlock copyIntoBlock) make a copy of the top level items, and reuse lower itemsgetEvaluatedItems(RunTimeStep rts, List objList) Returns a list of conditional objects (objects owned by a conditional) if that conditional evalutes to a boolean value of truegetFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.floatgetUnEvaluatedItems(List objList) Returns a list of conditional objects (objects owned by a conditional) no matter what a conditional evalutates to.booleanhasElse()does this ConditionalBlock have an ELSEbooleanvoidremove(Conditional cond) booleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.voidvoidsetPriority(float priority) voidsetTreeNodeExpanded(boolean expanded) booleantoString()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, useRecursiveModifiedTestMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
_conditionals
-
-
Constructor Details
-
ConditionalBlock
public ConditionalBlock() -
ConditionalBlock
-
-
Method Details
-
setParent
-
initializeCompute
-
deleteConditionalBlock
public void deleteConditionalBlock(int cbBlockIndex) -
getParent
-
remove
-
clone
Description copied from class:NamedTypeCreates 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. -
getEvaluatedItems
Returns a list of conditional objects (objects owned by a conditional) if that conditional evalutes to a boolean value of true- Parameters:
objList-- Returns:
-
getUnEvaluatedItems
Returns a list of conditional objects (objects owned by a conditional) no matter what a conditional evalutates to.- Parameters:
objList-- Returns:
-
getConditionals
-
clearConditionals
public void clearConditionals() -
setPriority
public void setPriority(float priority) -
getPriority
public float getPriority() -
addConditional
Inserts the specified Conditional at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). In some cases the index value will be modified IF and ELSE conditional items are restricted to the first and list position in the list so the "index" value is ignored. ELSE_IF conditionals will always be constrained to be between the IF and ELSE conditionals items. The method will not allow the index to be used to insert an ELSE_IF before an IF or after an ELSE conditional.- Parameters:
index- index at which the specified element is to be insertedc- element to be inserted- Throws:
UnsupportedOperationException- if the add operation is not supported by this listClassCastException- if the class of the specified element prevents it from being added to this listIllegalArgumentException- if some property of the specified element prevents it from being added to this listIndexOutOfBoundsException- if the index is out of range (index < 0 || index > size())
-
addConditional
-
hasElse
public boolean hasElse()does this ConditionalBlock have an ELSE- Returns:
- true if has an ELSE Conditional
-
toString
-
getFieldObject
Description copied from interface:FieldAccessorThis method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObjectin interfaceFieldAccessor- Overrides:
getFieldObjectin classNamedType- Parameters:
fld- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessorThis allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObjectin interfaceFieldAccessor- Overrides:
setFieldObjectin 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
-
duplicateConditionals
make a copy of the top level items, and reuse lower items -
shouldTreeNodeExpand
public boolean shouldTreeNodeExpand()- Returns:
-
setTreeNodeExpanded
public void setTreeNodeExpanded(boolean expanded)
-