org.exist.storage.btree
Class Value

java.lang.Object
  extended by org.exist.storage.btree.Value
All Implemented Interfaces:
Comparable
Direct Known Subclasses:
CollectionStore.CollectionKey, CollectionStore.DocumentKey, ElementValue, NativeBroker.NodeRef

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
static Value EMPTY_VALUE
           
 
Constructor Summary
Value()
           
Value(byte[] data)
           
Value(byte[] data, int pos, int len)
           
Value(String data)
           
Value(Value value)
           
 
Method Summary
 int checkPrefix(Value prefix)
           
 int commonPrefix(Value other)
          Returns the length of the common prefix this value shares with the specified other value (if any).
 int comparePrefix(Value value)
           
 int comparePrefix(Value prefix, Value keyPrefix)
           
 int compareTo(Object obj)
           
 int compareTo(Value value)
           
 byte[] data()
           
 String dump()
           
 boolean endsWith(Value value)
           
 boolean equals(Object obj)
           
 boolean equals(Value value)
           
 long getAddress()
           
 byte[] getData()
          getData retrieves the data being stored by the Value as a byte array.
 int getLength()
          getLength retrieves the length of the data being stored by the Value.
 Value getSeparator(Value other)
           
 int hashCode()
           
 void setAddress(long addr)
           
 int start()
           
 boolean startsWith(Value value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_VALUE

public static final Value EMPTY_VALUE
Constructor Detail

Value

public Value()

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

setAddress

public void setAddress(long addr)

getAddress

public long getAddress()

getData

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

Returns:
The Data

data

public final byte[] data()

start

public final int start()

getLength

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

Returns:
The Value length

toString

public 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

comparePrefix

public final int comparePrefix(Value value)

comparePrefix

public final int comparePrefix(Value prefix,
                               Value keyPrefix)

startsWith

public final boolean startsWith(Value value)

endsWith

public final boolean endsWith(Value value)

commonPrefix

public int commonPrefix(Value other)
Returns the length of the common prefix this value shares with the specified other value (if any).

Parameters:
other - the other value
Returns:
length of the common prefix, 0 if there is none

checkPrefix

public int checkPrefix(Value prefix)

getSeparator

public Value getSeparator(Value other)

dump

public String dump()


Copyright (C) Wolfgang Meier. All rights reserved.