de.uni_tuebingen.sfb.lichtenstein.formulas
Class Predicate

java.lang.Object
  extended by de.uni_tuebingen.sfb.lichtenstein.formulas.Variable
      extended by de.uni_tuebingen.sfb.lichtenstein.formulas.SetDenotator
          extended by de.uni_tuebingen.sfb.lichtenstein.formulas.Predicate
All Implemented Interfaces:
Serializable

public final class Predicate
extends SetDenotator

A class representing a predicate. It registers a label with which it corresponds in the model structure.

Author:
Hendrik Maryns
See Also:
Serialized Form

Field Summary
 
Fields inherited from class de.uni_tuebingen.sfb.lichtenstein.formulas.Variable
name
 
Constructor Summary
Predicate(String label)
          Initialize a new predicate, with a given label.
 
Method Summary
 boolean equals(Object other)
          Indicates whether some other object is “equal to” this one.
static Predicate getInstance(String name)
          Factory method to get a predicate.
 String getLabel()
          Get the label of this predicate.
 int hashCode()
          Returns a hash code value for the object.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class de.uni_tuebingen.sfb.lichtenstein.formulas.SetDenotator
contains, logicalEquals, subset, superset
 
Methods inherited from class de.uni_tuebingen.sfb.lichtenstein.formulas.Variable
getName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Predicate

public Predicate(String label)
Initialize a new predicate, with a given label.

Parameters:
label - The label of the predicate.
Postcondition:
The label is set to the given label. | new.getLabel() == label
Method Detail

getInstance

public static Predicate getInstance(String name)
                             throws NullPointerException
Factory method to get a predicate. If a predicate with the given name already exists, it is returned.

Parameters:
name - The name of the predicate.
Returns:
The unique predicate with the given name. | if ( name != null ) | then result.getName() == name
Throws:
NullPointerException - [CAN] If the name is null.

getLabel

public String getLabel()
Get the label of this predicate.

Returns:
The label is the same as the name.

equals

public boolean equals(Object other)
Indicates whether some other object is “equal to” this one.

Overrides:
equals in class Object
Returns:
Two predicates are equal if they have the same label. | let otherPredicate = (Predicate) other in | result == otherPredicate.getLabel().equals(getLabel())

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class Object
Returns:
The hash code is based on the hash code of the label. | result == getLabel().hashCode()

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Variable
Returns:
The label. | result == getLabel()


© Copyright 2008 Hendrik Maryns   Creative Commons License