Package org.apache.fluo.api.data
Class Span
- java.lang.Object
-
- org.apache.fluo.api.data.Span
-
- All Implemented Interfaces:
Serializable
public final class Span extends Object implements Serializable
Represents a range between twoRowColumn
s in a Fluo table. Similar to an Accumulo Range. Span is immutable after it is created.- Since:
- 1.0.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Span.Builder
static class
Span.EndBuilder
static class
Span.EndCFBuilder
static class
Span.EndCQBuilder
static class
Span.EndCVBuilder
static class
Span.StartBuilder
static class
Span.StartCFBuilder
static class
Span.StartCQBuilder
static class
Span.StartCVBuilder
-
Constructor Summary
Constructors Constructor Description Span()
Constructs a span with infinite start and endSpan(CharSequence startRow, boolean startRowInclusive, CharSequence endRow, boolean endRowInclusive)
Construct a new Span from a start and end row.Span(Bytes startRow, boolean startRowInclusive, Bytes endRow, boolean endRowInclusive)
Construct a new Span from a start and end row.Span(RowColumn start, boolean startInclusive, RowColumn end, boolean endInclusive)
Construct a new span from a start and end RowColumn.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
boolean
equals(Span other)
Checks if span is equal to another spanstatic Span
exact(CharSequence row)
Creates a Span that covers an exact row.static Span
exact(CharSequence row, Column col)
Creates a Span that covers an exact row andColumn
.static Span
exact(Bytes row)
Creates a span that covers an exact rowstatic Span
exact(Bytes row, Column col)
Creates a Span that covers an exact row andColumn
.RowColumn
getEnd()
Return end RowColumn of SpanRowColumn
getStart()
Return start RowColumn of Span.int
hashCode()
boolean
isEndInclusive()
Check if end RowColumn is inclusiveboolean
isStartInclusive()
Checks if start RowColumn is inclusivestatic Span.Builder
newBuilder()
static Span
prefix(CharSequence rowPrefix)
Returns a Span that covers all rows beginning with a prefix String parameters will be encoded as UTF-8static Span
prefix(CharSequence row, Column colPrefix)
Returns a Span that covers all columns beginning with a row andColumn
prefix.static Span
prefix(Bytes rowPrefix)
Returns a Span that covers all rows beginning with a prefix.static Span
prefix(Bytes row, Column colPrefix)
Returns a Span that covers all columns beginning with a row andColumn
prefix.String
toString()
-
-
-
Constructor Detail
-
Span
public Span()
Constructs a span with infinite start and end
-
Span
public Span(RowColumn start, boolean startInclusive, RowColumn end, boolean endInclusive)
Construct a new span from a start and end RowColumn. Set either key to RowColumn.EMPTY to indicate positive or negative infinite- Parameters:
start
- Start RowColumnstartInclusive
- Include start in Rangeend
- End RowColumnendInclusive
- Include end in Range
-
Span
public Span(Bytes startRow, boolean startRowInclusive, Bytes endRow, boolean endRowInclusive)
Construct a new Span from a start and end row. Set either row to Bytes.EMPTY to indicate positive or negative infinite.- Parameters:
startRow
- Start rowstartRowInclusive
- Start row inclusiveendRow
- End rowendRowInclusive
- End row inclusive
-
Span
public Span(CharSequence startRow, boolean startRowInclusive, CharSequence endRow, boolean endRowInclusive)
Construct a new Span from a start and end row. Strings will be encoded as UTF-8.- Parameters:
startRow
- Start rowstartRowInclusive
- Start row inclusiveendRow
- End rowendRowInclusive
- End row inclusive
-
-
Method Detail
-
getStart
public RowColumn getStart()
Return start RowColumn of Span.- Returns:
- start or RowColumn.EMPTY if infinite start
-
getEnd
public RowColumn getEnd()
Return end RowColumn of Span- Returns:
- end or RowColumn.EMPTY if infinite end
-
isStartInclusive
public boolean isStartInclusive()
Checks if start RowColumn is inclusive- Returns:
- True if start key is inclusive
-
isEndInclusive
public boolean isEndInclusive()
Check if end RowColumn is inclusive- Returns:
- True if end key is inclusive
-
equals
public boolean equals(Span other)
Checks if span is equal to another span- Parameters:
other
- Span- Returns:
- true if equal
-
exact
public static Span exact(CharSequence row)
Creates a Span that covers an exact row. String parameters will be encoded as UTF-8
-
exact
public static Span exact(CharSequence row, Column col)
-
prefix
public static Span prefix(Bytes rowPrefix)
Returns a Span that covers all rows beginning with a prefix.
-
prefix
public static Span prefix(CharSequence rowPrefix)
Returns a Span that covers all rows beginning with a prefix String parameters will be encoded as UTF-8
-
prefix
public static Span prefix(CharSequence row, Column colPrefix)
-
newBuilder
public static Span.Builder newBuilder()
-
-