org.exist.storage.btree
Class Value
java.lang.Object
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.
EMPTY_VALUE
public static final Value EMPTY_VALUE
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)
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.