Class SweepLineEvent
- java.lang.Object
-
- org.locationtech.jts.geomgraph.index.SweepLineEvent
-
- All Implemented Interfaces:
java.lang.Comparable
public class SweepLineEvent extends java.lang.Object implements java.lang.Comparable
- Version:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description private static int
DELETE
private int
deleteEventIndex
private int
eventType
private static int
INSERT
private SweepLineEvent
insertEvent
private java.lang.Object
label
private java.lang.Object
obj
private double
xValue
-
Constructor Summary
Constructors Constructor Description SweepLineEvent(double x, SweepLineEvent insertEvent)
Creates a DELETE event.SweepLineEvent(java.lang.Object label, double x, java.lang.Object obj)
Creates an INSERT event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(java.lang.Object o)
Events are ordered first by their x-value, and then by their eventType.int
getDeleteEventIndex()
SweepLineEvent
getInsertEvent()
java.lang.Object
getObject()
boolean
isDelete()
boolean
isInsert()
boolean
isSameLabel(SweepLineEvent ev)
void
setDeleteEventIndex(int deleteEventIndex)
-
-
-
Field Detail
-
INSERT
private static final int INSERT
- See Also:
- Constant Field Values
-
DELETE
private static final int DELETE
- See Also:
- Constant Field Values
-
label
private java.lang.Object label
-
xValue
private double xValue
-
eventType
private int eventType
-
insertEvent
private SweepLineEvent insertEvent
-
deleteEventIndex
private int deleteEventIndex
-
obj
private java.lang.Object obj
-
-
Constructor Detail
-
SweepLineEvent
public SweepLineEvent(java.lang.Object label, double x, java.lang.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 java.lang.Object getObject()
-
isSameLabel
public boolean isSameLabel(SweepLineEvent ev)
-
compareTo
public int compareTo(java.lang.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:
compareTo
in interfacejava.lang.Comparable
-
-