Class Transition

java.lang.Object
it.univr.wordautomata.model.Transition
All Implemented Interfaces:
Serializable, Comparable<Transition>

public class Transition extends Object implements Comparable<Transition>, Serializable
Represents a transition in a WordAutomata. It contains a label that identifies the transition.
See Also:
  • Property Summary

    Properties
    Type
    Property
    Description
    javafx.beans.property.SimpleStringProperty
    Returns the label property of the transition.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a transition with the given label.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compares this transition to another transition based on their labels.
    Returns the label of the transition.
    javafx.beans.property.SimpleStringProperty
    Returns the label property of the transition.
    void
    Sets the label of the transition.
    Returns a string representation of the transition.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Property Details

  • Constructor Details

    • Transition

      public Transition(String label)
      Constructs a transition with the given label.
      Parameters:
      label - the label of the transition
      Throws:
      IllegalArgumentException - if the label is null or blank
  • Method Details

    • labelProperty

      public javafx.beans.property.SimpleStringProperty labelProperty()
      Returns the label property of the transition.
      Returns:
      the label property
      See Also:
    • getLabel

      public String getLabel()
      Returns the label of the transition.
      Returns:
      the label
    • setLabel

      public void setLabel(String label)
      Sets the label of the transition.
      Parameters:
      label - the new label
    • toString

      public String toString()
      Returns a string representation of the transition.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the transition
    • compareTo

      public int compareTo(Transition other)
      Compares this transition to another transition based on their labels.
      Specified by:
      compareTo in interface Comparable<Transition>
      Parameters:
      other - the other transition to compare to
      Returns:
      a negative integer, zero, or a positive integer as this transition is less than, equal to, or greater than the other transition