Class ALabel.EmptyLabel

java.lang.Object
it.univr.di.labeledvalue.ALabel
it.univr.di.labeledvalue.ALabel.EmptyLabel
All Implemented Interfaces:
Serializable, Comparable<ALabel>, Iterable<ALabelAlphabet.ALetter>
Enclosing class:
ALabel

public static final class ALabel.EmptyLabel extends ALabel
An unmodifiable empty label.
Author:
posenato
See Also:
  • Constructor Details

    • EmptyLabel

      public EmptyLabel()
      default constructor
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Overrides:
      isEmpty in class ALabel
      Returns:
      true if the label contains no literal.
    • conjoin

      public boolean conjoin(ALabelAlphabet.ALetter aLetter)
      Description copied from class: ALabel
      Conjoins a-letter to this.
      Overrides:
      conjoin in class ALabel
      Parameters:
      aLetter - the a-letter to conjoin.
      Returns:
      true if a-letter is added, false otherwise.
    • compareTo

      public int compareTo(ALabel l)
      Description copied from class: ALabel
      In order to speed up this method and considering that the ALabelAlphabet order may be not the expected alphabetic one, (first letter in an ALabelAlphabet can be 'nodeZ' and the last one 'aNode'), the order of labels is given w.r.t. their indexes in their ALabelAlphabet.
      Specified by:
      compareTo in interface Comparable<ALabel>
      Overrides:
      compareTo in class ALabel
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class ALabel
      Parameters:
      o - the input object
      Returns:
      true if o is an empty label, false otherwise
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ALabel
      Returns:
      0 as hascode
    • conjunction

      public ALabel conjunction(ALabel label)
      Description copied from class: ALabel
      Conjoins a-label to this and returns the result without modifying this.
      Overrides:
      conjunction in class ALabel
      Parameters:
      label - the label to conjoin
      Returns:
      a new label with the conjunction of 'this' and 'label'. Regurns null if this cannot conjuncted with label.
    • contains

      public boolean contains(ALabel label)
      Description copied from class: ALabel
      L1 contains L2 if L1 contains all a-letters of L2.
      Overrides:
      contains in class ALabel
      Parameters:
      label - the label to check
      Returns:
      true if this contains label.
    • contains

      public boolean contains(ALabelAlphabet.ALetter letter)
      Overrides:
      contains in class ALabel
      Parameters:
      letter - the proposition to check.
      Returns:
      true if this contains proposition in any state: straight, negated or unknown.
    • size

      public int size()
      Overrides:
      size in class ALabel
      Returns:
      Return the number of literals of the label
    • toString

      public String toString()
      Overrides:
      toString in class ALabel
    • iterator

      @Nonnull public Iterator<ALabelAlphabet.ALetter> iterator()
      Specified by:
      iterator in interface Iterable<ALabelAlphabet.ALetter>
      Overrides:
      iterator in class ALabel
    • remove

      public void remove(ALabelAlphabet.ALetter letter)
      Description copied from class: ALabel
      It removes a-letter if it is present, otherwise it does nothing.
      Overrides:
      remove in class ALabel
      Parameters:
      letter - the letter to remove.
    • remove

      public void remove(ALabelAlphabet.ALetter[] letter)
      Description copied from class: ALabel
      It removes all a-letters in inputSet from the current label.
      Overrides:
      remove in class ALabel
      Parameters:
      letter - a-letters to remove.