|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.ROIntArray
public final class ROIntArray
An immutable, Serializable, wrapper for an int array. This enables int array data to be safely shared between multiple users, thus avoid copies and duplicates.
We clone at entry and exit and deserialisation to protect our internal data.
These instances are suitable for pooling with MemoryTools.intern().
Intended to be efficient on the wire and in memory.
| Field Summary | |
|---|---|
static ROIntArray |
EMPTY
Empty array. |
private int[] |
payload
The (non-null) payload reference. |
private static long |
serialVersionUID
Unique Serialisation class ID. |
| Constructor Summary | |
|---|---|
ROIntArray(int[] data)
Construct with (copy of) non-null data block. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Is equal to an instance with a payload of the same length and content; may be slow to compute. |
int |
get(int index)
Get value at specified index. |
int[] |
getData()
Get (a copy of) the entire data block. |
int[] |
getData(int start,
int afterEnd)
Get (a copy of) a portion of the data block. |
int |
hashCode()
Compute a hash based on the length and some of the payload. |
int |
length()
Get length of the data; non-negative. |
protected java.lang.Object |
readResolve()
Deserialise: use constructor for validation, defensive copying, etc. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final int[] payload
public static final ROIntArray EMPTY
private static final long serialVersionUID
| Constructor Detail |
|---|
public ROIntArray(int[] data)
data - non-null array of bytes| Method Detail |
|---|
public int[] getData()
public int[] getData(int start,
int afterEnd)
public int length()
public int get(int index)
public int hashCode()
This takes a fixed small number of sample points whose relative positions partly depend on the length, and the length itself is part of the hash.
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectprotected java.lang.Object readResolve()
|
DHD Multimedia Gallery V1.53.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||