public class ICEResource extends ICEObject
The Resource class represents persistent data resources used by ICE and the other software packages with which it interacts. This includes files containing simulation input and output data, movies and plots, amongst others.
iComponentListener
Constructor and Description |
---|
ICEResource()
The default constructor.
|
ICEResource(java.io.File resourceFile)
An alternative constructor that takes the File as an argument.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
This operation provides a deep copy of the ICEResource.
|
void |
copy(ICEResource otherResource)
This operation performs a deep copy of the attributes of another
ICEResource into the current ICEResource.
|
boolean |
equals(java.lang.Object otherICEResource)
This operation is used to check equality between the ICEResource and
another ICEResource.
|
java.io.File |
getContents()
This operations returns the contents of the Resource as an instance of
File.
|
java.lang.String |
getLastModificationDate()
This operation returns the last modification date of the file.
|
java.net.URI |
getPath()
This operation returns the URI to the Resource.
|
java.util.ArrayList<Entry> |
getProperties()
This operation associates a set of Entries with the resource that
describe specific properties.
|
int |
hashCode()
This operation returns the hashcode value of the ICEObject.
|
boolean |
isPictureType()
This operation returns true if the ICEResource is an image and false if
not based upon the isPicture attribute.
|
void |
setContents(java.io.File resourceFile)
This operation sets the File which the Resource represents.
|
void |
setPath(java.net.URI path)
This operation sets the path to the Resource and is an alternative to
setContents().
|
void |
setPictureType(boolean isPicture)
An operation that sets the isPicture attribute on ICEResource.
|
void |
setProperties(java.util.ArrayList<Entry> props)
This operation returns the set of Entries that describe specific
properties of the resource.
|
copy, getDescription, getId, getName, register, setDescription, setId, setName, unregister, update
public ICEResource()
The default constructor. If this constructor is used, a second call to setContents() must be made.
public ICEResource(java.io.File resourceFile) throws java.io.IOException
An alternative constructor that takes the File as an argument. The default values of the name, id and description for this class are the filename, 1 and the absolute path, respectively. It is the same as calling the no-arg constructor followed by calling setContents().
resourceFile
- The file that the Resource should be created to represent.
java.io.IOException
public java.lang.String getLastModificationDate()
This operation returns the last modification date of the file.
The date.
public java.io.File getContents()
This operations returns the contents of the Resource as an instance of File.
The file.
public java.net.URI getPath()
This operation returns the URI to the Resource.
The path as a URL.
public void setPath(java.net.URI path)
This operation sets the path to the Resource and is an alternative to setContents(). It will reset the File handle if it is different.
path
- public java.util.ArrayList<Entry> getProperties()
This operation associates a set of Entries with the resource that describe specific properties. The list of Entries is returned by reference and is not a deep copy, i.e. - changing one will change it on the resource.
The properties or null if there are no properties.
public void setProperties(java.util.ArrayList<Entry> props)
This operation returns the set of Entries that describe specific properties of the resource. The properties can be set multiple times.
props
- The properties.
public boolean isPictureType()
This operation returns true if the ICEResource is an image and false if not based upon the isPicture attribute.
True if this is a picture, false otherwise.
public void setPictureType(boolean isPicture)
An operation that sets the isPicture attribute on ICEResource.
isPicture
- Determines if ICEResource is a picture.
public void copy(ICEResource otherResource)
otherResource
- The other ICEResource from which information should be copied.public java.lang.Object clone()
clone
in interface Identifiable
clone
in class ICEObject
public boolean equals(java.lang.Object otherICEResource)
equals
in interface Identifiable
equals
in class ICEObject
otherICEResource
- The other ICEResource to which this ICEResource should be
compared.Identifiable.equals(Object otherObject)
public int hashCode()
hashCode
in interface Identifiable
hashCode
in class ICEObject
Identifiable.hashCode()
public void setContents(java.io.File resourceFile) throws java.io.IOException, java.lang.NullPointerException
This operation sets the File which the Resource represents. The default values of the name, id and description for this class are the filename, 1 and the absolute path, respectively.
resourceFile
- The file that the Resource should be created to represent.
java.io.IOException
java.lang.NullPointerException