com.grack.prologmachine
Class PredicateSignature
java.lang.Object
|
+--com.grack.prologmachine.PredicateSignature
- public class PredicateSignature
- extends java.lang.Object
Holds a signature for a predicate - it's name and arity.
Constructor Summary |
PredicateSignature(java.lang.String name,
int arity)
Constructs a new predicate signature. |
Method Summary |
boolean |
equals(java.lang.Object o)
Tests to see if two signatures are equal. |
int |
getArity()
Returns the arity portion of the signature. |
java.lang.String |
getName()
Returns the name portion of the signature. |
int |
hashCode()
Returns the hashcode of the signature. |
java.lang.String |
toString()
Converts the PredicateSignature to a String. |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
PredicateSignature
public PredicateSignature(java.lang.String name,
int arity)
- Constructs a new predicate signature.
- Parameters:
name
- The name of the predicate (ie: "animal" for animal/1)name
- The arity of the predicate (ie: 1 for animal/1)
toString
public java.lang.String toString()
- Converts the PredicateSignature to a String.
- Returns:
- The string representation (name/arity).
- Overrides:
- toString in class java.lang.Object
getName
public java.lang.String getName()
- Returns the name portion of the signature.
- Returns:
- The name portion of the signature.
getArity
public int getArity()
- Returns the arity portion of the signature.
- Returns:
- The arity portion of the signature.
hashCode
public int hashCode()
- Returns the hashcode of the signature.
- Returns:
- The hashcode of the signature.
- Overrides:
- hashCode in class java.lang.Object
equals
public boolean equals(java.lang.Object o)
- Tests to see if two signatures are equal.
- Parameters:
o
- The other object.- Returns:
- true if they have the same name and arity.
- Overrides:
- equals in class java.lang.Object