|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjp.bitmeister.asn1.type.ASN1Type
jp.bitmeister.asn1.type.PrimitiveType<boolean[]>
jp.bitmeister.asn1.type.builtin.BIT_STRING
public class BIT_STRING
Represents ASN.1 'BIT STRING' type.
An instance of this class represents a 'BIT STRING' type data, and has an
array of boolean
value.
A sub-class of BIT_STRING
can contain one or more public
static
final
int
fields which annotated as
@ASN1NamedBit
. Each of these fields represents an index number of a
bit in a bitstring value.
ASN1NamedBit
Field Summary |
---|
Fields inherited from class jp.bitmeister.asn1.type.ASN1Type |
---|
stringBuilder |
Constructor Summary | |
---|---|
BIT_STRING()
Instantiates an empty BIT_STRING . |
|
BIT_STRING(boolean... array)
Instantiates a BIT_STRING and initialize it with the array of
boolean value. |
|
BIT_STRING(int... indexes)
Instantiates a BIT_STRING and sets true to bits which
specified by the indexes. |
|
BIT_STRING(StringItem item)
Instantiates a BIT_STRING and initialize it with the
StringItem . |
Method Summary | ||
---|---|---|
|
accept(ASN1Visitor<E> visitor)
Accepts the ASN1Visitor and calls a visit method of the
visitor. |
|
boolean |
bit(int index)
Returns the value of a bit specified by the index number. |
|
protected boolean[] |
cloneValue()
Creates and returns a copy of the value set to this data. |
|
void |
concatenate(BIT_STRING data)
Appends the value of the data to the value of this instance. |
|
boolean |
hasNamedBits()
Tests if the type has named bits definition. |
|
java.lang.String |
nameOfBit(int index)
Returns the indentifier of the bit specified by the index number. |
|
void |
set(int index)
Sets true to a bit specified by the index number. |
|
void |
set(StringItem item)
Sets the StringItem value to this data. |
|
int |
size()
Returns the measured size of this instance. |
|
void |
unset(int index)
Sets false to a bit specified by the index number. |
|
boolean |
valueEquals(java.lang.Object other)
Tests if the value of this ASN.1 data equals the value of the other ASN.1 data. |
Methods inherited from class jp.bitmeister.asn1.type.PrimitiveType |
---|
clear, clone, hashCode, hasValue, set, value |
Methods inherited from class jp.bitmeister.asn1.type.ASN1Type |
---|
equals, instantiate, matches, specification, toString, validate |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BIT_STRING()
BIT_STRING
.
public BIT_STRING(boolean... array)
BIT_STRING
and initialize it with the array of
boolean
value.
array
- The value to be assigned.public BIT_STRING(StringItem item)
BIT_STRING
and initialize it with the
StringItem
.
item
- The value to be assigned.public BIT_STRING(int... indexes)
BIT_STRING
and sets true
to bits which
specified by the indexes.
indexes
- The value to be assigned.Method Detail |
---|
public void set(StringItem item)
StringItem
value to this data.
item
- The value to be set.public void set(int index)
true
to a bit specified by the index number. If the
boolean
array of the value of this data does not have enough size
to hold the bit specified by the index, it will be expanded
automatically.
index
- The index of a bit.public void unset(int index)
false
to a bit specified by the index number. If the index
specifies the last bit of this bitstring value, the boolean
array
of the value of this data will be contracted to enough size to hold the
last true
bit.
index
- The index of a bit.public boolean bit(int index)
index
- The index number.
public boolean hasNamedBits()
true
when the type has named bits.public java.lang.String nameOfBit(int index)
index
- The index number of a bit.
public void concatenate(BIT_STRING data)
Concatenatable
concatenate
in interface Concatenatable<BIT_STRING>
data
- The data that has the value to be appended. The ASN.1 type of
the data
shall be same as this instance.public int size()
SizeCountable
size
in interface SizeCountable
protected boolean[] cloneValue()
PrimitiveType
cloneValue
in class PrimitiveType<boolean[]>
public boolean valueEquals(java.lang.Object other)
ASN1Type
true
when they have same value even if
their types are different.
valueEquals
in class PrimitiveType<boolean[]>
other
- The ASN.1 data which to be compared.
true
when they have same value.public <E extends java.lang.Throwable> void accept(ASN1Visitor<E> visitor) throws E extends java.lang.Throwable
ASN1Type
ASN1Visitor
and calls a visit
method of the
visitor.
accept
in class ASN1Type
visitor
- The visitor.
E extends java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |