Class Region

  • All Implemented Interfaces:
    java.lang.Comparable<java.lang.Comparable<?>>, AATreeSet.Node<Region>

    class Region
    extends AATreeSet.AbstractTreeNode<Region>
    implements java.lang.Comparable<java.lang.Comparable<?>>
    Class that represents the regions held within this set.
    • Field Detail

      • start

        private int start
      • end

        private int end
      • availableBitSet

        private int availableBitSet
    • Constructor Detail

      • Region

        Region​(int value)
      • Region

        Region​(int start,
               int end)
        Creates a region containing the given range of values (inclusive).
      • Region

        Region​(Region r)
        Create a shallow copy of a region.

        The new Region has NULL left and right children.

    • Method Detail

      • available

        int available()
      • updateAvailable

        private void updateAvailable()
      • availableHere

        int availableHere()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • size

        public int size()
        Returns the size of this range (the number of values within its bounds).
      • isNull

        protected boolean isNull()
      • treeSize

        int treeSize()
      • merge

        public void merge​(Region r)
        Merge the supplied region into this region (if they are adjoining).
        Parameters:
        r - region to merge
      • tryMerge

        public boolean tryMerge​(Region r)
      • compareTo

        public int compareTo​(java.lang.Comparable<?> other)
        Order this region relative to another.
        Specified by:
        compareTo in interface java.lang.Comparable<java.lang.Comparable<?>>
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • start

        public int start()
        Returns the start of this range (inclusive).
      • end

        public int end()