Class BaseAltGlobalData

java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.rss.model.globalvariable.BaseAltGlobalData
All Implemented Interfaces:
AsciiSerializable, FieldAccessor, GlobalVariableData, Serializable, Cloneable, Comparable, Observer, rma.lang.Modifiable
Direct Known Subclasses:
AltExternalGlobalData, AltScalarGlobalData, AltStringGlobalData, AltTableGlobalData

public abstract class BaseAltGlobalData extends NamedType implements GlobalVariableData
See Also:
  • Field Details

    • _value

      protected String _value
    • _globalVariable

      protected transient GlobalVariable _globalVariable
  • Constructor Details

    • BaseAltGlobalData

      public BaseAltGlobalData()
    • BaseAltGlobalData

      public BaseAltGlobalData(GlobalVariable gv, String value)
      Parameters:
      gv -
      value -
  • Method Details

    • getValue

      public String getValue()
      Specified by:
      getValue in interface GlobalVariableData
    • getType

      public abstract GlobalVariableType getType()
      Specified by:
      getType in interface GlobalVariableData
    • setValue

      public void setValue(Object value)
      Specified by:
      setValue in interface GlobalVariableData
      Parameters:
      value -
    • getCoercedValue

      protected Object getCoercedValue(Object value)
      Parameters:
      value -
      Returns:
    • canCoerceValue

      protected boolean canCoerceValue(Object value)
      Parameters:
      value -
      Returns:
    • getDSSFilename

      public String getDSSFilename()
      Specified by:
      getDSSFilename in interface GlobalVariableData
      Returns:
    • setDSSFilename

      public void setDSSFilename(String name)
      Specified by:
      setDSSFilename in interface GlobalVariableData
      Parameters:
      name -
    • getRelativePath

      public String getRelativePath(String pathName)
      Parameters:
      pathName -
      Returns:
    • setGVDataSet

      public void setGVDataSet(GVDataSet gvDataSet)
      Specified by:
      setGVDataSet in interface GlobalVariableData
    • getGVDataSet

      public GVDataSet getGVDataSet()
      Specified by:
      getGVDataSet in interface GlobalVariableData
      Returns:
    • getDSSPathname

      public String getDSSPathname()
      Specified by:
      getDSSPathname in interface GlobalVariableData
    • getDSSPathname

      public String getDSSPathname(boolean update)
    • setDSSPathname

      public void setDSSPathname(String dssPathname)
      Specified by:
      setDSSPathname in interface GlobalVariableData
      Parameters:
      dssPathname -
    • getDssEPart

      protected String getDssEPart()
    • writeDssTextValue

      protected boolean writeDssTextValue(String alternateDssFile, Object value)
      Parameters:
      value -
      Returns:
    • loadData

      public boolean loadData()
      Specified by:
      loadData in interface GlobalVariableData
      Returns:
      - true if successfully loaded
    • readDssData

      public boolean readDssData(String dssFile, String dssPath)
      Specified by:
      readDssData in interface GlobalVariableData
    • readDssTextValue

      protected String readDssTextValue()
      Returns:
    • readDssTextValue

      protected String readDssTextValue(String dssFile, String dssPath)
    • writeData

      public boolean writeData(BufferedWriter out, String alternateDssFile)
      Specified by:
      writeData in interface GlobalVariableData
      Parameters:
      out - BufferedWriter to write to
      alternateDssFile - an alternative DSS File to write to. Can be null, which if so use getDSSFilename()
      Returns:
      true if successful
    • writeAdditionalInfo

      protected void writeAdditionalInfo(BufferedWriter out) throws IOException
      Parameters:
      out -
      Throws:
      IOException
    • readData

      public boolean readData(BufferedReader input)
      Specified by:
      readData in interface GlobalVariableData
      Parameters:
      input - - buffered reader to read from
      Returns:
      - true if successfully read
    • parseGVRecord

      protected void parseGVRecord(String type, String param)
      Parameters:
      type -
      param -
    • writeDssData

      public abstract boolean writeDssData(String alternateDssFile)
      Specified by:
      writeDssData in interface GlobalVariableData
    • finishWritingData

      protected boolean finishWritingData(String alternateDssFile)
      method for subclasses that need to do more than just the standard write data
      Returns:
      true for success
    • finishReadingData

      protected boolean finishReadingData()
      method for subclasses to override to finsih reading data
      Returns:
      true for success
    • setGlobalVariable

      public void setGlobalVariable(GlobalVariable globalVariable)
      Specified by:
      setGlobalVariable in interface GlobalVariableData
      Parameters:
      globalVariable - - the network global variable associated with this data
    • clone

      public GlobalVariableData 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.
      Specified by:
      clone in interface GlobalVariableData
      Overrides:
      clone in class NamedType
    • getGlobalVariableDataLocation

      public GlobalVariableDataLocation getGlobalVariableDataLocation()
      Specified by:
      getGlobalVariableDataLocation in interface GlobalVariableData
    • copyInto

      public boolean copyInto(GlobalVariableData copyFromGv)
      Description copied from interface: GlobalVariableData
      copy into this GlobalVariableData the contents from copyFromGv
      Specified by:
      copyInto in interface GlobalVariableData
      Parameters:
      copyFromGv -
    • markForDelete

      public void markForDelete(boolean markedForDelete)
      Specified by:
      markForDelete in interface GlobalVariableData
    • isMarkedForDeletion

      public boolean isMarkedForDeletion()
      Specified by:
      isMarkedForDeletion in interface GlobalVariableData
    • equals

      public boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. same class type and same name
      Overrides:
      equals in class Object
      Parameters:
      o - the other object
      Returns:
      true if they are considered equal
    • hashCode

      public int hashCode()
      Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.
      Overrides:
      hashCode in class Object
      Returns:
      the hashcode for this object