Interface Sequence<Value_,Difference_ extends Comparable<Difference_>>
- Type Parameters:
Value_- The type of value in the sequenceDifference_- The type of difference between values in the sequence
public interface Sequence<Value_,Difference_ extends Comparable<Difference_>>
A Sequence is a series of consecutive values. For instance,
the list [1,2,4,5,6,10] has three sequences: [1,2], [4,5,6], and [10].
-
Method Details
-
getFirstItem
Value_ getFirstItem()- Returns:
- never null, the first item in the sequence
-
getLastItem
Value_ getLastItem()- Returns:
- never null, the last item in the sequence
-
isFirst
boolean isFirst()- Returns:
- true if and only if this is the first Sequence
-
isLast
boolean isLast()- Returns:
- true if and only if this is the last Sequence
-
getPreviousBreak
Break<Value_,Difference_> getPreviousBreak()- Returns:
- If this is not the first sequence, the break before it. Otherwise, null.
-
getNextBreak
Break<Value_,Difference_> getNextBreak()- Returns:
- If this is not the last sequence, the break after it. Otherwise, null.
-
getItems
- Returns:
- never null, an iterable that can iterate through this sequence
-
getCount
int getCount()- Returns:
- the number of items in this sequence
-
getLength
Difference_ getLength()- Returns:
- never null, the difference between the last item and first item in this sequence
-