Index: src/Common/NetTopologySuite/Index/Strtree/AbstractNode.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- src/Common/NetTopologySuite/Index/Strtree/AbstractNode.cs (.../AbstractNode.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/Common/NetTopologySuite/Index/Strtree/AbstractNode.cs (.../AbstractNode.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -8,11 +8,10 @@ /// (AbstractNodes) or real data (ItemBoundables). If this node contains real data /// (rather than nodes), then we say that this node is a "leaf node". /// - public abstract class AbstractNode : IBoundable + public abstract class AbstractNode : IBoundable { - private ArrayList childBoundables = new ArrayList(); + private readonly ArrayList childBoundables = new ArrayList(); private object bounds = null; - private int level; /// /// Constructs an AbstractNode at the given level in the tree @@ -21,9 +20,9 @@ /// 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the /// root node will have the highest level. /// - public AbstractNode(int level) + public AbstractNode(int level) { - this.level = level; + Level = level; } /// @@ -39,16 +38,10 @@ } /// - /// Returns a representation of space that encloses this Boundable, - /// preferably not much bigger than this Boundable's boundary yet fast to - /// test for intersection with the bounds of other Boundables. The class of - /// object returned depends on the subclass of AbstractSTRtree. + /// Returns 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the + /// root node will have the highest level. /// - /// - /// An Envelope (for STRtrees), an Interval (for SIRtrees), or other - /// object (for other subclasses of AbstractSTRtree). - /// - protected abstract object ComputeBounds(); + public int Level { get; private set; } /// /// @@ -66,26 +59,26 @@ } /// - /// Returns 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the - /// root node will have the highest level. - /// - public int Level - { - get - { - return level; - } - } - - /// /// Adds either an AbstractNode, or if this is a leaf node, a data object /// (wrapped in an ItemBoundable). /// /// - public void AddChildBoundable(IBoundable childBoundable) + public void AddChildBoundable(IBoundable childBoundable) { Assert.IsTrue(bounds == null); childBoundables.Add(childBoundable); } + + /// + /// Returns a representation of space that encloses this Boundable, + /// preferably not much bigger than this Boundable's boundary yet fast to + /// test for intersection with the bounds of other Boundables. The class of + /// object returned depends on the subclass of AbstractSTRtree. + /// + /// + /// An Envelope (for STRtrees), an Interval (for SIRtrees), or other + /// object (for other subclasses of AbstractSTRtree). + /// + protected abstract object ComputeBounds(); } -} +} \ No newline at end of file