|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.CS8Bit
public final class CS8Bit
Immutable lightweight CharSequence holding 8-bit text only. Internally the text is stored as a byte[] for compactness.
Implements hashCode() and equals() so suitable as a hash key.
| Field Summary | |
|---|---|
static CS8Bit |
EMPTY
Empty sequence. |
private int |
hash
Cache of the computed hash code. |
private static long |
serialVersionUID
Unique serialisation ID. |
private byte[] |
text
The 8-bit text of this sequence; ever null but may be empty. |
| Constructor Summary | |
|---|---|
CS8Bit(byte[] d)
Copy from byte array. |
|
CS8Bit(java.lang.CharSequence other)
Copy from another CharSequence, vetoing if any non-8-bit data. |
|
CS8Bit(TextUtils.CharSequence8Bit other)
Copy from another CharSequence8Bit (defensively). |
|
CS8Bit(TextUtils.CharSequence8Bit other,
int start,
int end)
Copy a sub-sequence of another CharSequence8Bit. |
|
| Method Summary | |
|---|---|
char |
charAt(int index)
|
boolean |
equals(java.lang.Object o)
Equality depends on the entire content being the same. |
int |
hashCode()
The hash is computed over the entire text as for String. |
int |
length()
|
private void |
readObject(java.io.ObjectInputStream in)
Deserialise. |
protected java.lang.Object |
readResolve()
Deserialise: use constructor for validation, etc. |
TextUtils.CharSequence8Bit |
subSequence(int startSS,
int endSS)
Extract subsequence; never null. |
byte[] |
toByteArray()
Create private byte[] copy for caller; never null. |
java.lang.String |
toString()
Convert to String with same char sequence; never null. |
private void |
writeObject(java.io.ObjectOutputStream oos)
Write out a minimally-redundant form of our internal information. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private transient byte[] text
private transient int hash
private static final long serialVersionUID
public static final CS8Bit EMPTY
| Constructor Detail |
|---|
public CS8Bit(byte[] d)
public CS8Bit(TextUtils.CharSequence8Bit other)
public CS8Bit(TextUtils.CharSequence8Bit other,
int start,
int end)
other - other sequence; never nullstart - inclusive start indexend - exclusive end index
public CS8Bit(java.lang.CharSequence other)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException| Method Detail |
|---|
public int length()
length in interface java.lang.CharSequencepublic char charAt(int index)
charAt in interface java.lang.CharSequence
public TextUtils.CharSequence8Bit subSequence(int startSS,
int endSS)
subSequence in interface java.lang.CharSequencepublic final java.lang.String toString()
toString in interface java.lang.CharSequencetoString in class java.lang.Objectpublic final byte[] toByteArray()
toByteArray in interface TextUtils.CharSequence8Bitpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object
private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
private void writeObject(java.io.ObjectOutputStream oos)
throws java.io.IOException
We don't write *any* default state.
We must never be asked to serialise if we have a (non-null) dictionary.
We must never be asked to serialise if the text is too long for us to encode.
java.io.IOExceptionprotected java.lang.Object readResolve()
|
DHD Multimedia Gallery V1.57.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||