Interface BooleanData

  • All Superinterfaces:
    it.unimi.dsi.fastutil.bytes.ByteIterable, Iterable<Byte>
    All Known Implementing Classes:
    BitSetBooleanData

    public interface BooleanData
    extends it.unimi.dsi.fastutil.bytes.ByteIterable
    A container for boolean data
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void add​(byte booleanValue)
      Adds a boolean value represented as a byte, where 0=false, 1=true, and -1=missing
      Selection asSelection()
      Returns a selection matching all the true values in the data
      void clear()
      Removes all data values
      boolean contains​(byte b)
      Returns true if the value at b is true.
      BooleanData copy()
      Returns a copy of this BooleanData object
      int countFalse()
      Returns the number of false values in the data *
      int countMissing()
      Returns the number of missing values in the data *
      int countTrue()
      Returns the number of true values in the data *
      int countUnique()
      Returns the number of unique values in the data.
      byte[] falseBytes()
      Returns a byte representation of the true values, encoded in the format specified in BitSet.toByteArray()
      byte getByte​(int i)
      Returns the value at i as a byte, where -1 represents missing values
      boolean isEmpty()
      Returns true if the data is empty, and false otherwise.
      Selection isFalse()
      Returns a selection matching all the false values in the data
      Selection isMissing()
      Returns a selection matching all the missing values in the data
      Selection isTrue()
      Returns a selection matching all the true values in the data
      byte[] missingBytes()
      Returns a byte representation of the missing values, encoded in the format specified in BitSet.toByteArray()
      void set​(int i, byte b)
      Sets the value at position i to byte b
      void setFalseBytes​(byte[] bytes)
      Sets the false values in the data from a byte[] encoding
      void setMissingBytes​(byte[] bytes)
      Sets the missing values in the data from a byte[] encoding
      void setTrueBytes​(byte[] bytes)
      Sets the true values in the data from a byte[] encoding
      int size()
      Returns the number of values in the data, including missing values
      void sortAscending()
      Sorts the data in-place in ascending order, with missing values first
      void sortDescending()
      Sorts the data in-place in descending order, with missing values last
      byte[] toByteArray()
      Returns the data as a byte[] containing 0 and 1, with any missing values encoded as -128
      it.unimi.dsi.fastutil.bytes.ByteArrayList toByteArrayList()
      Returns the data as a ByteArrayList containing 0 and 1, with any missing values encoded as -128
      byte[] trueBytes()
      Returns a byte representation of the false values, encoded in the format specified in BitSet.toByteArray()
      • Methods inherited from interface it.unimi.dsi.fastutil.bytes.ByteIterable

        forEach, forEach, forEach, intIterator, intSpliterator, iterator, spliterator
    • Method Detail

      • size

        int size()
        Returns the number of values in the data, including missing values
      • add

        void add​(byte booleanValue)
        Adds a boolean value represented as a byte, where 0=false, 1=true, and -1=missing
      • clear

        void clear()
        Removes all data values
      • copy

        BooleanData copy()
        Returns a copy of this BooleanData object
      • getByte

        byte getByte​(int i)
        Returns the value at i as a byte, where -1 represents missing values
      • countFalse

        int countFalse()
        Returns the number of false values in the data *
      • countTrue

        int countTrue()
        Returns the number of true values in the data *
      • countMissing

        int countMissing()
        Returns the number of missing values in the data *
      • countUnique

        int countUnique()
        Returns the number of unique values in the data. There can only be 3 (true, false, and missing) *
      • sortAscending

        void sortAscending()
        Sorts the data in-place in ascending order, with missing values first
      • sortDescending

        void sortDescending()
        Sorts the data in-place in descending order, with missing values last
      • toByteArray

        byte[] toByteArray()
        Returns the data as a byte[] containing 0 and 1, with any missing values encoded as -128
      • toByteArrayList

        it.unimi.dsi.fastutil.bytes.ByteArrayList toByteArrayList()
        Returns the data as a ByteArrayList containing 0 and 1, with any missing values encoded as -128
      • set

        void set​(int i,
                 byte b)
        Sets the value at position i to byte b
        Parameters:
        i - the 0-based index of the element in the data
        b - the value to set, should be 0, 1, or -128 only
      • isEmpty

        boolean isEmpty()
        Returns true if the data is empty, and false otherwise. Empty here means only missing values
      • contains

        boolean contains​(byte b)
        Returns true if the value at b is true.
      • asSelection

        Selection asSelection()
        Returns a selection matching all the true values in the data
      • isFalse

        Selection isFalse()
        Returns a selection matching all the false values in the data
      • isTrue

        Selection isTrue()
        Returns a selection matching all the true values in the data
      • isMissing

        Selection isMissing()
        Returns a selection matching all the missing values in the data
      • falseBytes

        byte[] falseBytes()
        Returns a byte representation of the true values, encoded in the format specified in BitSet.toByteArray()
      • trueBytes

        byte[] trueBytes()
        Returns a byte representation of the false values, encoded in the format specified in BitSet.toByteArray()
      • missingBytes

        byte[] missingBytes()
        Returns a byte representation of the missing values, encoded in the format specified in BitSet.toByteArray()
      • setTrueBytes

        void setTrueBytes​(byte[] bytes)
        Sets the true values in the data from a byte[] encoding
        Parameters:
        bytes - The true values encoded in the format specified in BitSet
      • setFalseBytes

        void setFalseBytes​(byte[] bytes)
        Sets the false values in the data from a byte[] encoding
        Parameters:
        bytes - The false values encoded in the format specified in BitSet
      • setMissingBytes

        void setMissingBytes​(byte[] bytes)
        Sets the missing values in the data from a byte[] encoding
        Parameters:
        bytes - The missing values encoded in the format specified in BitSet