textbender.g.hold
Class Spool1
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList<Hold>
Spool1
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<Hold>, Collection<Hold>, Deque<Hold>, List<Hold>, Queue<Hold>, Spool
- Direct Known Subclasses:
- SpoolEDT
public class Spool1
- extends LinkedList<Hold>
- implements Spool
Basic implementation of a spool.
- See Also:
- Serialized Form
Methods inherited from class java.util.LinkedList |
add, addAll, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray |
Methods inherited from interface java.util.Collection |
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Spool1
public Spool1()
add
public boolean add(Hold hold)
- Description copied from interface:
Spool
- Adds the hold to the spool, or releases it immediately.
If the spool is unwinding the hold is released immediately; otherwise it is added.
- Specified by:
add
in interface Collection<Hold>
- Specified by:
add
in interface Deque<Hold>
- Specified by:
add
in interface List<Hold>
- Specified by:
add
in interface Queue<Hold>
- Specified by:
add
in interface Spool
- Overrides:
add
in class LinkedList<Hold>
- Returns:
- true if the hold is added; false if it is released instead
addAll
public boolean addAll(int index,
Collection<? extends Hold> c)
- Specified by:
addAll
in interface List<Hold>
- Overrides:
addAll
in class LinkedList<Hold>
addFirst
public void addFirst(Hold hold)
- Specified by:
addFirst
in interface Deque<Hold>
- Overrides:
addFirst
in class LinkedList<Hold>
addLast
public void addLast(Hold hold)
- Specified by:
addLast
in interface Deque<Hold>
- Overrides:
addLast
in class LinkedList<Hold>
offer
public boolean offer(Hold hold)
- Specified by:
offer
in interface Deque<Hold>
- Specified by:
offer
in interface Queue<Hold>
- Overrides:
offer
in class LinkedList<Hold>
isUnwinding
public boolean isUnwinding()
- Description copied from interface:
Spool
- Returns true if the spool is unwinding (or unwound).
Once true, it never reverts to false.
- Specified by:
isUnwinding
in interface Spool
unwind
public boolean unwind()
- Description copied from interface:
Spool
- Commences to unwind this spool.
Equivalent to unwind(catcher0).
- Specified by:
unwind
in interface Spool
- Returns:
- true if unwinding commences with this call;
false if it had already commenced
unwind
public boolean unwind(Catcher<Hold> catcher)
- Description copied from interface:
Spool
- Commences to unwind this spool, removing and releasing each of its holds.
Works in LIFO order. Once unwinding is commenced,
subsequent calls to this method have no effect.
- Specified by:
unwind
in interface Spool
- Parameters:
catcher
- for any errors or exceptions that occur
during unwinding
- Returns:
- true if unwinding commences with this call;
false if it had already commenced