Class LabelStack
java.lang.Object
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<String>
,Collection<String>
,Deque<String>
,List<String>
,Queue<String>
Collection of labels applied to a cell. Used for conditional styling and
behavior.
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionLabelStack
(String... labels) Creates aLabelStack
initialized with the given labels.LabelStack
(Collection<String> labels) Creates aLabelStack
initialized with the given labels. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds a label to the bottom of the label stack.void
addLabelOnTop
(String label) Adds a label to the top of the label stack.Deprecated.boolean
hasAllLabels
(String... labels) Check if all given labels are on the label stack.boolean
hasAllLabels
(List<String> labels) Check if all given labels are on the label stack.boolean
Check if the given label is on the label stack.boolean
removeLabel
(String label) Removes the given label from the label stack.Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
Methods inherited from class java.util.AbstractSequentialList
iterator
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
Constructor Details
-
LabelStack
Creates aLabelStack
initialized with the given labels.- Parameters:
labels
- The labels that should be initially added to the createdLabelStack
.
-
LabelStack
Creates aLabelStack
initialized with the given labels.- Parameters:
labels
- The labels that should be initially added to the createdLabelStack
.- Since:
- 2.0
-
-
Method Details
-
addLabel
Adds a label to the bottom of the label stack.- Parameters:
label
- The label to add.- Returns:
true
if the label was added,false
if adding failed.- Since:
- 2.0
-
addLabelOnTop
Adds a label to the top of the label stack. If the label is already in the label stack it is moved to the top.- Parameters:
label
- The label to add.
-
getLabels
Deprecated.AsLabelStack
is itself a collection, the usage of this method is not needed anymore.- Returns:
- The label stack collection.
-
hasLabel
Check if the given label is on the label stack.- Parameters:
label
- The label to test.- Returns:
true
if the label stack contains the given label,false
if not.
-
hasAllLabels
Check if all given labels are on the label stack.- Parameters:
labels
- The labels to test.- Returns:
true
if the label stack contains all given labels,false
if not.- Since:
- 2.3
-
hasAllLabels
Check if all given labels are on the label stack.- Parameters:
labels
- The labels to test.- Returns:
true
if the label stack contains all given labels,false
if not.- Since:
- 2.3
-
removeLabel
Removes the given label from the label stack.- Parameters:
label
- The label to remove.- Returns:
true
if the label was removed,false
if not.
-
LabelStack
is itself a collection, the usage of this method is not needed anymore.