Package com.attivio.sdk.geo
Class Shape
- java.lang.Object
-
- com.attivio.sdk.geo.Shape
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<Shape>
- Direct Known Subclasses:
AbstractEllipse
,AbstractPolygon
public abstract class Shape extends java.lang.Object implements java.lang.Cloneable, java.lang.Comparable<Shape>, java.io.Externalizable
Represents an abstract shape.WARNING: this API is experimental and will likely change in the near future.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Shape()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
addArguments(java.lang.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 containspoint
.abstract boolean
fastIntersects(Rectangle box)
Check if this shape's bounding box intersects withbox
.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 java.lang.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 withother
.boolean
intersects(Shape other)
Check if this shape intersects withother
.abstract Shape
readExternal(java.io.DataInput in)
void
readExternal(java.io.ObjectInput in)
GWT Incompatible - hence no @Override annotation.java.lang.String
toString()
void
toString(java.lang.StringBuilder buffer)
Write the string representation of this shape tobuffer
.protected static void
toString(java.lang.StringBuilder buffer, double x, double y)
Write the string representation of a point tobuffer
.static Shape
valueOf(java.lang.Object value)
abstract void
writeExternal(java.io.DataOutput out)
void
writeExternal(java.io.ObjectOutput out)
GWT Incompatible - hence no @Override annotation.
-
-
-
Method Detail
-
contains
public final boolean contains(Point point)
Return true if this shape containspoint
.
-
getWidth
public abstract double getWidth()
Get the width of this shape's bounding box.
-
getHeight
public abstract double getHeight()
Get the height of this shape's bounding box.
-
contains
public abstract boolean contains(double x, double y)
Return true if this shape contains the point defined by (x
,y
).
-
intersects
public final boolean intersects(Shape other)
Check if this shape intersects withother
.This method will just call
intersects(Rectangle, Shape)
.
-
intersects
public abstract boolean intersects(Rectangle box, Shape other)
Check if this shape intersects withother
.- Parameters:
box
- The bounding box of this shape fromgetBoundingBox()
.other
- The shape to check for intersection with
-
fastIntersects
public abstract boolean fastIntersects(Rectangle box)
Check if this shape's bounding box intersects withbox
.
-
getBoundingBox
public abstract Rectangle getBoundingBox()
Get the rectangle that represents the bounding box that fully contains this shape.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toString
public final void toString(java.lang.StringBuilder buffer)
Write the string representation of this shape tobuffer
.
-
addArguments
public abstract void addArguments(java.lang.StringBuilder buffer)
-
toString
protected static void toString(java.lang.StringBuilder buffer, double x, double y)
Write the string representation of a point tobuffer
.
-
getTypeName
public abstract java.lang.String getTypeName()
-
clone
public Shape clone()
- Overrides:
clone
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
valueOf
public static Shape valueOf(java.lang.Object value)
-
compareTo
public final int compareTo(Shape other)
Shape comparison compares bounding box area.- Specified by:
compareTo
in interfacejava.lang.Comparable<Shape>
-
readExternal
public final void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
GWT Incompatible - hence no @Override annotation. See com.google.gwt.emul.java.io.Externalizable- Specified by:
readExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
writeExternal
public final void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
GWT Incompatible - hence no @Override annotation. See com.google.gwt.emul.java.io.Externalizable- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
readExternal
public abstract Shape readExternal(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
writeExternal
public abstract void writeExternal(java.io.DataOutput out) throws java.io.IOException
- Throws:
java.io.IOException
-
-