|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.ExhibitStaticAttr
public final class ExhibitStaticAttr
Immutable, Serializable collection of the basic static attributes of an exhibit. This is designed to be fast to do comparisons against, and to be transportable across a network, persistable to disc, and easy to run filtering queries against.
This verifies that its contents make sense at construction and after deserialisation.
This is keyed on the exhibit underlying name, but should be easy to use with other comparators.
The timestamp can be used to compare that the version of the object held is up-to-date.
Some core values are made available as public final fields for speed of access.
Note: an older implementation used String for its filePath field; this is converted on deserialisation now.
| Field Summary | |
|---|---|
private Name.ExhibitFull |
filePath
The full (relative) path/name of the exhibit; never null. |
long |
length
The length of the exhibit in bytes; strictly positive. |
private static long |
serialVersionUID
Unique serialisation ID. |
long |
timestamp
The Java-style timestamp (last-modified-time) of the exhibit (ms); strictly positive. |
| Constructor Summary | |
|---|---|
|
ExhibitStaticAttr(java.lang.CharSequence filePath,
long length,
long timestamp)
Construct new immutable instance. |
private |
ExhibitStaticAttr(Name.ExhibitFull filePath)
Used by makeNameOnlyKey() to make a name-only key efficiently. |
|
ExhibitStaticAttr(Name.ExhibitFull filePath,
long length,
long timestamp)
Construct new immutable instance. |
| Method Summary | |
|---|---|
int |
compareTo(ExhibitStaticAttr o)
Comparison/ordering is on the exhibit name alone. |
boolean |
equals(java.lang.Object o)
All comparison is done on the name only, NOT on all fields. |
java.lang.CharSequence |
getCharSequence()
Get the file path (full exhibit name) as an immutable CharSequence; never null. |
Name.ExhibitFull |
getExhibitFullName()
Get the full exhibit name; never null. |
java.lang.String |
getFilePath()
Get the file path (full exhibit name) as a String; never null. |
java.lang.Comparable<?> |
getKey()
Extract compound key that depends on all the fields; never null. |
int |
hashCode()
All comparison is done on the name. |
boolean |
isIdentical(ExhibitStaticAttr other)
Tests that instances are identical in all parameters. |
static ExhibitStaticAttr |
makeNameOnlyKey(java.lang.CharSequence filePath)
Generate a lookup key with just the name significant; never null. |
static ExhibitStaticAttr |
makeNameOnlyKey(Name.ExhibitFull filePath)
Generate a lookup key with just the name significant; never null. |
private void |
readObject(java.io.ObjectInputStream in)
Deserialise. |
java.lang.String |
toString()
Human-readable summary contains at least the name; never null. |
void |
validateObject()
Validate fields/state. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final Name.ExhibitFull filePath
All run-time instances will have the same type, except possibly fleetingly during (de)serialisation.
The field type was CharSequence to allow reading in of old String-valued instances but is now converted at deserialistion time to Name.ExhibitFull if not already so.
public final long length
public final long timestamp
private static final long serialVersionUID
| Constructor Detail |
|---|
public ExhibitStaticAttr(java.lang.CharSequence filePath,
long length,
long timestamp)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - in the case of a null or invalid filePath
public ExhibitStaticAttr(Name.ExhibitFull filePath,
long length,
long timestamp)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - in the case of a null or invalid filePathprivate ExhibitStaticAttr(Name.ExhibitFull filePath)
filePath - must be non-null| Method Detail |
|---|
public final int hashCode()
hashCode in class java.lang.Objectpublic final boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String getFilePath()
public Name.ExhibitFull getExhibitFullName()
public java.lang.CharSequence getCharSequence()
public java.lang.String toString()
toString in class java.lang.Objectpublic final int compareTo(ExhibitStaticAttr o)
compareTo in interface java.lang.Comparable<ExhibitStaticAttr>public final boolean isIdentical(ExhibitStaticAttr other)
public java.lang.Comparable<?> getKey()
public static ExhibitStaticAttr makeNameOnlyKey(Name.ExhibitFull filePath)
java.lang.IllegalArgumentException - in the case of a null filePathpublic static ExhibitStaticAttr makeNameOnlyKey(java.lang.CharSequence filePath)
java.lang.IllegalArgumentException - in the case of a null or invalid filePath
private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void validateObject()
throws java.io.InvalidObjectException
Barf if something bad is found. (Maybe allow some extra info in debug version.)
validateObject in interface java.io.ObjectInputValidationjava.io.InvalidObjectException
|
DHD Multimedia Gallery V1.60.69 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||