Class LabelStack

    • Constructor Detail

      • LabelStack

        public LabelStack​(String... labels)
        Creates a LabelStack initialized with the given labels.
        Parameters:
        labels - The labels that should be initially added to the created LabelStack.
      • LabelStack

        public LabelStack​(Collection<String> labels)
        Creates a LabelStack initialized with the given labels.
        Parameters:
        labels - The labels that should be initially added to the created LabelStack.
        Since:
        2.0
    • Method Detail

      • addLabel

        public boolean addLabel​(String label)
        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

        public void addLabelOnTop​(String label)
        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
        public List<String> getLabels()
        Deprecated.
        As LabelStack is itself a collection, the usage of this method is not needed anymore.
        Returns:
        The label stack collection.
      • hasLabel

        public boolean hasLabel​(String label)
        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.
      • removeLabel

        public boolean removeLabel​(String label)
        Removes the given label from the label stack.
        Parameters:
        label - The label to remove.
        Returns:
        true if the label was removed, false if not.