Package hec.io

Class Identifier

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, Serializable, Cloneable, Comparable, Observer, Modifiable
Direct Known Subclasses:
G2dIdentifier, MapIdentifier

public class Identifier extends NamedType implements Serializable, Comparable
Identifier is an NamedType used to identify a HecFile or serializable object. The class of the Object can be included within the Identifier. An Identifier can include a Name and Description using NamedType's
getName() setName() and getDescription() setDescription().
See Also:
  • Field Details

    • RMI_FILE_MAP

      protected static final Hashtable RMI_FILE_MAP
    • DEFAULT_RMI_FILE

      protected static final String DEFAULT_RMI_FILE
      See Also:
    • _path

      public String _path
      The path String contained in the Identifier
    • _type

      @Deprecated public Class _type
      Deprecated.
      Replaced by _stringClass The Class contained in the Identifier
    • _stringClass

      public String _stringClass
      A String describing a Class.
    • _file

      public HecFile _file
      The HecFile contained in the Identifier
    • _directory

      public boolean _directory
      The boolean flag indicating if the file contained in the Identifier is a Directory.
    • _length

      protected long _length
      the _length is set by the FileManager during a directory listing.
    • _lastModified

      protected long _lastModified
      the _lastModified is set by the FileManager during a directory listing.
    • _readOnly

      protected boolean _readOnly
      the _readOnly is set by the FileManager during a directory listing.
    • _hidden

      protected boolean _hidden
      the _hidden is set by the FileManager during a directory listing.
  • Constructor Details

    • Identifier

      public Identifier()
      The default constructor. Creates a new Identifier with a null path String, null HecFile, directory flag set to false, a name set to "Untitled", and a description set to "Undescribed".
    • Identifier

      public Identifier(String path)
      Creates a new Identifier based on the default constructor. This identifier sets it's path String to the argument path String. This constructor does not create a HecFile around the path, getFile() will return null.
    • Identifier

      public Identifier(String path, HecFile file)
      Creates a new Identifier based on the default constructor. The Identifier's HecFile is set to the argument HecFile. The Identifier's path String is set to the argument path String.
    • Identifier

      public Identifier(Identifier argId)
      Creates a new Identifier based on the default constructor. The new Identifier's data members are then copied from the argument identifier.
  • Method Details

    • instantiateRmiFile

      public static Object instantiateRmiFile(Identifier id, String extension, Object[] constructorArgs)
    • copy

      public void copy(Identifier argId)
      Copies all of the argument Identifer's values to this Identifer.
    • setFile

      public void setFile(HecFile file)
      Sets the Identifier's HecFile to the argument HecFile. If getName() returns hec.lang.NamedType's defaultName, then sameName is called with the HecFile's getName() as the argument.
      Parameters:
      file -
    • setPath

      public void setPath(String path)
      Sets the Identifier's path String to the argument path Strin
    • getPath

      public String getPath()
      Returns a String describing the Identifier's path

      Returns:
    • getFile

      public HecFile getFile()
      Returns the Identfier's HecFile.
    • toString

      public String toString()
      Returns the Identifier's name. This method is being used for Swing Classes where you can supply a Swing Component with either an Object[] or a Vector of objects. The component Identifies the Object to the user by calling toString() on the Object. For example - if you create a JList using a Vector of Identifiers, the JList will show the Identifier's names in its listing.
      Overrides:
      toString in class NamedType
    • paramString

      public String paramString()
    • setType

      @Deprecated public void setType(Class type)
      Deprecated.
      Replaced by setClassName() Sets the Identifier's Class to the argument Class
    • getType

      @Deprecated public Class getType()
      Deprecated.
      Replaced by getClassName() Returns the Identifier's Class
    • setClassName

      public void setClassName(String type)
      Sets the Identifier's String stringClass to the argument String
    • getClassName

      public String getClassName()
      Returns the Identifier's String stringClass
    • length

      public long length()
      returns the length of the file or if no file the _length member
    • lastModified

      public long lastModified()
      returns the last modified time of the file or if no file the _lastModified member
    • setLength

      public void setLength(long length)
    • setLastModified

      public void setLastModified(long lastModified)
    • setReadOnly

      public void setReadOnly(boolean b)
    • isReadOnly

      public boolean isReadOnly()
    • setHidden

      public void setHidden(boolean b)
    • isHidden

      public boolean isHidden()
    • setIsDirectory

      public void setIsDirectory(boolean isDirectory)
    • isDirectory

      public boolean isDirectory()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(Object obj)
      Specified by:
      compareTo in interface Comparable
      Overrides:
      compareTo in class NamedType
    • initToFile

      public void initToFile(File file)