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 voidaddArguments(java.lang.StringBuilder buffer)Shapeclone()intcompareTo(Shape other)Shape comparison compares bounding box area.abstract booleancontains(double x, double y)Return true if this shape contains the point defined by (x,y).booleancontains(Point point)Return true if this shape containspoint.abstract booleanfastIntersects(Rectangle box)Check if this shape's bounding box intersects withbox.abstract RectanglegetBoundingBox()Get the rectangle that represents the bounding box that fully contains this shape.abstract doublegetHeight()Get the height of this shape's bounding box.abstract java.lang.StringgetTypeName()abstract doublegetWidth()Get the width of this shape's bounding box.inthashCode()abstract booleanintersects(Rectangle box, Shape other)Check if this shape intersects withother.booleanintersects(Shape other)Check if this shape intersects withother.abstract ShapereadExternal(java.io.DataInput in)voidreadExternal(java.io.ObjectInput in)GWT Incompatible - hence no @Override annotation.java.lang.StringtoString()voidtoString(java.lang.StringBuilder buffer)Write the string representation of this shape tobuffer.protected static voidtoString(java.lang.StringBuilder buffer, double x, double y)Write the string representation of a point tobuffer.static ShapevalueOf(java.lang.Object value)abstract voidwriteExternal(java.io.DataOutput out)voidwriteExternal(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:
toStringin 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:
clonein classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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:
compareToin interfacejava.lang.Comparable<Shape>
-
readExternal
public final void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundExceptionGWT Incompatible - hence no @Override annotation. See com.google.gwt.emul.java.io.Externalizable- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
writeExternal
public final void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionGWT Incompatible - hence no @Override annotation. See com.google.gwt.emul.java.io.Externalizable- Specified by:
writeExternalin 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.IOExceptionjava.lang.ClassNotFoundException
-
writeExternal
public abstract void writeExternal(java.io.DataOutput out) throws java.io.IOException- Throws:
java.io.IOException
-
-