Package hec.io

Class TextFileReference

java.lang.Object
hec.io.TextFileReference
All Implemented Interfaces:
AsciiSerializable, FieldAccessor, Serializable

public final class TextFileReference extends Object implements AsciiSerializable
See Also:
  • Constructor Details

  • Method Details

    • getValue

      public String getValue()
    • setValue

      public void setValue(String value)
    • getFilename

      public String getFilename()
    • setFilename

      public void setFilename(String filename)
    • setFieldObject

      public boolean setFieldObject(Field fld, Object fobj)
      Description copied from interface: FieldAccessor
      This allows access to fields withing the implementing object to set there data.
      Specified by:
      setFieldObject in interface FieldAccessor
      Parameters:
      fld - The java field object representing the member field to be set
      fobj - The data to set in that field
      Returns:
      returns true if successful
    • getFieldObject

      public Object getFieldObject(Field fld)
      Description copied from interface: FieldAccessor
      This method allows access to java.lang.reflect.Field objects within the implementing class.
      Specified by:
      getFieldObject in interface FieldAccessor
      Parameters:
      fld - The field to get.
      Returns:
      The data object that is stored in the given field
    • getValue

      public static String getValue(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. For example: String currentValue = TextFileReference.getValue(_initScriptRef, _initScript);
      Parameters:
      ref -
      defaultVal -
      Returns:
      defaultVal if ref is null or ref contains a null value.
    • setValue

      public static String setValue(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. 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

      public boolean writeValue(Identifier remoteId) throws IOException
      Throws:
      IOException
    • readValue

      public boolean readValue(Identifier remoteId) throws IOException
      Throws:
      IOException