JXTA

net.jxta.impl.xindice.core.data
Class Value

java.lang.Object
  extended by net.jxta.impl.xindice.core.data.Value
All Implemented Interfaces:
Comparable
Direct Known Subclasses:
Key

public class Value
extends Object
implements Comparable

Value is the primary base class for all data storing objects. The content window of Value objects are immutable, but the underlying byte array is not.


Field Summary
protected  byte[] data
           
protected  int len
           
protected  int pos
           
 
Constructor Summary
Value(byte[] data)
           
Value(byte[] data, int pos, int len)
           
Value(String data)
           
Value(Value value)
           
 
Method Summary
 int compareTo(Object obj)
           
 int compareTo(Value value)
           
 boolean contains(Value value)
           
 void copyTo(byte[] tdata, int tpos)
           
 void copyTo(byte[] tdata, int tpos, int len)
           
 boolean endsWith(Value value)
           
 boolean equals(Object obj)
           
 boolean equals(Value value)
           
 byte[] getData()
          getData retrieves the data being stored by the Value as a byte array.
 InputStream getInputStream()
          getInputStream returns an InputStream for the Value.
 int getLength()
          getLength retrieves the length of the data being stored by the Value.
 int hashCode()
           
 boolean startsWith(Value value)
           
 void streamTo(OutputStream out)
          streamTo streams the content of the Value to an OutputStream.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

data

protected byte[] data

pos

protected int pos

len

protected int len
Constructor Detail

Value

public Value(Value value)

Value

public Value(byte[] data)

Value

public Value(byte[] data,
             int pos,
             int len)

Value

public Value(String data)
Method Detail

getData

public final byte[] getData()
getData retrieves the data being stored by the Value as a byte array.

Returns:
The Data

getLength

public final int getLength()
getLength retrieves the length of the data being stored by the Value.

Returns:
The Value length

getInputStream

public final InputStream getInputStream()
getInputStream returns an InputStream for the Value.

Returns:
An InputStream

streamTo

public final void streamTo(OutputStream out)
                    throws IOException
streamTo streams the content of the Value to an OutputStream.

Parameters:
out - the OutputStream
Throws:
IOException - if an io error occurs

copyTo

public final void copyTo(byte[] tdata,
                         int tpos)

copyTo

public final void copyTo(byte[] tdata,
                         int tpos,
                         int len)

toString

public final String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Value value)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

compareTo

public final int compareTo(Value value)

compareTo

public final int compareTo(Object obj)
Specified by:
compareTo in interface Comparable

startsWith

public final boolean startsWith(Value value)

endsWith

public final boolean endsWith(Value value)

contains

public final boolean contains(Value value)

JXSE