|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.leeds.ccg.andyt.gws.utilities.Utilities
public class Utilities
TODO: docs
Constructor Summary | |
---|---|
Utilities()
Creates a new instance of Utilities |
Method Summary | |
---|---|
static java.util.HashSet |
getInDistancePointIDs(java.util.HashSet pointIDs,
java.awt.geom.Point2D.Double[] points,
java.awt.geom.Point2D.Double point,
double distance)
Returns as a HashSet the IDs of points that are in distance of point. |
static java.util.HashSet |
getInDistancePointIDs(java.util.HashSet pointIDs,
Point2DBigDecimal[] points,
Point2DBigDecimal point,
double distance,
int decimalPlaces)
Returns as a HashSet the IDs of points that are in distance of point. |
static java.util.HashSet |
getInDistancePointIDs(java.awt.geom.Point2D.Double[] points,
java.awt.geom.Point2D.Double point,
double distance)
Returns the IDs of points that are in distance of point as a HashSet. |
static java.util.HashSet |
getInDistancePointIDs(Point2DBigDecimal[] points,
Point2DBigDecimal point,
java.math.BigDecimal distance,
int decimalPlaces)
Returns the IDs of points that are in distance of point as a HashSet. |
static java.util.HashSet |
getPointsIntersected(java.util.HashSet pointIDs,
java.awt.geom.Point2D.Double[] points,
java.math.BigDecimal[] dimensions)
Returns as a HashSet the IDs of points that intersect dimensions. |
static java.util.HashSet |
getPointsIntersected(java.util.HashSet pointIDs,
Point2DBigDecimal[] points,
java.math.BigDecimal[] dimensions)
Returns as a HashSet the IDs of points that intersect dimensions. |
static java.util.HashSet |
getPointsIntersected(java.awt.geom.Point2D.Double[] points,
java.math.BigDecimal[] dimensions)
Returns as a HashSet the IDs of points that intersect dimensions. |
static java.util.HashSet |
getPointsIntersected(Point2DBigDecimal[] points,
java.math.BigDecimal[] dimensions)
Returns as a HashSet the IDs of points that intersect dimensions. |
static boolean |
isPointContained(Point2DBigDecimal point,
java.math.BigDecimal[] dimensions)
Returns true iff point is contained in dimensions as in: point.x > xmin, point.y > ymin, point.x < xmax, point.y < ymax |
static boolean |
isPointIn(Point2DBigDecimal point,
java.math.BigDecimal[] dimensions)
Returns true iff point is contained in dimensions as in: point.x >= xmin, point.y >= ymin, point.x < xmax, point.y < ymax |
static boolean |
isPointIntersected(java.awt.geom.Point2D.Double point,
java.math.BigDecimal[] dimensions)
Returns true iff point is contained in dimensions as in: point.x >= xmin, point.y >= ymin, point.x <= xmax, point.y <= ymax |
static boolean |
isPointIntersected(Point2DBigDecimal point,
java.math.BigDecimal[] dimensions)
Returns true iff point is contained in dimensions as in: point.x >= xmin, point.y >= ymin, point.x <= xmax, point.y <= ymax |
static java.awt.geom.Point2D.Double[] |
loadData(java.io.File inputFile)
Returns a Point2D.Double[] of points loaded from inputFile. |
static java.awt.geom.Point2D.Double[] |
loadData(java.io.File inputFile,
java.math.BigDecimal[] dimensions)
Returns a Point2D.Double[] of points loaded from inputFile that are in bounds given by dimensions. |
static java.awt.geom.Point2D.Double[] |
loadData(java.io.File inputFile,
double xmin,
double ymin,
double xmax,
double ymax)
Returns a Point2D.Double[] of points loaded from inputFile that are in bounds given by xmin, ymin, xmax, ymax |
static java.awt.geom.Point2D.Double[] |
loadData(java.awt.geom.Point2D.Double[] pointsToAddTo,
java.io.File inputFile)
Returns a Point2D.Double[] of points loaded from inputFile |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utilities()
Method Detail |
---|
public static java.awt.geom.Point2D.Double[] loadData(java.io.File inputFile)
inputFile
- public static java.awt.geom.Point2D.Double[] loadData(java.awt.geom.Point2D.Double[] pointsToAddTo, java.io.File inputFile)
public static java.awt.geom.Point2D.Double[] loadData(java.io.File inputFile, double xmin, double ymin, double xmax, double ymax)
public static java.awt.geom.Point2D.Double[] loadData(java.io.File inputFile, java.math.BigDecimal[] dimensions)
inputFile
- dimensions
- TODO:
This can be improved by reading data into BigDecimal Point2DBigDecimal[]
and using BigDecimal.compareTo();public static java.util.HashSet getInDistancePointIDs(java.awt.geom.Point2D.Double[] points, java.awt.geom.Point2D.Double point, double distance)
public static java.util.HashSet getInDistancePointIDs(Point2DBigDecimal[] points, Point2DBigDecimal point, java.math.BigDecimal distance, int decimalPlaces)
public static java.util.HashSet getInDistancePointIDs(java.util.HashSet pointIDs, java.awt.geom.Point2D.Double[] points, java.awt.geom.Point2D.Double point, double distance)
public static java.util.HashSet getInDistancePointIDs(java.util.HashSet pointIDs, Point2DBigDecimal[] points, Point2DBigDecimal point, double distance, int decimalPlaces)
public static java.util.HashSet getPointsIntersected(Point2DBigDecimal[] points, java.math.BigDecimal[] dimensions)
points
- dimensions
- The dimensions used:
dimensions[ 0 ] is reserved. This is because it stores cellsize in
Grid2DSquareCellAbstract.dimensions.
(N.B. developer: It might be worth using it here as a
parameter to extend the box tested for point intersection.)
dimensions[ 1 ] = xmin ( left-most coordinate of box ).
dimensions[ 2 ] = ymin ( bottom-most coordinate of box ).
dimensions[ 3 ] = xmax ( right-most coordinate of box ).
dimensions[ 4 ] = ymax ( top-most coordinate of box ).public static java.util.HashSet getPointsIntersected(java.awt.geom.Point2D.Double[] points, java.math.BigDecimal[] dimensions)
points
- dimensions
- The dimensions used:
dimensions[ 0 ] is reserved. This is because it stores cellsize in
Grid2DSquareCellAbstract.dimensions.
(N.B. developer: It might be worth using it here as a
parameter to extend the box tested for point intersection.)
dimensions[ 1 ] = xmin ( left-most coordinate of box ).
dimensions[ 2 ] = ymin ( bottom-most coordinate of box ).
dimensions[ 3 ] = xmax ( right-most coordinate of box ).
dimensions[ 4 ] = ymax ( top-most coordinate of box ).public static java.util.HashSet getPointsIntersected(java.util.HashSet pointIDs, java.awt.geom.Point2D.Double[] points, java.math.BigDecimal[] dimensions)
pointIDs
- points
- dimensions
- The dimensions used:
dimensions[ 0 ] is reserved. This is because it stores cellsize in
Grid2DSquareCellAbstract.dimensions.
(N.B. developer: It might be worth using it here as a
parameter to extend the box tested for point intersection.)
dimensions[ 1 ] = xmin ( left-most coordinate of box ).
dimensions[ 2 ] = ymin ( bottom-most coordinate of box ).
dimensions[ 3 ] = xmax ( right-most coordinate of box ).
dimensions[ 4 ] = ymax ( top-most coordinate of box ).public static java.util.HashSet getPointsIntersected(java.util.HashSet pointIDs, Point2DBigDecimal[] points, java.math.BigDecimal[] dimensions)
pointIDs
- points
- dimensions
- The dimensions used:
dimensions[ 0 ] is reserved. This is because it stores cellsize in
Grid2DSquareCellAbstract.dimensions.
(N.B. developer: It might be worth using it here as a
parameter to extend the box tested for point intersection.)
dimensions[ 1 ] = xmin ( left-most coordinate of box ).
dimensions[ 2 ] = ymin ( bottom-most coordinate of box ).
dimensions[ 3 ] = xmax ( right-most coordinate of box ).
dimensions[ 4 ] = ymax ( top-most coordinate of box ).public static boolean isPointContained(Point2DBigDecimal point, java.math.BigDecimal[] dimensions)
point
- the Point2DBigDecimal to be tested for intersectiondimensions
- The dimensions tested:
dimensions[ 0 ] is reserved. This is because it stores cellsize in
Grid2DSquareCellAbstract.dimensions.
(N.B. developer: It might be worth using it here as a
parameter to extend the box tested for point intersection.)
dimensions[ 1 ] = xmin ( left-most coordinate of box ).
dimensions[ 2 ] = ymin ( bottom-most coordinate of box ).
dimensions[ 3 ] = xmax ( right-most coordinate of box ).
dimensions[ 4 ] = ymax ( top-most coordinate of box ).public static boolean isPointIntersected(Point2DBigDecimal point, java.math.BigDecimal[] dimensions)
point
- the Point2DBigDecimal to be tested for intersectiondimensions
- The dimensions tested:
dimensions[ 0 ] is reserved. This is because it stores cellsize in
Grid2DSquareCellAbstract.dimensions.
(N.B. developer: It might be worth using it here as a
parameter to extend the box tested for point intersection.)
dimensions[ 1 ] = xmin ( left-most coordinate of box ).
dimensions[ 2 ] = ymin ( bottom-most coordinate of box ).
dimensions[ 3 ] = xmax ( right-most coordinate of box ).
dimensions[ 4 ] = ymax ( top-most coordinate of box ).public static boolean isPointIntersected(java.awt.geom.Point2D.Double point, java.math.BigDecimal[] dimensions)
point
- the Point2DBigDecimal to be tested for intersectiondimensions
- The dimensions tested:
dimensions[ 0 ] is reserved. This is because it stores cellsize in
Grid2DSquareCellAbstract.dimensions.
(N.B. developer: It might be worth using it here as a
parameter to extend the box tested for point intersection.)
dimensions[ 1 ] = xmin ( left-most coordinate of box ).
dimensions[ 2 ] = ymin ( bottom-most coordinate of box ).
dimensions[ 3 ] = xmax ( right-most coordinate of box ).
dimensions[ 4 ] = ymax ( top-most coordinate of box ).public static boolean isPointIn(Point2DBigDecimal point, java.math.BigDecimal[] dimensions)
point
- the Point2DBigDecimal to be tested for intersectiondimensions
- The dimensions tested:
dimensions[ 0 ] is reserved. This is because it stores cellsize in
Grid2DSquareCellAbstract.dimensions.
(N.B. developer: It might be worth using it here as a
parameter to extend the box tested for point intersection.)
dimensions[ 1 ] = xmin ( left-most coordinate of box ).
dimensions[ 2 ] = ymin ( bottom-most coordinate of box ).
dimensions[ 3 ] = xmax ( right-most coordinate of box ).
dimensions[ 4 ] = ymax ( top-most coordinate of box ).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |