XCMS Toolkit

schemajic.model
Class ASN1BitString

java.lang.Object
  extended by schemajic.model.ASN1Value
      extended by schemajic.model.ASN1BitString

public class ASN1BitString
extends ASN1Value

Models the abstract concept of the value of ASN.1 type BIT STRING.

Type BIT STRING is a simple builtin type whose distinguished values are an ordered sequence of zero or more bits, with each bit having a value of zero or one.

Universal class tag assignment is UNIVERSAL 3.

XML ASN.1 type name is BIT_STRING.

Version:
1.00 - 2006/02/09
Author:
support@phillipgriffin.com

Constructor Summary
ASN1BitString()
          Constructor for ASN1BitString.
ASN1BitString(byte[] bytes)
          Constructor for ASN1BitString with initialization parameter value.
 
Method Summary
 java.lang.Object accept(ValueVisitor visitor, java.lang.Object object)
          Accepts a visit from the ValueVisitor
 boolean bitIsSet(int index)
          Determines whether or not a bit in a string of bits is set to 1.
 Type getAsn1Type()
          Returns an ASN.1 BIT STRING type.
 byte[] getByteArray()
          Returns the current set of bits.
 int getSignificantBits()
          Gets the number of significant bits in a value of ASN.1 type BIT STRING.
 void setBit(int index)
          Sets a bit in the cuurent bits to zero.
 void setByteArray(byte[] bytes, int significant)
          Sets the current sets of bits and significant from the provided byte and integer values.
 void setSignificantBits(int bits)
          Updates the current significant bits.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASN1BitString

public ASN1BitString()
Constructor for ASN1BitString.


ASN1BitString

public ASN1BitString(byte[] bytes)
Constructor for ASN1BitString with initialization parameter value.

Method Detail

accept

public java.lang.Object accept(ValueVisitor visitor,
                               java.lang.Object object)
                        throws VisitorException
Accepts a visit from the ValueVisitor

Specified by:
accept in class ASN1Value
Parameters:
visitor - the function applicator (mapper), which knows how to process the given object type and apply appropriate operations to the elements of this type of object
object - an object to be visited
Returns:
a visit to the provided object
Throws:
VisitorException

bitIsSet

public boolean bitIsSet(int index)
Determines whether or not a bit in a string of bits is set to 1.

Parameters:
index - bit location in a string of bits
Returns:
boolean true or false

getByteArray

public byte[] getByteArray()
Returns the current set of bits.


setByteArray

public void setByteArray(byte[] bytes,
                         int significant)
Sets the current sets of bits and significant from the provided byte and integer values.

Parameters:
bytes - set of bits to set
significant - set of significant bits

getSignificantBits

public int getSignificantBits()
Gets the number of significant bits in a value of ASN.1 type BIT STRING.

Returns:
the number of significant bits

setBit

public void setBit(int index)
Sets a bit in the cuurent bits to zero.

Parameters:
index - position of bit in octet

setSignificantBits

public void setSignificantBits(int bits)
Updates the current significant bits.

Parameters:
bits - value to become the current significant bits

getAsn1Type

public Type getAsn1Type()
Returns an ASN.1 BIT STRING type.

Overrides:
getAsn1Type in class ASN1Value

XCMS Toolkit


Copyright © 2005-2006 GRIFFIN Consulting. All Rights Reserved.