|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A binary function is a function that takes two arguments.
| Method Summary | |
Object |
compute(Object arg1,
Object arg2)
Performs a computation on the specified arguments and returns the result of that computation. |
BinaryFunction |
getFirstInverse()
Returns the first inverse of this function. |
BinaryFunction |
getPermuted()
Returns the permuted function of this function. |
boolean |
isAssociative()
Indicates if this function is associative. |
boolean |
isLeftSink(Object obj)
Tests if the specified element is a left sink of this function. |
boolean |
isRightIdentityElement(Object obj)
Tests if the specified element is a right identity element of this function. |
| Method Detail |
public Object compute(Object arg1,
Object arg2)
arg1 - the first argumentarg2 - the second argumentIllegalArgumentException - Some aspect of either argument
prevents it from being computed.ClassCastException - if the class of either argument is
not accepted by this function.NullPointerException - if one of the or both arguments are
null and the computation does not allow
null values.public BinaryFunction getPermuted()
Formally, for all a and b
where compute is defined:
compute(a,b).equals(getPermuted().compute(b,a))If the implementing function is commutative, it is expected that
equals(getPermuted()) returns true.public BinaryFunction getFirstInverse()
Formally, for all a and b
where the implementing function is defined:
compute(a,b).equals(c) ⇔ getFirstInverse().compute(c,a).equals(b)
null if the first inverse function does not exist or is
not defined.public boolean isAssociative()
true if for two objects
a and b:
compute(a,compute(b,c)).equals(compute(compute(a,b),c)
It is not required that this method returns true,
if the method is associative,
so if no statement about associativity can be made,
false is returned.
true if this function is associative.public boolean isRightIdentityElement(Object obj)
e fulfils for every object
a where compute is defined:
a.equals(compute(a, e)).
It is not required that this method returns true,
if the specified object is a right identity element,
so if no statement can be made,
false is returned.
obj - the candidate for a right identity elementtrue if the specified object is a right identity
element of this function.public boolean isLeftSink(Object obj)
sfulfils for every object
a where compute is defined:
s.equals(compute(s, a)).
It is not required that this method returns true,
if the specified object is a left sink,
so if no statement can be made,
false is returned.
obj - the candidate for a left sinktrue if the specified object is a left sink
of this function.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||