|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttip.util.ExpressionEqualitor
public class ExpressionEqualitor
ExpressionEqualitor
define an equality on binary expressions, such
that for instance two different occurences of the binary expression a-b
are regarded the same expression.
The class uses two inner classes ExpressionEquality
, an instance of
the QuestionAnswer
interface, and ExpressionHashcode
, an instance of the Answer
interface, to compute the equals(ABinopExp, ABinopExp)
and
hashCode(ABinopExp)
methods.
Constructor Summary | |
---|---|
ExpressionEqualitor()
|
Method Summary | |
---|---|
boolean |
equals(ABinopExp a,
ABinopExp b)
Returns true if the two expressions are regard as the same binary
expression. |
boolean |
equals(Object o)
Returns true if the object o is an instance
ExpressionEqualitor . |
int |
hashCode()
Returns the hashcode for this class. |
int |
hashCode(ABinopExp a)
Returns a hashcode of the binary expression a consistent with the
equals(ABinopExp, ABinopExp) method. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExpressionEqualitor()
Method Detail |
---|
public boolean equals(ABinopExp a, ABinopExp b)
true
if the two expressions are regard as the same binary
expression.
equals
in interface Equalitor<ABinopExp>
a
- the first binary expressionb
- the second binary expression
true
if the two expressions are regard as the same binary
expressionpublic int hashCode(ABinopExp a)
a
consistent with the
equals(ABinopExp, ABinopExp)
method.
hashCode
in interface Equalitor<ABinopExp>
a
- the binary expression in question
a
according to this equalitorpublic boolean equals(Object o)
true
if the object o
is an instance
ExpressionEqualitor
. This is an approiate equality on this class
as it has no state.
equals
in class Object
o
- the object in question
true
if o
is an instance of this classpublic int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |