|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.shapelogic.polygon.CLine
public class CLine
Class for line. Works for both double and int based points. Can be used for both undirected and directed lines I think this is made to be immutable, but points are not. But in order to have the sort work for lines I have to assume that the points in it are not moving.
Constructor Summary | |
---|---|
CLine(IPoint2D p1,
IPoint2D p2)
|
Method Summary | |
---|---|
double |
angle()
Should return numbers in the range 0 to PI. |
int |
compareTo(ILine2D that)
|
double |
distance()
|
boolean |
equals(java.lang.Object that)
|
static java.util.List<CLine> |
filterHorizontal(java.util.Collection<CLine> inputLines)
|
static java.util.List<CLine> |
filterVertical(java.util.Collection<CLine> inputLines)
|
IPoint2D |
getCenter()
|
double |
getDiameter()
|
IPoint2D |
getEnd()
|
IPoint2D |
getStart()
|
int |
hashCode()
|
boolean |
isHorizontal()
|
boolean |
isLineOrdered()
Check if the points in this line is ordered alphabetically |
boolean |
isPoint()
|
boolean |
isVertical()
|
CLine |
lineStartingAtPoint(IPoint2D point)
|
static CLine |
makeUnordered(IPoint2D p1,
IPoint2D p2)
|
CLine |
oppositeDirectionLine()
|
CLine |
orderedLine()
Just order the points in this line alphabetically. |
IPoint2D |
relativePoint()
|
CLine |
replacePointsInMap(java.util.Map<IPoint2D,IPoint2D> pointReplacementMap,
AnnotatedShapeImplementation annotatedShape)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CLine(IPoint2D p1, IPoint2D p2)
Method Detail |
---|
public static CLine makeUnordered(IPoint2D p1, IPoint2D p2)
public IPoint2D getEnd()
getEnd
in interface ILine2D
public IPoint2D getStart()
getStart
in interface ILine2D
public int compareTo(ILine2D that)
compareTo
in interface java.lang.Comparable<ILine2D>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object that)
equals
in class java.lang.Object
public IPoint2D relativePoint()
public double angle()
public boolean isVertical()
public boolean isHorizontal()
public boolean isPoint()
public double distance()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.util.List<CLine> filterHorizontal(java.util.Collection<CLine> inputLines)
public static java.util.List<CLine> filterVertical(java.util.Collection<CLine> inputLines)
public CLine replacePointsInMap(java.util.Map<IPoint2D,IPoint2D> pointReplacementMap, AnnotatedShapeImplementation annotatedShape)
replacePointsInMap
in interface PointReplacable<CLine>
public CLine orderedLine()
public boolean isLineOrdered()
public IPoint2D getCenter()
getCenter
in interface GeometricShape2D
public double getDiameter()
getDiameter
in interface GeometricShape2D
public CLine lineStartingAtPoint(IPoint2D point)
public CLine oppositeDirectionLine()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |