Interface IComparableProperty
-
- All Superinterfaces:
java.io.Serializable
public interface IComparableProperty extends java.io.SerializableAn interface that allows implementors to let themselves be compared by aComparableNumberinstance that may be modified by the comparing classs.This allows implementation of
Setclasses that guarantee to take every new element by shifting the order of the contained operations with an operation that modifies their comparableNumber.Note that the methods
getComparableProperty()andsetComparableProperty(Number)have to be linked to the same member or source of data (if more advanced) in a way that:Number number = <initalisation>; aComparableProperty.setComparableProperty(number); 1) number.equals(aComparableProperty.getComparableProperty()); 2) aComparableProperty.getComparableProperty().equals(number);
are both true.- Version:
- $Revision: 1.6 $
- Author:
- Achim Westermann
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.NumbergetComparableProperty()Returns aNumberthis instance wants to be compared by.voidsetComparableProperty(java.lang.Number n)Set the comparable Number.
-
-
-
Method Detail
-
getComparableProperty
java.lang.Number getComparableProperty()
Returns aNumberthis instance wants to be compared by.- Returns:
- a
Numberthis instance wants to be compared by.
-
setComparableProperty
void setComparableProperty(java.lang.Number n)
Set the comparable Number.Note that a
ComparablePropertyhas to allow by contract that it'sNumberproperty it lays open to be compared by has to be modifiable from outside!- Parameters:
n- the comparable number.
-
-