|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
E
- the type of elements in the streamS
- the type of the backing storepublic interface Stream<E,S extends ReadOnlySequence<E>>
Provides protocol for a stream consisting of a finite number of past and future sequence values. It maintains a position on its sequence values and allows the position to be altered.
Method Summary | |
---|---|
boolean |
atEnd()
Tells whether this stream is at the end of its values. |
void |
close()
Disassociates this stream from its backing store. |
S |
contents()
Answers a sequence containing the complete contents of this stream. |
boolean |
isEmpty()
Tells whether there are any sequence values in this stream. |
int |
position()
Answers the current position of this stream. |
void |
position(int amount)
Sets the current position in this stream. |
void |
reset()
Sets the position of this stream to be at the beginning of the stream of values. |
void |
setToEnd()
Sets the position of this stream to be at the end of the stream of values. |
Method Detail |
---|
boolean atEnd()
true
if this stream has no future sequence values available for
reading; false
otherwise.
IllegalStateException
- if this stream has been previously
closedvoid close()
S contents()
size
of the collection is the sum of
the sizes of the past and future sequence values.
IllegalStateException
- if this stream has been previously
closedboolean isEmpty()
true
if there are any sequence values in this stream
IllegalStateException
- if this stream has been previously
closedint position()
IllegalStateException
- if this stream has been previously
closedvoid position(int amount)
amount
,
move objects in sequence from the front of the future sequence values to the back
of the past sequence values until the number of past sequence values is equal to
amount
.
If the number of past sequence values is greater than amount
,
move objects in sequence from the back of the past sequence values to the front
of the future sequence values until the number past sequence values is equal to
amount
.
If the number of past sequence values is equal to amount
, no action is
taken.
amount
- the new position
IndexOutOfBoundsException
- if amount
is negative, or if this
stream is not empty
and amount >=
the total number of
sequence values in this stream
IllegalStateException
- if this stream has been previously
closedvoid reset()
IllegalStateException
- if this stream has been previously
closedvoid setToEnd()
IllegalStateException
- if this stream has been previously
closed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |