xxl.spatial
Class Rectangle
java.lang.Object
|
+--xxl.spatial.Rectangle
- public class Rectangle
- extends java.lang.Object
- implements Tree.Descriptor, Convertable
| Methods inherited from class java.lang.Object |
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
leftBorders
protected double[] leftBorders
rightBorders
protected double[] rightBorders
Rectangle
public Rectangle(double[] leftBorders,
double[] rightBorders)
Rectangle
public Rectangle(Rectangle interval)
Rectangle
public Rectangle(Tree.Descriptor rectangle)
Rectangle
public Rectangle(int dim)
clone
public java.lang.Object clone()
- Specified by:
- clone in interface Tree.Descriptor
- Overrides:
- clone in class java.lang.Object
read
public void read(java.io.DataInput dataInput)
throws java.io.IOException
- Specified by:
- read in interface Convertable
readSingletonRectangle
public static Rectangle readSingletonRectangle(java.io.File file,
int dim)
writeSingletonRectangle
public static void writeSingletonRectangle(java.io.File file,
Rectangle interval)
write
public int write(java.io.DataOutput dataOutput)
throws java.io.IOException
- Specified by:
- write in interface Convertable
sizeOf
public int sizeOf()
- Specified by:
- sizeOf in interface Convertable
dimensions
public int dimensions()
borders
public double[] borders(boolean right)
deltas
public double[] deltas()
area
public double area()
margin
public double margin()
contains
public boolean contains(double[] point)
contains
public boolean contains(Rectangle interval)
contains
public boolean contains(Tree.Descriptor descriptor)
- Specified by:
- contains in interface Tree.Descriptor
equals
public boolean equals(java.lang.Object object)
- Specified by:
- equals in interface Tree.Descriptor
- Overrides:
- equals in class java.lang.Object
overlaps
public boolean overlaps(Rectangle interval)
overlaps
public boolean overlaps(Tree.Descriptor descriptor)
- Specified by:
- overlaps in interface Tree.Descriptor
overlap
public double overlap(Rectangle interval)
minDistance
public double minDistance(double[] point,
int p)
- Computes the distance between the given point and the nearest point of this rectangle using the Lp-Metrics.
maxDistance
public double maxDistance(double[] point,
int p)
- Computes the distance between the given point and the most distant point of this rectangle using the Lp-Metrics.
distance
public double distance(Rectangle interval,
int p)
- Computes the shortest distance between this rectangle and the given interval using the Lp-Metrics.
union
public Rectangle union(Rectangle interval)
union
public Tree.Descriptor union(Tree.Descriptor descriptor)
- Specified by:
- union in interface Tree.Descriptor
intersect
public void intersect(Rectangle interval)
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object