Package hec.io
Class Identifier
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.io.Identifier
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,Serializable,Cloneable,Comparable,Observer,Modifiable
- Direct Known Subclasses:
G2dIdentifier,MapIdentifier
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().
getName() setName() and getDescription() setDescription().
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanThe boolean flag indicating if the file contained in the Identifier is a Directory.The HecFile contained in the Identifierprotected booleanthe _hidden is set by the FileManager during a directory listing.protected longthe _lastModified is set by the FileManager during a directory listing.protected longthe _length is set by the FileManager during a directory listing.The path String contained in the Identifierprotected booleanthe _readOnly is set by the FileManager during a directory listing.A String describing a Class.Deprecated.Replaced by _stringClass The Class contained in the Identifierprotected static final Stringprotected static final HashtableFields inherited from class hec.lang.NamedType
_description, _ignoreModifiedEvents, _index, _isValid, _modified, _name, defaultDescription, defaultName, DESCRIPTION_CHANGED, NAME_CHANGED, RENAME_EVENT -
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor.Identifier(Identifier argId) Creates a new Identifier based on the default constructor.Identifier(String path) Creates a new Identifier based on the default constructor.Identifier(String path, HecFile file) Creates a new Identifier based on the default constructor. -
Method Summary
Modifier and TypeMethodDescriptionintvoidcopy(Identifier argId) Copies all of the argument Identifer's values to this Identifer.booleanReturns the Identifier's String stringClassgetFile()Returns the Identfier's HecFile.getPath()Returns a String describing the Identifier's pathgetType()Deprecated.Replaced by getClassName() Returns the Identifier's ClassinthashCode()voidinitToFile(File file) static ObjectinstantiateRmiFile(Identifier id, String extension, Object[] constructorArgs) booleanbooleanisHidden()booleanlongreturns the last modified time of the file or if no file the _lastModified memberlonglength()returns the length of the file or if no file the _length membervoidsetClassName(String type) Sets the Identifier's String stringClass to the argument StringvoidSets the Identifier's HecFile to the argument HecFile.voidsetHidden(boolean b) voidsetIsDirectory(boolean isDirectory) voidsetLastModified(long lastModified) voidsetLength(long length) voidSets the Identifier's path String to the argument path StrinvoidsetReadOnly(boolean b) voidDeprecated.Replaced by setClassName() Sets the Identifier's Class to the argument ClasstoString()Returns the Identifier's name.Methods inherited from class hec.lang.NamedType
addModifiableListener, clone, fireModifiedStateChanged, getDescription, getDisplayName, getFieldObject, getIgnoreModifiedEvents, getIndex, getName, isModified, isValid, readResolve, removeModifiableListener, rename, set, setDescription, setFieldObject, setIgnoreModifiedEvents, setIndex, setModified, setName, setValid, update, useRecursiveModifiedTestMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
RMI_FILE_MAP
-
DEFAULT_RMI_FILE
- See Also:
-
_path
The path String contained in the Identifier -
_type
Deprecated.Replaced by _stringClass The Class contained in the Identifier -
_stringClass
A String describing a Class. -
_file
The HecFile contained in the Identifier -
_directory
public boolean _directoryThe boolean flag indicating if the file contained in the Identifier is a Directory. -
_length
protected long _lengththe _length is set by the FileManager during a directory listing. -
_lastModified
protected long _lastModifiedthe _lastModified is set by the FileManager during a directory listing. -
_readOnly
protected boolean _readOnlythe _readOnly 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
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
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
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
-
copy
Copies all of the argument Identifer's values to this Identifer. -
setFile
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
Sets the Identifier's path String to the argument path Strin -
getPath
Returns a String describing the Identifier's path- Returns:
-
getFile
Returns the Identfier's HecFile. -
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. -
paramString
-
setType
Deprecated.Replaced by setClassName() Sets the Identifier's Class to the argument Class -
getType
Deprecated.Replaced by getClassName() Returns the Identifier's Class -
setClassName
Sets the Identifier's String stringClass to the argument 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() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable- Overrides:
compareToin classNamedType
-
initToFile
-