|
||||||||||
| 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<R,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. |
|
void |
contract()
Contracts the boolean array of the value of this data to enough
size to hold the last true bit. |
|
int |
hashCode()
Returns a hash code value for this ASN.1 data. |
|
boolean |
hasNamedBits()
Tests if the type has named bits definition. |
|
java.lang.String |
nameOfBit(int index)
Returns the identifier of the bit specified by the index number. |
|
void |
set(int... indexes)
Sets true to bits specified by index numbers. |
|
void |
set(java.lang.String nameOfBit)
Sets true to bits specified by the name of bit. |
|
void |
set(StringItem item)
Sets the StringItem value to this data. |
|
int |
size()
Returns the measured size of this instance. |
|
void |
unset(int... indexes)
Sets false to bits specified by index numbers. |
|
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, 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 - Indexes of bits to be set true.| Method Detail |
|---|
public void set(StringItem item)
StringItem value to this data.
item - The value to be set.public void set(int... indexes)
true to bits specified by index numbers. If the
boolean array of the value of this data does not have enough size
to hold the bit specified by the biggest index, it will be expanded
automatically.
indexes - Indexes of bits to be set true.public void set(java.lang.String nameOfBit)
true to bits specified by the name of bit.
nameOfBit - The name of bit.public void unset(int... indexes)
false to bits specified by index numbers. If the
boolean array of the value of this data does not have enough size
to hold the bit specified by the biggest index, it will be expanded
automatically.
indexes - Indexes of bits to be set false.public void contract()
boolean array of the value of this data to enough
size to hold the last true 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 SizeCountableprotected boolean[] cloneValue()
PrimitiveType
cloneValue in class PrimitiveType<boolean[]>public boolean valueEquals(java.lang.Object other)
ASN1Typetrue 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 int hashCode()
ASN1Type
hashCode in class PrimitiveType<boolean[]>Object.hashCode()
public <R,E extends java.lang.Throwable> R accept(ASN1Visitor<R,E> visitor)
throws E extends java.lang.Throwable
ASN1TypeASN1Visitor and calls a visit method of the
visitor.
accept in class ASN1Typevisitor - The visitor.
E - When an error occurred in the visit method of the
visitor.
E extends java.lang.Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||