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
ConstructorsConstructorDescriptionLabelStack(String... labels) Creates aLabelStackinitialized with the given labels.LabelStack(Collection<String> labels) Creates aLabelStackinitialized with the given labels. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a label to the bottom of the label stack.voidaddLabelOnTop(String label) Adds a label to the top of the label stack.Deprecated.booleanhasAllLabels(String... labels) Check if all given labels are on the label stack.booleanhasAllLabels(List<String> labels) Check if all given labels are on the label stack.booleanCheck if the given label is on the label stack.booleanremoveLabel(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, toArrayMethods inherited from class java.util.AbstractSequentialList
iteratorMethods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
Constructor Details
-
LabelStack
Creates aLabelStackinitialized with the given labels.- Parameters:
labels- The labels that should be initially added to the createdLabelStack.
-
LabelStack
Creates aLabelStackinitialized 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:
trueif the label was added,falseif 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.AsLabelStackis 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:
trueif the label stack contains the given label,falseif not.
-
hasAllLabels
Check if all given labels are on the label stack.- Parameters:
labels- The labels to test.- Returns:
trueif the label stack contains all given labels,falseif not.- Since:
- 2.3
-
hasAllLabels
Check if all given labels are on the label stack.- Parameters:
labels- The labels to test.- Returns:
trueif the label stack contains all given labels,falseif not.- Since:
- 2.3
-
removeLabel
Removes the given label from the label stack.- Parameters:
label- The label to remove.- Returns:
trueif the label was removed,falseif not.
-
LabelStackis itself a collection, the usage of this method is not needed anymore.