public abstract class Shape extends Object implements Cloneable, Comparable<Shape>, Externalizable
WARNING: this API is experimental and will likely change in the near future.
Constructor and Description |
---|
Shape() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addArguments(StringBuilder buffer) |
Shape |
clone() |
int |
compareTo(Shape other)
Shape comparison compares bounding box area.
|
abstract boolean |
contains(double x,
double y)
Return true if this shape contains the point defined by (
x , y ). |
boolean |
contains(Point point)
Return true if this shape contains
point . |
abstract boolean |
fastIntersects(Rectangle box)
Check if this shape's bounding box intersects with
box . |
abstract Rectangle |
getBoundingBox()
Get the rectangle that represents the bounding box that fully contains this shape.
|
abstract double |
getHeight()
Get the height of this shape's bounding box.
|
abstract String |
getTypeName() |
abstract double |
getWidth()
Get the width of this shape's bounding box.
|
int |
hashCode() |
abstract boolean |
intersects(Rectangle box,
Shape other)
Check if this shape intersects with
other . |
boolean |
intersects(Shape other)
Check if this shape intersects with
other . |
abstract Shape |
readExternal(DataInput in) |
void |
readExternal(ObjectInput in) |
String |
toString() |
void |
toString(StringBuilder buffer)
Write the string representation of this shape to
buffer . |
protected static void |
toString(StringBuilder buffer,
double x,
double y)
Write the string representation of a point to
buffer . |
static Shape |
valueOf(Object value) |
abstract void |
writeExternal(DataOutput out) |
void |
writeExternal(ObjectOutput out) |
public final boolean contains(Point point)
point
.public abstract double getWidth()
public abstract double getHeight()
public abstract boolean contains(double x, double y)
x
, y
).public final boolean intersects(Shape other)
other
.
This method will just call intersects(Rectangle, Shape)
.
public abstract boolean intersects(Rectangle box, Shape other)
other
.box
- The bounding box of this shape from getBoundingBox()
.other
- The shape to check for intersection withpublic abstract boolean fastIntersects(Rectangle box)
box
.public abstract Rectangle getBoundingBox()
public final void toString(StringBuilder buffer)
buffer
.public abstract void addArguments(StringBuilder buffer)
protected static void toString(StringBuilder buffer, double x, double y)
buffer
.public abstract String getTypeName()
public final int compareTo(Shape other)
compareTo
in interface Comparable<Shape>
public final void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
public final void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public abstract Shape readExternal(DataInput in) throws IOException
IOException
public abstract void writeExternal(DataOutput out) throws IOException
IOException
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.