Module org.opengis.geoapi
Interface RepresentativeFraction
@Classifier(DATATYPE)
@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 MyFraction extends Number implements RepresentativeFraction {
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].
}
}
- Since:
- 2.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the scale value in a form usable for computation.boolean
Compares this representative fraction with the specified object for equality.long
The number below the line in a vulgar fraction.int
hashCode()
Returns a hash value for this representative fraction.
-
Method Details
-
doubleValue
double doubleValue()Returns the scale value in a form usable for computation.- Returns:
1.0 / (double) getDenominator()
-
getDenominator
The number below the line in a vulgar fraction.- Returns:
- the denominator.
-
equals
Compares this representative fraction with the specified object for equality. 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; }
- Overrides:
equals
in classObject
- Parameters:
other
- the object to compare with.- Returns:
true
ifother
is aRepresentedFraction
with the same denominator value.
-
hashCode
-