|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.table.join.NdRange
public class NdRange
Describes a range in an N-dimensional space.
Each dimension may have a minimum and maximum; each of these bounds is a
Comparable
object.
Any or all of the bounds may be missing (null); this indicates that no
bounds are in operation in that dimension, so that all values are
effectively inside it.
Constructor Summary | |
---|---|
NdRange(Comparable[] mins,
Comparable[] maxs)
Constructs a range giving its bounds. |
|
NdRange(int ndim)
Constructs a range with no bounds. |
Method Summary | |
---|---|
boolean |
equals(Object o)
|
Comparable[] |
getMaxs()
Returns the array of maximum values. |
Comparable[] |
getMins()
Returns the array of minimum values. |
int |
hashCode()
|
static NdRange |
intersection(NdRange r1,
NdRange r2)
Returns a new range which is the intersection of two given ones. |
boolean |
isBounded()
Indicates whether this range has any restrictions on inclusion at all. |
boolean |
isInside(Object[] coords)
Determines whether a set of coordinates is within this range. |
static Comparable |
max(Comparable c1,
Comparable c2,
boolean failNull)
Returns the greater of two objects, with explicit null handling. |
static Comparable |
min(Comparable c1,
Comparable c2,
boolean failNull)
Returns the lesser of two objects, with explicit null handling. |
String |
toString()
Returns a human-readable description of this range. |
static NdRange |
union(NdRange r1,
NdRange r2)
Returns a new range which is the union of two given ones. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NdRange(Comparable[] mins, Comparable[] maxs)
mins
- minimum boundsmaxs
- maximum boundspublic NdRange(int ndim)
ndim
- dimensionalityMethod Detail |
---|
public boolean isBounded()
isInside(java.lang.Object[])
can ever return falsepublic Comparable[] getMins()
ndim
-element array of minima, some may be nullpublic Comparable[] getMaxs()
ndim
-element array of maxima, some may be nullpublic boolean isInside(Object[] coords)
isBounded()
returns
false.
coords
- point to assess
ClassCastException
- if objects are not mutually comparablepublic boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public static NdRange intersection(NdRange r1, NdRange r2)
r1
- first ranger2
- second range
public static NdRange union(NdRange r1, NdRange r2)
r1
- first ranger2
- second range
public static Comparable min(Comparable c1, Comparable c2, boolean failNull)
c1
- first objectc2
- second objectfailNull
- what happens if c1 or c2 is null; if true null is
returned, if false the non-null value is returned
ClassCastException
- if objects are not mutually comparablepublic static Comparable max(Comparable c1, Comparable c2, boolean failNull)
c1
- first objectc2
- second objectfailNull
- what happens if c1 or c2 is null; if true null is
returned, if false the non-null value is returned
ClassCastException
- if objects are not mutually comparable
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |