|
Xindice API version 1.2m1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xindice.core.data.Value
Value is the primary base class for all data storing objects. The content window of value objects are immutable, but the underlying byte array which was used for constructing the value might be not.
Constructor Summary | |
Value(byte[] data)
|
|
Value(byte[] data,
int pos,
int len)
|
|
Value(String data)
|
|
Value(Value value)
Usually there is no need to create a copy of the value, since it is an immutable object. |
Method Summary | |
byte |
byteAt(int index)
Returns the byte at the specified index. |
int |
compareTo(Object obj)
|
int |
compareTo(Value value)
|
void |
copyTo(byte[] tdata,
int tpos)
Copy contents of the value into supplied byte array. |
void |
copyTo(byte[] tdata,
int tpos,
int len)
Copy len bytes of value's content into supplied
byte array. |
boolean |
equals(Object obj)
|
boolean |
equals(Value value)
|
byte[] |
getData()
getData retrieves a copy of the data which is being stored by this value as a byte array. |
InputStream |
getInputStream()
Return an InputStream for the value. |
int |
getLength()
getLength retrieves the length of the data being stored by the Value. |
int |
hashCode()
|
int |
intAt(int index)
Returns the int value at the specified index. |
Key |
keyAt(int start,
int len)
Get a key that is part of this value object. |
short |
shortAt(int index)
Returns the short value at the specified index. |
boolean |
startsWith(Value value)
|
void |
streamTo(OutputStream out)
Stream the content of the value into an OutputStream. |
String |
toString()
|
Value |
valueAt(int start,
int len)
Get a value that is part of this value object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Value(Value value)
value
- the value object which data will be used to construct this
value.public Value(byte[] data)
public Value(byte[] data, int pos, int len)
public Value(String data)
Method Detail |
public final int getLength()
public final byte[] getData()
Data copying is performed in order to ensure immutability of the Value. Avoid using this method if possible.
public final byte byteAt(int index)
index
- byte index
ArrayIndexOutOfBoundsException
- if index is negative number or
is not less that the length of Value datapublic final short shortAt(int index)
index
- short index
ArrayIndexOutOfBoundsException
- if index is negative number or
is not less that the length of the data arraypublic final int intAt(int index)
index
- int index
ArrayIndexOutOfBoundsException
- if index is negative number or
is not less that the length of the data arraypublic final Value valueAt(int start, int len)
start
- beginning indexlen
- length of the new value
ArrayIndexOutOfBoundsException
- if start index is either negative
or isn't less then length of original Valuepublic final Key keyAt(int start, int len)
start
- beginning indexlen
- length of the new key
ArrayIndexOutOfBoundsException
- if start index is either negative
or isn't less then length of original Valuepublic final InputStream getInputStream()
public final void streamTo(OutputStream out) throws IOException
out
- the OutputStream
IOException
- if write failedpublic final void copyTo(byte[] tdata, int tpos)
tdata
- byte array for the valuetpos
- starting positionpublic final void copyTo(byte[] tdata, int tpos, int len)
len
bytes of value's content into supplied
byte array.
tdata
- byte array for the valuetpos
- starting positionlen
- count of bytes to copypublic final boolean startsWith(Value value)
public final int compareTo(Value value)
public final int compareTo(Object obj)
compareTo
in interface Comparable
public int hashCode()
public boolean equals(Value value)
public boolean equals(Object obj)
public final String toString()
|
Xindice API version 1.2m1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |