|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.page.JCUnit.Measure
Measure encapsulates a linear distance with its units of measurement.
Field Summary | |
double |
distance
The magnitude of the distance being represented. |
com.klg.jclass.page.JCUnit |
units
JCUnit object representing the units of linear measurement. |
Constructor Summary | |
JCUnit.Measure()
Creates a new measure using the current default units (magnitude 0). |
|
JCUnit.Measure(double distance)
Creates a new measure given a distance in the default units. |
|
JCUnit.Measure(com.klg.jclass.page.JCUnit units)
Creates a new measure using the given units (magnitude 0). |
|
JCUnit.Measure(com.klg.jclass.page.JCUnit units,
double distance)
Creates a new measure given a distance and its units of measurement. |
Method Summary | |
void |
add(JCUnit.Measure dist)
Adds a given measure to the current measure. |
void |
assign(JCUnit.Measure newValue)
Sets this measure equal to the given one. |
Object |
clone()
Creates a clone of this Measure. |
void |
divide(double factor)
Divides this measure by a given factor. |
boolean |
equals(Object obj)
Tests the equality of an object to this Measure. |
double |
getAs(com.klg.jclass.page.JCUnit new_units)
Gets the represented distance in different units. |
boolean |
greaterThan(JCUnit.Measure measure)
Compares another measure to this one. |
int |
hashCode()
Creates a hash that generates the same value depending on the property values. |
double |
internal()
Gets the distance specified by this measure in internal units. |
boolean |
isNegative()
Determines if this measure is less than zero. |
boolean |
isZero()
Determines if this measure is equal to zero. |
boolean |
lessThan(JCUnit.Measure measure)
Compares another measure to this one. |
void |
multiply(double factor)
Multiplies this measure by a given factor. |
void |
subtract(JCUnit.Measure dist)
Subtracts a given measure from the current measure. |
String |
toString()
Returns the distance and units as a String. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public com.klg.jclass.page.JCUnit units
JCUnit
object representing the units of linear measurement.
public double distance
Constructor Detail |
public JCUnit.Measure()
public JCUnit.Measure(com.klg.jclass.page.JCUnit units)
units
- the units which define the distance representedpublic JCUnit.Measure(double distance)
distance
- a length measured in the current default unitspublic JCUnit.Measure(com.klg.jclass.page.JCUnit units, double distance)
units
- the units in which the length is computeddistance
- a length measured in the given unitsMethod Detail |
public String toString()
toString
in class Object
public Object clone()
clone
in class Object
public double getAs(com.klg.jclass.page.JCUnit new_units)
new_units
- units in which to represent the distance
public double internal()
public void assign(JCUnit.Measure newValue)
newValue
- the value to assign to this measurepublic void add(JCUnit.Measure dist)
dist
- a measure whose distance is to be added to this onepublic void subtract(JCUnit.Measure dist)
dist
- a measure to be subtracted from this onepublic void multiply(double factor)
factor
- the amount by which to multiply this measurepublic void divide(double factor)
factor
- the amount by which to divide this measurepublic int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- an object to compare with this Measure
true
if both objects are Measures and equal in magnitudepublic boolean greaterThan(JCUnit.Measure measure)
measure
- a measure to compare for size with this one
true
if this measure is larger than the given onepublic boolean lessThan(JCUnit.Measure measure)
measure
- a measure to compare for size with this one
true
if this measure is smaller than the given onepublic boolean isZero()
true
if this measure has zero magnitudepublic boolean isNegative()
true
if this measure has negative magnitude
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |