Class ShortBitSet


  • public class ShortBitSet
    extends java.lang.Object
    Bit set stored as a short value.
    Author:
    Dennis M. Sosnoski
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private char m_bits
      Mask for values in set.
      private static char[] s_bitMasks
      Array of bit masks.
    • Constructor Summary

      Constructors 
      Constructor Description
      ShortBitSet()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int value)
      Include value in set.
      void clear()
      Clear all values.
      boolean isSet​(int value)
      Check for value in set.
      void remove​(int value)
      Exclude value from set.
      void setRange​(int min, int max)
      Set all values in range.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • s_bitMasks

        private static final char[] s_bitMasks
        Array of bit masks.
      • m_bits

        private char m_bits
        Mask for values in set.
    • Constructor Detail

      • ShortBitSet

        public ShortBitSet()
    • Method Detail

      • isSet

        public boolean isSet​(int value)
        Check for value in set.
        Parameters:
        value -
        Returns:
        true if in set, false if not
      • add

        public void add​(int value)
        Include value in set.
        Parameters:
        value -
      • remove

        public void remove​(int value)
        Exclude value from set.
        Parameters:
        value -
      • clear

        public void clear()
        Clear all values.
      • setRange

        public void setRange​(int min,
                             int max)
        Set all values in range.
        Parameters:
        min - minimum value in range
        max - maximum value in range