Package hec.io
Class TextFileReference
java.lang.Object
hec.io.TextFileReference
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,Serializable
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptiongetFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.getValue()static StringgetValue(TextFileReference ref, String defaultVal) Useful when a TextFileReference is used along side a String field and only one object is meant to hold the current value.booleanreadValue(Identifier remoteId) booleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.voidsetFilename(String filename) static StringsetValue(TextFileReference ref, String script) Useful when a TextFileReference is used along side a String field and only one object is meant to hold the current value.voidbooleanwriteValue(Identifier remoteId)
-
Constructor Details
-
TextFileReference
public TextFileReference() -
TextFileReference
-
-
Method Details
-
getValue
-
setValue
-
getFilename
-
setFilename
-
setFieldObject
Description copied from interface:FieldAccessorThis allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObjectin interfaceFieldAccessor- 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
-
getFieldObject
Description copied from interface:FieldAccessorThis method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObjectin interfaceFieldAccessor- Parameters:
fld- The field to get.- Returns:
- The data object that is stored in the given field
-
getValue
Useful when a TextFileReference is used along side a String field and only one object is meant to hold the current value. For example: String currentValue = TextFileReference.getValue(_initScriptRef, _initScript);- Parameters:
ref-defaultVal-- Returns:
- defaultVal if ref is null or ref contains a null value.
-
setValue
Useful when a TextFileReference is used along side a String field and only one object is meant to hold the current value. For example: _initScript = TextFileReference.setValue(_initScriptRef, script);Retrieving the value from the two fields can be accomplished like: String currentValue = TextFileReference.getValue(_initScriptRef, _initScript);
- Parameters:
ref-script-- Returns:
- null if ref value was updated. otherwise returns script value.
-
writeValue
- Throws:
IOException
-
readValue
- Throws:
IOException
-