Package com.tailf.conf
Class ConfBits
Object
com.tailf.conf.ConfObject
com.tailf.conf.ConfValue
com.tailf.conf.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:
-
Field Summary
Fields inherited from class com.tailf.conf.ConfObject
J_BINARY, J_BIT32, J_BIT64, J_BITBIG, J_BOOL, J_BUF, J_CDBBEGIN, J_DATE, J_DATETIME, J_DECIMAL64, J_DEFAULT, J_DOUBLE, J_DQUAD, J_DURATION, J_ENUMERATION, J_HEXSTR, J_IDENTITYREF, J_INSTANCE_IDENTIFIER, J_INT16, J_INT32, J_INT64, J_INT8, J_IPV4, J_IPV4_AND_PLEN, J_IPV4PREFIX, J_IPV6, J_IPV6_AND_PLEN, J_IPV6PREFIX, J_LIST, J_NOEXISTS, J_OBJECTREF, J_OID, J_PTR, J_QNAME, J_STR, J_SYMBOL, J_TIME, J_UINT16, J_UINT32, J_UINT64, J_UINT8, J_UNION, J_XMLBEGIN, J_XMLBEGINDEL, J_XMLEND, J_XMLMOVEAFTER, J_XMLMOVEFIRST, J_XMLTAG
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Get byte array representing this bitset in little endian order.void
clearBit
(long pos) Clear bit at position pos in bitset.int
CompareTo methodboolean
Equals methodstatic String
getBitNamesByValue
(ConfPath path, ConfBits bits) Get a string of bitnames like bitnames like "bit1 bit2 ...", i.e a space separated list of bitnames from a ConfBits value.static String
getBitNamesByValue
(String path, ConfBits bits) LikegetBitNamesByValue(ConfPath, ConfBits)
but takes a path string pointing to the bitset in the schema.static ConfBits
getValueByBitNamesString
(ConfPath path, String bitNames) 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.static ConfBits
getValueByBitNamesString
(String path, String bitNames) LikegetValueByBitNamesString(ConfPath, String)
but takes a path string pointing to the bitset in the schema.int
hashCode()
hashCode methodboolean
isBitSet
(long pos) Check if bit is set at position pos in bitset.void
setBit
(long pos) Set bit at position pos in bitset.toString()
toString method.Methods inherited from class com.tailf.conf.ConfValue
getStringByValue, getStringByValue, getValueByString, getValueByString
Methods inherited from class com.tailf.conf.ConfObject
clone, decode
-
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
Equals method -
hashCode
public int hashCode()hashCode method -
toString
toString method. The string representation for bitset is 'bin<0x...>' with hexadecimal representation in little endian order -
compareTo
CompareTo method- Specified by:
compareTo
in interfaceComparable<ConfBits>
-
setBit
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
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
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
LikegetValueByBitNamesString(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
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
LikegetBitNamesByValue(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
-