Index: src/Common/NetTopologySuite/GeometriesGraph/GraphComponent.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- src/Common/NetTopologySuite/GeometriesGraph/GraphComponent.cs (.../GraphComponent.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/Common/NetTopologySuite/GeometriesGraph/GraphComponent.cs (.../GraphComponent.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -8,31 +8,36 @@ /// that form a graph. Each GraphComponent can carry a /// Label. /// - abstract public class GraphComponent - { + public abstract class GraphComponent + { /// /// /// protected Label label; // isInResult indicates if this component has already been included in the result - private bool isInResult = false; private bool isCovered = false; - private bool isCoveredSet = false; - private bool isVisited = false; /// /// /// - public GraphComponent() { } + public GraphComponent() + { + Visited = false; + IsCoveredSet = false; + InResult = false; + } /// /// /// /// public GraphComponent(Label label) { + Visited = false; + IsCoveredSet = false; + InResult = false; this.label = label; } @@ -49,22 +54,12 @@ { label = value; } - } - + } + /// /// /// - public bool InResult - { - get - { - return isInResult; - } - set - { - isInResult = value; - } - } + public bool InResult { get; set; } /// /// IsInResult indicates if this component has already been included in the result. @@ -84,12 +79,12 @@ { get { - return this.isCovered; + return isCovered; } set { isCovered = value; - isCoveredSet = true; + IsCoveredSet = true; } } @@ -107,28 +102,12 @@ /// /// /// - public bool IsCoveredSet - { - get - { - return isCoveredSet; - } - } + public bool IsCoveredSet { get; private set; } /// /// /// - public bool Visited - { - get - { - return isVisited; - } - set - { - isVisited = value; - } - } + public bool Visited { get; set; } /// /// @@ -137,32 +116,32 @@ { get { - return isVisited; + return Visited; } } - + /// /// /// /// /// A coordinate in this component (or null, if there are none). /// - abstract public ICoordinate Coordinate { get; } + public abstract ICoordinate Coordinate { get; } /// - /// Compute the contribution to an IM for this component. - /// - abstract public void ComputeIM(IntersectionMatrix im); - - /// /// An isolated component is one that does not intersect or touch any other /// component. This is the case if the label has valid locations for /// only a single Geometry. /// /// true if this component is isolated. - abstract public bool IsIsolated { get; } + public abstract bool IsIsolated { get; } /// + /// Compute the contribution to an IM for this component. + /// + public abstract void ComputeIM(IntersectionMatrix im); + + /// /// Update the IM with the contribution for this component. /// A component only contributes if it has a labelling for both parent geometries. /// @@ -173,4 +152,4 @@ ComputeIM(im); } } -} +} \ No newline at end of file