|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--NiceNumbers
Find "nice numbers" within an interval. The interval is given by a min and a max value:
NiceNumbers numbers = new NiceNumbers (min, max, n, false); for (Iterator i = numbers.iterator(); i.hasNext(); ) { NiceNumber number = (NiceNumber) i.next(); : }This class is handy for producing quality annotation on graphic displays, for instance along an axis.
Constructor Summary | |
NiceNumbers(double fromValue,
double toValue,
int nNumbersApprox)
Create nice numbers in an unbound interval. |
|
NiceNumbers(double fromValue,
double toValue,
int nNumbersApprox,
boolean isBounded)
Create nice numbers in an interval. |
Method Summary | |
double |
getFirstValue()
Return the first nice number of the interval. |
double |
getLastValue()
Return the last nice number of the interval. |
int |
getNValues()
Return number of nice values in this interval. |
boolean |
hasNext()
Retur true if there are more nice numbers, false otherwise. |
Iterator |
iterator()
Initiate the iteration and return the iterator object |
static void |
main(String[] args)
Testing this class. |
Object |
next()
Return the next nice number of the sequence. |
void |
remove()
From Iterator. |
Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NiceNumbers(double fromValue, double toValue, int nNumbersApprox, boolean isBounded)
fromValue
- From value.toValue
- To value.nNumbersApprox
- Approximate number of major nice numbers to produce.isBounded
- True if fromValue/toValue should be end points
and hence reported as nice numbers.public NiceNumbers(double fromValue, double toValue, int nNumbersApprox)
fromValue
- From value.toValue
- To value.nNumbersApprox
- Approximate number of major nice numbers to produce.Method Detail |
public Iterator iterator()
public boolean hasNext()
hasNext
in interface Iterator
public double getFirstValue()
public double getLastValue()
public int getNValues()
public Object next()
next
in interface Iterator
public void remove()
remove
in interface Iterator
public static void main(String[] args)
args
- Not used.
|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |