Package hec.hecmath

Class DSSFile

java.lang.Object
hec.hecmath.DSSFile
Direct Known Subclasses:
HecDss

public class DSSFile extends Object
  • Field Details

    • _dataManager

      protected DssDataManager _dataManager
      The DSS data manager
    • _filename

      protected String _filename
      The DSS file that this DSSFile object represents
    • _startTime

      protected String _startTime
      the default start of the timewindow
    • _endTime

      protected String _endTime
      the default end of the timewindow
    • _trimMissing

      protected boolean _trimMissing
      specifies whether to trim missing values from start and end of regular time-series
    • _regularStoreMethod

      protected int _regularStoreMethod
    • _irregularStoreMethod

      protected int _irregularStoreMethod
  • Constructor Details

    • DSSFile

      public DSSFile(DssDataManager dataManager)
      Constructor for the DSSFile object
      Parameters:
      dataManager - Description
  • Method Details

    • close

      public void close()
      Explicitly close the DSS file
    • forceMultiUserAccess

      public void forceMultiUserAccess()
    • done

      public void done()
      Release the DSS file for this object
    • isRemote

      public boolean isRemote()
    • getFilename

      public String getFilename()
      get the DSSFile's filename
      Returns:
      the filename
    • getStartTime

      public String getStartTime()
      get the timewindow start time
      Returns:
      the start time
    • getEndTime

      public String getEndTime()
      get the timewindow end time
      Returns:
      the end time
    • getTrimMissing

      public boolean getTrimMissing()
      Gets the "trim missing data" state of the DSSFile object If the "trim missing data" state is TRUE, blocks of missing data will be removed from the start and end of all regular time series records
      Returns:
      true of trim missing is on
    • getRegularStoreMethod

      public int getRegularStoreMethod()
    • getIrregularStoreMethod

      public int getIrregularStoreMethod()
    • getDataManager

      public DssDataManager getDataManager()
    • recordsUpdated

      public int recordsUpdated(long startTime, Vector<String> pathnames, Vector<Long> updateTimes, Vector<Integer> recordTypes)
      Retrieves infomation about record updated since the specified time.

      Any of the vector parameters may be null if that information is not required. Any of the vectors that are not null are cleared before being populated.

      Parameters:
      startTime - Time after which to report updated records - in Java milliseconds
      pathnames - The list of pathnames of the records that have been updated - may be null.
      updateTimes - The list of update times of the records that have been updated - may be null.
      recordTypes - The list of types of the records that have been updated - may be null.
      Returns:
      Zero if successful.
    • recordsUpdated

      public int recordsUpdated(HecTime startTime, Vector<String> pathnames, Vector<Long> updateTimes, Vector<Integer> recordTypes)
    • recordsUpdated

      public int recordsUpdated(String startTime, Vector<String> pathnames, Vector<Long> updateTimes, Vector<Integer> recordTypes)
    • recordsUpdated

      public Vector<String> recordsUpdated(long startTime)
    • recordsUpdated

      public Vector<String> recordsUpdated(HecTime startTime)
    • recordsUpdated

      public Vector<String> recordsUpdated(String startTime)
    • setFilename

      public void setFilename(String filename)
      Sets the Filename attribute of the DSSFile object
      Parameters:
      filename - the new filename
    • setTimeWindow

      public void setTimeWindow(String timeWindow)
      Sets the TimeWindow attribute of the DSSFile object
      Parameters:
      timeWindow - - a string containing the time window, which can be a relative reference ("T-5D T") or a regular date time span ("18MAR2005 28MAR2005" or "18MAR2005 2400 28MAR2005 2400"
    • setTimeWindow

      public void setTimeWindow(String startTime, String endTime)
      Sets the TimeWindow attribute of the DSSFile object
      Parameters:
      startTime - the default start of the timewindow
      endTime - the default end of the timewindow
    • setTrimMissing

      public void setTrimMissing(boolean trimMissing)
      Sets the "trim missing data" state of the DSSFile object If the "trim missing data" state is TRUE, blocks of missing data will be removed from the start and end of all regular time series records
      Parameters:
      trimMissing - the "trim missing data" state
    • setRegularStoreMethod

      public void setRegularStoreMethod(int method)
    • setIrregularStoreMethod

      public void setIrregularStoreMethod(int method)
    • duplicateRecords

      public int duplicateRecords(Vector pathnameList, Vector newPathnameList)
    • duplicateRecords

      public int duplicateRecords(String[] pathnameList, String[] newPathnameList)
    • renameRecords

      public int renameRecords(Vector pathnameList, Vector newPathnameList)
    • renameRecords

      public int renameRecords(String[] pathnameList, String[] newPathnameList)
    • copyRecordsFrom

      public int copyRecordsFrom(String toDSSFilename, Vector pathnameList)
    • copyRecordsFrom

      public int copyRecordsFrom(String toDSSFilename, String[] pathnameList)
    • copyRecordsInto

      public int copyRecordsInto(String fromDSSFilename, Vector pathnameList)
    • copyRecordsInto

      public int copyRecordsInto(String fromDSSFilename, String[] pathnameList)
    • delete

      public int delete(Vector pathnameList)
    • delete

      public int delete(String[] pathnameList)
    • read

      public HecMath read(String pathname) throws HecMathException
      read from the file that this DSSFile represents the DSSPathname specified in pathname.
      Parameters:
      pathname - DSS Pathname to read
      Returns:
      HecMath: Either a TimeSeriesMath for TimeSeries Data or a PairedDataMath for Paired Data , or null if no data found
      Throws:
      HecMathException - Description
      UnsupportedOperationException - if the path name requested is not a TimeSeries record or a Paired Data record DSSFileException if there is an error reading the pathname
    • read

      public HecMath read(String pathname, String timeWindow) throws HecMathException
      read from the file that this DSSFile represents the DSSPathname specified in pathname with the specified start and end times.
      Parameters:
      pathname - DSS Pathname to read
      Returns:
      HecMath: Either a TimeSeriesMath for TimeSeries Data or a PairedDataMath for Paired Data , or null if no data found
      Throws:
      HecMathException - Description
    • read

      public HecMath read(String pathname, String startTime, String endTime) throws HecMathException
      read from the file that this DSSFile represents the DSSPathname specified in pathname with the specified start and end times.
      Parameters:
      pathname - DSS Pathname to read
      startTime - start of time window
      endTime - end of time window
      Returns:
      HecMath: Either a TimeSeriesMath for TimeSeries Data or a PairedDataMath for Paired Data , or null if no data found
      Throws:
      HecMathException - Description
    • read

      public HecMath read(String pathname, String startTime, String endTime, boolean trimMissing) throws HecMathException
      read from the file that this DSSFile represents the DSSPathname specified in pathname with the specified start and end times.
      Parameters:
      pathname - DSS Pathname to read
      startTime - start of time window
      endTime - end of time window
      trimMissing - trim missing from start and end of regular time series
      Returns:
      HecMath: Either a TimeSeriesMath for TimeSeries Data or a PairedDataMath for Paired Data , or null if no data found
      Throws:
      HecMathException - Description
    • write

      public int write(HecMath mathGuy) throws HecMathException
      write the HecMath object out to disk
      Parameters:
      mathGuy - HecMath object
      Returns:
      returns 0 on successful write
      Throws:
      HecMathException - Description
    • write

      public int write(DataContainerTransformer rating) throws HecMathException
      Write a RatingSet object to DSS
      Parameters:
      rating - The rating to store
      Returns:
      0 if successful
      Throws:
      HecMathException
    • write

      public int write(DataContainer dataContainer) throws HecMathException
      write the HecMath object out to disk
      Parameters:
      dataContainer - DataContainer object
      Returns:
      returns 0 on successful write
      Throws:
      HecMathException - Description
    • write

      public int write(TimeSeriesMath mathGuy, String storeMethod) throws HecMathException
      Write a time series to disk with a specified storage method.
      Parameters:
      mathGuy - The TimeSeriesMath object to write.
      storeMethod - The storage method to use. Valid methods (case insensitive) are:
       Regular Time Series
        "REPLACE_ALL"
        "REPLACE_MISSING_VALUES_ONLY"
        "REPLACE_ALL_CREATE"
        "REPLACE_ALL_DELETE"
        "REPLACE_WITH_NON_MISSING"
       Irregular Time Series
        "MERGE"
        "DELETE_INSERT"
      Returns:
      0 if successful. Throws an exception otherwise.
      Throws:
      HecMathException - For invalid parameters or problem with the underlying write.
    • getCatalogedPathnames

      public Vector getCatalogedPathnames()
      Retrieves a list of all cataloged pathnames. The catalog is not refreshed in the process.
      Returns:
      The list of cataloged pathnames.
    • getCatalogedPathnames

      public Vector getCatalogedPathnames(boolean forceNew)
      Retrieves a list of all cataloged pathnames, optionally refreshing the catalog in the process.
      Parameters:
      forceNew - Specifies whether to refresh the catalog before retrieving the pathnames
      Returns:
      The list of cataloged pathnames.
    • getCatalogedPathnames

      public Vector getCatalogedPathnames(String scanString)
      Searches the cataloged pathnames, returning a list of those which match the specified instructions. The catalog is not refreshed in the process.
      Parameters:
      scanString - The matching instructions for the search. This can be a pattern string with which to match the entire pathname, or it can specify pattern strings with which to match one or more parts of the pathname.

      Pattern strings have 2 special characters (actually 4, but 2 are aliases for the other 2). Special characters are:

      • '@' or '*' - means "match zero or more characters at this location" and can occur anywhere in the matching pattern.
      • '#' or '!' - means "negate the sense of this pattern" and can occur only as the first character of the pattern.
      scanString examples:
      • "*FLOW*" matches any pathname that has the characters "FLOW" anywhere in the pathname.
      • "B=TULA C=#TEMP@" matches any pathname that has a B part of "TULA" and a C part that does not begin with "TEMP"
      Returns:
      The list of matching pathnames.
    • searchPathnames

      public Vector searchPathnames(String scanString)
      Searches the DSS file for pathnames, returning a list of those which match the specified instructions. This function does not use the catalog, but access the DSS file directly. Therefore, the pathnames will be unsorted. In comparison to getCatalogedPathnames, If the DSS file has had pathnames added or removed, then searchPathnames will be the fastest function. If not, and you need to do multiple searches, then getCatalogedPathnames will be faster.
      Parameters:
      scanString - The matching instructions for the search. This can be a pattern string with which to match the entire pathname, or it can specify pattern strings with which to match one or more parts of the pathname.

      Pattern strings have 2 special characters (actually 4, but 2 are aliases for the other 2). Special characters are:

      • '@' or '*' - means "match zero or more characters at this location" and can occur anywhere in the matching pattern.
      • '#' or '!' - means "negate the sense of this pattern" and can occur only as the first character of the pattern.
      scanString examples:
      • "*FLOW*" matches any pathname that has the characters "FLOW" anywhere in the pathname.
      • "B=TULA C=#TEMP@" matches any pathname that has a B part of "TULA" and a C part that does not begin with "TEMP"
      Returns:
      The list of matching pathnames.
    • getCatalogedPathnames

      public Vector getCatalogedPathnames(String scanString, boolean forceNew)
      Searches the cataloged pathnames, returning a list of those which match the specified instructions - optionally refreshing the catalog in the process.
      Parameters:
      scanString - The matching instructions for the search. This can be a pattern string with which to match the entire pathname, or it can specify pattern strings with which to match one or more parts of the pathname.

      Pattern strings have 2 special characters (actually 4, but 2 are aliases for the other 2). Special characters are:

      • '@' or '*' - means "match zero or more characters at this location" and can occur anywhere in the matching pattern.
      • '#' or '!' - means "negate the sense of this pattern" and can occur only as the first character of the pattern.
      scanString examples:
      • "*FLOW*" matches any pathname that has the characters "FLOW" anywhere in the pathname.
      • "B=TULA C=#TEMP@" matches any pathname that has a B part of "TULA" and a C part that does not begin with "TEMP"
      forceNew - Specifies whether to refresh the catalog before performing the search.
      Returns:
      The list of matching pathnames.
    • recordExists

      public boolean recordExists(String pathname)
      check to see if the record specified by pathname exists in this file
      Parameters:
      pathname - the DSS pathname to check
      Returns:
      true if the record exists.