Class BooleanArray


  • public class BooleanArray
    extends Object
    an array that stores the bits in a long[] - each long stores 64 values
    • Field Detail

      • DEFAULT_CAPACITY

        public static int DEFAULT_CAPACITY
    • Constructor Detail

      • BooleanArray

        public BooleanArray()
      • BooleanArray

        public BooleanArray​(int length)
    • Method Detail

      • add

        public void add​(int pos,
                        boolean b)
        Inserts the given value in the specified position in the array. Shift all the existing elements at position and the subsequent ones to the right
        Parameters:
        pos -
        b -
      • toLongArray

        public long[] toLongArray()
      • get

        public boolean get​(int pos)
        Get value on position pos
        Parameters:
        pos -
        Returns:
      • size

        public int size()
      • add

        public void add​(boolean b)
        Add value at the end of the array
        Parameters:
        b -
      • valueOf

        public static BooleanArray valueOf​(long[] a,
                                           int length)
        Create a BooleanArray from the given