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 WrapperTuple
getBooleanValue, getDoubleValue, getIntValue, getLongValue, getObjectValue, getRowIndexMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:TupleSequenceAdvances to the next entry. No exception is thrown.- Specified by:
nextin interfaceuk.ac.starlink.util.Sequence- Specified by:
nextin interfaceTupleSequence
-
split
- Specified by:
splitin interfaceuk.ac.starlink.util.Splittable<TupleSequence>
-
splittableSize
public long splittableSize()- Specified by:
splittableSizein 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
-