|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.iu.cnets.klatsch.stream.Stream
edu.iu.cnets.klatsch.stream.SLimit
public class SLimit
This type of stream applies an element limit to an existing stream. This can be accomplished through other means, but it's still convenient.
Field Summary | |
---|---|
(package private) int |
left
the number of elements we have left to produce |
(package private) Stream |
s
the stream we've encapsulated |
Fields inherited from class edu.iu.cnets.klatsch.stream.Stream |
---|
buffer |
Constructor Summary | |
---|---|
SLimit(Stream s,
int left)
Builds a new element-limited stream from the given one. |
Method Summary | |
---|---|
boolean |
done()
Sees whether we're at the end of the stream. |
Value |
getNext()
Gets the next value in the list, if possible. |
java.lang.String |
toString()
Provides an indication of internal state. |
Methods inherited from class edu.iu.cnets.klatsch.stream.Stream |
---|
current, get |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
Stream s
int left
Constructor Detail |
---|
public SLimit(Stream s, int left)
s
- the stream to wrapleft
- how many elements to permitMethod Detail |
---|
public Value getNext() throws EvaluationException
getNext
in class Stream
EvaluationException
public boolean done()
done
in class Stream
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |