Index: src/Common/NetTopologySuite/GeometriesGraph/Index/SweepLineEvent.cs
===================================================================
diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a
--- src/Common/NetTopologySuite/GeometriesGraph/Index/SweepLineEvent.cs (.../SweepLineEvent.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9)
+++ src/Common/NetTopologySuite/GeometriesGraph/Index/SweepLineEvent.cs (.../SweepLineEvent.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a)
@@ -11,18 +11,14 @@
///
///
public const int Insert = 1;
-
+
///
///
///
public const int Delete = 2;
- private object edgeSet; // used for red-blue intersection detection
- private double xValue;
- private int eventType;
- private SweepLineEvent insertEvent; // null if this is an Insert event
- private int deleteEventIndex;
- private object obj;
+ private readonly double xValue;
+ private readonly int eventType;
///
///
@@ -33,88 +29,58 @@
///
public SweepLineEvent(object edgeSet, double x, SweepLineEvent insertEvent, object obj)
{
- this.edgeSet = edgeSet;
+ EdgeSet = edgeSet;
xValue = x;
- this.insertEvent = insertEvent;
- this.eventType = Insert;
+ InsertEvent = insertEvent;
+ eventType = Insert;
if (insertEvent != null)
+ {
eventType = Delete;
- this.obj = obj;
+ }
+ Object = obj;
}
///
///
///
- public object EdgeSet
- {
- get
- {
- return this.edgeSet;
- }
- set
- {
- this.edgeSet = value;
- }
- }
+ public object EdgeSet { get; set; }
///
///
///
- public bool IsInsert
+ public bool IsInsert
{
get
{
- return insertEvent == null;
+ return InsertEvent == null;
}
}
///
///
///
- public bool IsDelete
+ public bool IsDelete
{
get
{
- return insertEvent != null;
+ return InsertEvent != null;
}
}
///
///
///
- public SweepLineEvent InsertEvent
- {
- get
- {
- return insertEvent;
- }
- }
+ public SweepLineEvent InsertEvent { get; private set; }
///
///
///
- public int DeleteEventIndex
- {
- get
- {
- return deleteEventIndex;
- }
- set
- {
- this.deleteEventIndex = value;
- }
- }
+ public int DeleteEventIndex { get; set; }
///
///
///
- public object Object
- {
- get
- {
- return obj;
- }
- }
+ public object Object { get; private set; }
///
/// ProjectionEvents are ordered first by their x-value, and then by their eventType.
@@ -123,18 +89,26 @@
/// correctly handled.
///
///
- public int CompareTo(object o)
+ public int CompareTo(object o)
{
- SweepLineEvent pe = (SweepLineEvent)o;
+ SweepLineEvent pe = (SweepLineEvent) o;
if (xValue < pe.xValue)
+ {
return -1;
+ }
if (xValue > pe.xValue)
+ {
return 1;
+ }
if (eventType < pe.eventType)
+ {
return -1;
+ }
if (eventType > pe.eventType)
+ {
return 1;
+ }
return 0;
}
}
-}
+}
\ No newline at end of file