Class LabeledLowerCaseValue

java.lang.Object
it.univr.di.labeledvalue.LabeledLowerCaseValue
All Implemented Interfaces:
Serializable

public final class LabeledLowerCaseValue extends Object implements Serializable
Represents an immutable Labeled Lower Case value.
Version:
$Rev: 851 $
Author:
posenato
See Also:
  • Field Details

    • emptyLabeledLowerCaseValue

      public static final LabeledLowerCaseValue emptyLabeledLowerCaseValue
      A constant empty label to represent an empty label that cannot be modified.
  • Method Details

    • create

      public static LabeledLowerCaseValue create(ALabel nodeName, int value, Label label)
      Creates a lower-case value.
      Parameters:
      nodeName - not null node name
      value - not null value
      label - not null label
      Returns:
      a new LabeledLowerCaseValue object
    • create

      public static LabeledLowerCaseValue create(LabeledLowerCaseValue input)
      Copy constructor. The new object is distinct from input.
      No null check is done!
      Parameters:
      input - the object to copy.
      Returns:
      a new LabeledLowerCaseValue object with equals fields of input
    • entryAsString

      public static String entryAsString(ALabel nodeN, int v, Label l, boolean lower)
      Parameters:
      nodeN - a ALabel object.
      v - the new value.
      l - a Label object.
      lower - true if the node name has to be written lower case
      Returns:
      the string representation of this lower-case value: "{(node,value,label)}"
    • parse

      @Nullable public static LabeledLowerCaseValue parse(String arg, ALabelAlphabet alphabet)
      Parses a string representing a labeled lower-case value and returns an object containing the labeled values represented by the string.
      The format of the string is given by the method toString():\{{(⟨label⟩, ⟨Alabel⟩, ⟨value⟩) }*\}
      It also parse the old format: \{{(⟨Alabel⟩, ⟨value⟩, ⟨label⟩) }*\}
      Parameters:
      arg - a String object.
      alphabet - the alphabet to use for building a new labeled lower-case value. If null, a new alphabet is generated and insert into the created labeled value.
      Returns:
      a LabeledLowerCaseValue object if arg represents a valid labeled value, null otherwise.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getLabel

      public Label getLabel()
      Returns:
      the label
    • getNodeName

      public ALabel getNodeName()
      Returns:
      the node name
    • getValue

      public int getValue()
      Returns:
      the value
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isEmpty

      public boolean isEmpty()
      Returns:
      true if the object is empty
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(boolean lower)
      Parameters:
      lower - true if the node name has to be written lower case
      Returns:
      the string representation of this lower-case value