org.apache.cassandra.dht
Class AbstractBounds<T extends RingPosition>

java.lang.Object
  extended by org.apache.cassandra.dht.AbstractBounds<T>
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Bounds, ExcludingBounds, IncludingExcludingBounds, Range

public abstract class AbstractBounds<T extends RingPosition>
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Nested Class Summary
static class AbstractBounds.AbstractBoundsSerializer
           
 
Field Summary
 T left
           
protected  IPartitioner partitioner
           
 T right
           
static AbstractBounds.AbstractBoundsSerializer serializer
           
 
Constructor Summary
AbstractBounds(T left, T right, IPartitioner partitioner)
           
 
Method Summary
abstract  boolean contains(T start)
           
protected abstract  java.lang.String getClosingString()
           
protected abstract  java.lang.String getOpeningString()
           
 java.lang.String getString(AbstractType<?> keyValidator)
           
 int hashCode()
           
 boolean intersects(java.lang.Iterable<Range<T>> ranges)
          return true if @param range intersects any of the given @param ranges
abstract  Pair<AbstractBounds<T>,AbstractBounds<T>> split(T position)
          Given token T and AbstractBounds ?L,R?, returns Pair(?L,T], (T,R?), where ? means that the same type of AbstractBounds is returned as the original.
abstract  AbstractBounds<RowPosition> toRowBounds()
          Transform this abstract bounds to equivalent covering bounds of row positions.
abstract  AbstractBounds<Token> toTokenBounds()
          Transform this abstract bounds to a token abstract bounds.
abstract  java.util.List<? extends AbstractBounds<T>> unwrap()
           
abstract  AbstractBounds<T> withNewRight(T newRight)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serializer

public static final AbstractBounds.AbstractBoundsSerializer serializer

left

public final T extends RingPosition left

right

public final T extends RingPosition right

partitioner

protected final transient IPartitioner partitioner
Constructor Detail

AbstractBounds

public AbstractBounds(T left,
                      T right,
                      IPartitioner partitioner)
Method Detail

split

public abstract Pair<AbstractBounds<T>,AbstractBounds<T>> split(T position)
Given token T and AbstractBounds ?L,R?, returns Pair(?L,T], (T,R?), where ? means that the same type of AbstractBounds is returned as the original. Put another way, returns a Pair of everything this AbstractBounds contains up to and including the split position, and everything it contains after (not including the split position). The original AbstractBounds must either contain the position T, or T should be equals to the left bound L. If the split would only yield the same AbstractBound, null is returned instead.


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

intersects

public boolean intersects(java.lang.Iterable<Range<T>> ranges)
return true if @param range intersects any of the given @param ranges


contains

public abstract boolean contains(T start)

unwrap

public abstract java.util.List<? extends AbstractBounds<T>> unwrap()

getString

public java.lang.String getString(AbstractType<?> keyValidator)

getOpeningString

protected abstract java.lang.String getOpeningString()

getClosingString

protected abstract java.lang.String getClosingString()

toRowBounds

public abstract AbstractBounds<RowPosition> toRowBounds()
Transform this abstract bounds to equivalent covering bounds of row positions. If this abstract bounds was already an abstractBounds of row positions, this is a noop.


toTokenBounds

public abstract AbstractBounds<Token> toTokenBounds()
Transform this abstract bounds to a token abstract bounds. If this abstract bounds was already an abstractBounds of token, this is a noop, otherwise this use the row position tokens.


withNewRight

public abstract AbstractBounds<T> withNewRight(T newRight)


Copyright © 2013 The Apache Software Foundation