Package uk.ac.starlink.ttools.plot2.data
Class AbortTupleSequence
java.lang.Object
uk.ac.starlink.ttools.plot2.data.WrapperTuple
uk.ac.starlink.ttools.plot2.data.AbortTupleSequence
- All Implemented Interfaces:
Tuple
,TupleSequence
,uk.ac.starlink.util.Sequence
,uk.ac.starlink.util.Splittable<TupleSequence>
Wrapping TupleSequence that tries to give up when a condition
becomes true.
- Since:
- 12 Aug 2019
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionAbortTupleSequence
(TupleSequence base, BooleanSupplier abortCondition) Constructor with checking period of 1 (every element).AbortTupleSequence
(TupleSequence base, BooleanSupplier abortCondition, int checkPeriod) Constructor with specified checking period. -
Method Summary
Methods inherited from class uk.ac.starlink.ttools.plot2.data.WrapperTuple
getBooleanValue, getDoubleValue, getIntValue, getLongValue, getObjectValue, getRowIndex
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface uk.ac.starlink.ttools.plot2.data.Tuple
getBooleanValue, getDoubleValue, getIntValue, getLongValue, getObjectValue, getRowIndex
-
Constructor Details
-
AbortTupleSequence
Constructor with checking period of 1 (every element).- Parameters:
base
- base sequenceabortCondition
- condition on which the stream should stop
-
AbortTupleSequence
Constructor with specified checking period.- Parameters:
base
- base sequenceabortCondition
- condition on which the stream should stopcheckPeriod
- approximate frequency of checking the condition
-
-
Method Details
-
next
public boolean next()Description copied from interface:TupleSequence
Advances to the next entry. No exception is thrown.- Specified by:
next
in interfaceuk.ac.starlink.util.Sequence
- Specified by:
next
in interfaceTupleSequence
-
split
- Specified by:
split
in interfaceuk.ac.starlink.util.Splittable<TupleSequence>
-
splittableSize
public long splittableSize()- Specified by:
splittableSize
in interfaceuk.ac.starlink.util.Splittable<TupleSequence>
-
isAborted
public boolean isAborted()Indicates whether the abort condition has been detected.- Returns:
- true iff the abort condition has been detected
-