Class Span

  • All Implemented Interfaces:
    Serializable

    public final class Span
    extends Object
    implements Serializable
    Represents a range between two RowColumns in a Fluo table. Similar to an Accumulo Range. Span is immutable after it is created.
    Since:
    1.0.0
    See Also:
    Serialized Form
    • 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 RowColumn
        startInclusive - Include start in Range
        end - End RowColumn
        endInclusive - 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 row
        startRowInclusive - Start row inclusive
        endRow - End row
        endRowInclusive - 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 row
        startRowInclusive - Start row inclusive
        endRow - End row
        endRowInclusive - 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • exact

        public static Span exact​(Bytes row)
        Creates a span that covers an exact row
      • 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​(Bytes row,
                                 Column col)
        Creates a Span that covers an exact row and Column. The Column passed to this method can be constructed without a qualifier or visibility to create a Span at the family or qualifier level.
      • exact

        public static Span exact​(CharSequence row,
                                 Column col)
        Creates a Span that covers an exact row and Column. The Column passed to this method can be constructed without a qualifier or visibility to create a Span at the family or qualifier level. String parameters will be encoded as UTF-8
      • 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​(Bytes row,
                                  Column colPrefix)
        Returns a Span that covers all columns beginning with a row and Column prefix. The Column passed to this method can be constructed without a qualifier or visibility to create a prefix Span at the family or qualifier level.
      • prefix

        public static Span prefix​(CharSequence row,
                                  Column colPrefix)
        Returns a Span that covers all columns beginning with a row and Column prefix. The Column passed to this method can be constructed without a qualifier or visibility to create a prefix Span at the family or qualifier level. String parameters will be encoded as UTF-8