|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@UML(identifier="MD_RepresentativeFraction", specification=ISO_19115) public interface RepresentativeFraction
A scale defined as the inverse of a denominator. This is derived from ISO 19103 Scale
where denominator = 1 / scale.
Implementations are encouraged to extend Number
in a manner equivalent to:
class MyRepresentedFraction extends Number implements RepresentedFraction { ... public double doubleValue() { return 1.0 / (double) denominator; } public float floatValue() { return 1.0f / (float) denominator; } public long longValue() { return 1 / denominator; // Result is zero except for denominator=[0,1]. } ... }
Method Summary | |
---|---|
double |
doubleValue()
Returns the scale value in a form usable for computation. |
boolean |
equals(Object other)
Compares this representative fraction with the specified object for equality. |
long |
getDenominator()
The number below the line in a vulgar fraction. |
int |
hashCode()
Returns a hash value for this representative fraction. |
double |
toScale()
Deprecated. Replaced by doubleValue() , which is both consistent with
Number naming and avoid the idea that a representative
fraction is only for scales - it could be used for any quantity conveniently
represented as a ratio. |
Method Detail |
---|
@Deprecated double toScale()
doubleValue()
, which is both consistent with
Number
naming and avoid the idea that a representative
fraction is only for scales - it could be used for any quantity conveniently
represented as a ratio.
double doubleValue()
@UML(identifier="denominator", obligation=MANDATORY, specification=ISO_19115) long getDenominator()
boolean equals(Object other)
RepresentativeFraction
is a data object - equals
is defined
acoording to getDenominator()
;
Implementations should match the following:
public boolean equals(Object object) { if (object instanceof RepresentativeFraction) { final RepresentativeFraction that = (RepresentativeFraction) object; return getDenominator() == that.getDenominator(); } return false; }
equals
in class Object
other
- The object to compare with.
true
if other
is a RepresentedFraction
with the same
denominator value.int hashCode()
RepresentativeFraction
is a data object - hashcode
is defined
according to getDenominator()
.
Implementations should match the following:
public int hashCode() { return (int) getDenominator(); }
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |