org.apache.cassandra.dht
Class AbstractBounds
java.lang.Object
org.apache.cassandra.dht.AbstractBounds
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- Bounds, Range
public abstract class AbstractBounds
- extends java.lang.Object
- implements java.io.Serializable
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
left
public final Token left
right
public final Token right
partitioner
protected final transient IPartitioner partitioner
AbstractBounds
public AbstractBounds(Token left,
Token right,
IPartitioner partitioner)
serializer
public static ICompactSerializer2<AbstractBounds> serializer()
split
public Pair<AbstractBounds,AbstractBounds> split(Token token)
- Given token T and AbstractBounds ?L,R], returns Pair(?L,T], ?T,R])
(where ? means that the same type of Bounds is returned -- Range or Bounds -- as the original.)
The original AbstractBounds must contain the token T.
If the split would cause one of the left or right side to be empty, it will be null in the result pair.
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public abstract boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
contains
public abstract boolean contains(Token start)
createFrom
public abstract AbstractBounds createFrom(Token right)
- Returns:
- A clone of this AbstractBounds with a new right Token, or null if an identical range would be created.
unwrap
public abstract java.util.List<AbstractBounds> unwrap()
normalize
public static java.util.List<AbstractBounds> normalize(java.util.Collection<? extends AbstractBounds> bounds)
- Returns:
- A copy of the given list of with all bounds unwrapped, sorted by bound.left and with overlapping bounds merged.
This method does not allow allow to mix Range and Bound in the input list.
Copyright © 2011 The Apache Software Foundation