Class ConfBits

All Implemented Interfaces:
Serializable, Cloneable, Comparable<ConfBits>
Direct Known Subclasses:
ConfBit32, ConfBit64, ConfBitBig

public abstract class ConfBits extends ConfValue implements Cloneable, Serializable, Comparable<ConfBits>
DATA_CONTAINER - This is the superclass for all bits types i.e. ConfBit32, ConfBit64 and ConfBitBig.
See Also:
  • Method Details

    • byteArrayValue

      public byte[] byteArrayValue()
      Get byte array representing this bitset in little endian order.
      Returns:
      little endian byte array of this bitset
    • equals

      public boolean equals(Object o)
      Equals method
      Specified by:
      equals in class ConfValue
      Parameters:
      o - The object to compare to.
      Returns:
      true if the objects are identical.
    • hashCode

      public int hashCode()
      hashCode method
      Specified by:
      hashCode in class ConfValue
    • toString

      public String toString()
      toString method. The string representation for bitset is 'bin<0x...>' with hexadecimal representation in little endian order
      Specified by:
      toString in class ConfValue
      Returns:
      the printable representation of the object.
    • compareTo

      public int compareTo(ConfBits o)
      CompareTo method
      Specified by:
      compareTo in interface Comparable<ConfBits>
    • setBit

      public void setBit(long pos) throws ConfException
      Set bit at position pos in bitset. The bitset must initially been created with a maxposition higher or equal to pos or else an ConfException is thrown.
      Parameters:
      pos -
      Throws:
      ConfException
    • clearBit

      public void clearBit(long pos) throws ConfException
      Clear bit at position pos in bitset. The bitset must initially been created with a maxposition higher or equal to pos or else an ConfException is thrown.
      Parameters:
      pos -
      Throws:
      ConfException
    • isBitSet

      public boolean isBitSet(long pos) throws ConfException
      Check if bit is set at position pos in bitset. The bitset must initially been created with a maxposition higher or equal to pos or else an ConfException is thrown.
      Parameters:
      pos -
      Returns:
      boolean true if bit is set.
      Throws:
      ConfException
    • getValueByBitNamesString

      public static ConfBits getValueByBitNamesString(ConfPath path, String bitNames) throws ConfException
      Get an ConfBits from the string of bitnames like "bit1 bit2 ...", i.e a space separated list of bitnames adhering to a specific position in the schema. The given path must be absolute and fully qualified with schema prefixes. Note, this method relies on Maapi.loadSchemas() being called prior to this call.
      Parameters:
      path - ConfPath pointing to the position of a bitset in the schema.
      bitNames - String of space separated bit names
      Returns:
      ConfBits value
      Throws:
      ConfException
    • getValueByBitNamesString

      public static ConfBits getValueByBitNamesString(String path, String bitNames) throws ConfException
      Like getValueByBitNamesString(ConfPath, String) but takes a path string pointing to the bitset in the schema.
      Parameters:
      path - String pointing to the position of a bitset in the schema.
      bitNames - String of space separated bit names
      Returns:
      ConfBits value
      Throws:
      ConfException
    • getBitNamesByValue

      public static String getBitNamesByValue(ConfPath path, ConfBits bits) throws ConfException
      Get a string of bitnames like bitnames like "bit1 bit2 ...", i.e a space separated list of bitnames from a ConfBits value. The value needs to adhering to a specific position in the schema. Note, this method relies on Maapi.loadSchemas() being called prior to this call.
      Parameters:
      path - ConfPath pointing to the position of a bitset in the schema.
      bits - ConfBits value
      Returns:
      String of bitNames
      Throws:
      ConfException
    • getBitNamesByValue

      public static String getBitNamesByValue(String path, ConfBits bits) throws ConfException
      Like getBitNamesByValue(ConfPath, ConfBits) but takes a path string pointing to the bitset in the schema.
      Parameters:
      path - String pointing to the position of a bitset in the schema.
      bits - ConfBits value
      Returns:
      String of bitNames
      Throws:
      ConfException