org.apache.accumulo.core.data
Class Range

java.lang.Object
  extended by org.apache.accumulo.core.data.Range
All Implemented Interfaces:
java.lang.Comparable<Range>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<Range>

public class Range
extends java.lang.Object
implements org.apache.hadoop.io.WritableComparable<Range>


Constructor Summary
Range()
          Creates a range that goes from negative to positive infinity
Range(java.lang.CharSequence row)
          Creates a range that covers an entire row
Range(java.lang.CharSequence startRow, boolean startRowInclusive, java.lang.CharSequence endRow, boolean endRowInclusive)
          Creates a range from startRow inclusive to endRow inclusive
Range(java.lang.CharSequence startRow, java.lang.CharSequence endRow)
          Creates a range from startRow inclusive to endRow inclusive
Range(Key startKey, boolean startKeyInclusive, Key endKey, boolean endKeyInclusive)
           
Range(Key startKey, Key endKey)
          Creates a range from startKey inclusive to endKey inclusive
Range(Key start, Key stop, boolean startKeyInclusive, boolean stopKeyInclusive, boolean infiniteStartKey, boolean infiniteStopKey)
           
Range(Range range)
          Copy constructor
Range(org.apache.hadoop.io.Text row)
          Creates a range that covers an entire row
Range(org.apache.hadoop.io.Text startRow, boolean startRowInclusive, org.apache.hadoop.io.Text endRow, boolean endRowInclusive)
          Creates a range from startRow inclusive to endRow inclusive
Range(org.apache.hadoop.io.Text startRow, org.apache.hadoop.io.Text endRow)
          Creates a range from startRow inclusive to endRow inclusive
Range(TRange trange)
           
 
Method Summary
 boolean afterEndKey(Key key)
           
 boolean beforeStartKey(Key key)
           
 Range bound(Column min, Column max)
           
 Range clip(Range range)
           
 Range clip(Range range, boolean returnNullIfDisjoint)
           
 int compareTo(Range o)
           
 boolean contains(Key key)
           
 boolean equals(java.lang.Object o)
           
 boolean equals(Range otherRange)
           
 Key getEndKey()
           
 Key getStartKey()
           
 int hashCode()
           
 boolean isEndKeyInclusive()
           
 boolean isInfiniteStartKey()
           
 boolean isInfiniteStopKey()
           
 boolean isStartKeyInclusive()
           
static java.util.List<Range> mergeOverlapping(java.util.Collection<Range> ranges)
           
 void readFields(java.io.DataInput in)
           
 java.lang.String toString()
           
 TRange toThrift()
           
 void write(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Range

public Range()
Creates a range that goes from negative to positive infinity


Range

public Range(Key startKey,
             Key endKey)
Creates a range from startKey inclusive to endKey inclusive

Parameters:
startKey - set this to null when negative infinity is needed
endKey - set this to null when positive infinity is needed

Range

public Range(java.lang.CharSequence row)
Creates a range that covers an entire row

Parameters:
row - set this to null to cover all rows

Range

public Range(org.apache.hadoop.io.Text row)
Creates a range that covers an entire row

Parameters:
row - set this to null to cover all rows

Range

public Range(org.apache.hadoop.io.Text startRow,
             org.apache.hadoop.io.Text endRow)
Creates a range from startRow inclusive to endRow inclusive

Parameters:
startRow - set this to null when negative infinity is needed
endRow - set this to null when positive infinity is needed

Range

public Range(java.lang.CharSequence startRow,
             java.lang.CharSequence endRow)
Creates a range from startRow inclusive to endRow inclusive

Parameters:
startRow - set this to null when negative infinity is needed
endRow - set this to null when positive infinity is needed

Range

public Range(org.apache.hadoop.io.Text startRow,
             boolean startRowInclusive,
             org.apache.hadoop.io.Text endRow,
             boolean endRowInclusive)
Creates a range from startRow inclusive to endRow inclusive

Parameters:
startRow - set this to null when negative infinity is needed
startRowInclusive - determines if the start row is skipped
endRow - set this to null when positive infinity is needed
endRowInclusive - determines if the endRow is included

Range

public Range(java.lang.CharSequence startRow,
             boolean startRowInclusive,
             java.lang.CharSequence endRow,
             boolean endRowInclusive)
Creates a range from startRow inclusive to endRow inclusive

Parameters:
startRow - set this to null when negative infinity is needed
startRowInclusive - determines if the start row is skipped
endRow - set this to null when positive infinity is needed
endRowInclusive - determines if the endRow is included

Range

public Range(Key startKey,
             boolean startKeyInclusive,
             Key endKey,
             boolean endKeyInclusive)
Parameters:
startKey - set this to null when negative infinity is needed
startKeyInclusive - determines if the ranges includes the start key
endKey - set this to null when infinity is needed
endKeyInclusive - determines if the range includes the end key

Range

public Range(Range range)
Copy constructor


Range

public Range(Key start,
             Key stop,
             boolean startKeyInclusive,
             boolean stopKeyInclusive,
             boolean infiniteStartKey,
             boolean infiniteStopKey)

Range

public Range(TRange trange)
Method Detail

getStartKey

public Key getStartKey()

beforeStartKey

public boolean beforeStartKey(Key key)

getEndKey

public Key getEndKey()

afterEndKey

public boolean afterEndKey(Key key)

hashCode

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

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

equals

public boolean equals(Range otherRange)

compareTo

public int compareTo(Range o)
Specified by:
compareTo in interface java.lang.Comparable<Range>

contains

public boolean contains(Key key)

mergeOverlapping

public static java.util.List<Range> mergeOverlapping(java.util.Collection<Range> ranges)

clip

public Range clip(Range range)

clip

public Range clip(Range range,
                  boolean returnNullIfDisjoint)

bound

public Range bound(Column min,
                   Column max)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

isStartKeyInclusive

public boolean isStartKeyInclusive()

isEndKeyInclusive

public boolean isEndKeyInclusive()

toThrift

public TRange toThrift()

isInfiniteStartKey

public boolean isInfiniteStartKey()

isInfiniteStopKey

public boolean isInfiniteStopKey()


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.