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

    • compareTo

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

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

      public ALabel conjunction(ALabel label)
      Description copied from class: ALabel
      Conjoins ALabel 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'. Returns null if this cannot be combined with the given label.
    • contains

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

      public boolean contains(ALabelAlphabet.ALetter letter)
      Overrides:
      contains in class ALabel
      Parameters:
      letter - the proposition to check.
      Returns:
      true if this contains the proposition in any state: straight, negated, or unknown.
    • 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
    • isEmpty

      public boolean isEmpty()
      Overrides:
      isEmpty in class ALabel
      Returns:
      true if the label contains no literal.
    • 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 the ALetter 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 ALetters in inputSet from the current label.
      Overrides:
      remove in class ALabel
      Parameters:
      letter - ALetter to remove.
    • 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