Class SweepLineEvent
- java.lang.Object
-
- org.locationtech.jts.geomgraph.index.SweepLineEvent
-
- All Implemented Interfaces:
Comparable
public class SweepLineEvent extends Object implements Comparable
- Version:
- 1.7
-
-
Constructor Summary
Constructors Constructor Description SweepLineEvent(double x, SweepLineEvent insertEvent)Creates a DELETE event.SweepLineEvent(Object label, double x, Object obj)Creates an INSERT event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Object o)Events are ordered first by their x-value, and then by their eventType.intgetDeleteEventIndex()SweepLineEventgetInsertEvent()ObjectgetObject()booleanisDelete()booleanisInsert()booleanisSameLabel(SweepLineEvent ev)voidsetDeleteEventIndex(int deleteEventIndex)
-
-
-
Constructor Detail
-
SweepLineEvent
public SweepLineEvent(Object label, double x, Object obj)
Creates an INSERT event.- Parameters:
label- the edge set label for this objectx- the event locationobj- the object being inserted
-
SweepLineEvent
public SweepLineEvent(double x, SweepLineEvent insertEvent)Creates a DELETE event.- Parameters:
x- the event locationinsertEvent- the corresponding INSERT event
-
-
Method Detail
-
isInsert
public boolean isInsert()
-
isDelete
public boolean isDelete()
-
getInsertEvent
public SweepLineEvent getInsertEvent()
-
getDeleteEventIndex
public int getDeleteEventIndex()
-
setDeleteEventIndex
public void setDeleteEventIndex(int deleteEventIndex)
-
getObject
public Object getObject()
-
isSameLabel
public boolean isSameLabel(SweepLineEvent ev)
-
compareTo
public int compareTo(Object o)
Events are ordered first by their x-value, and then by their eventType. Insert events are sorted before Delete events, so that items whose Insert and Delete events occur at the same x-value will be correctly handled.- Specified by:
compareToin interfaceComparable
-
-