org.apache.directory.shared.kerberos.codec.options
Class Options

java.lang.Object
  extended by org.apache.directory.shared.asn1.util.BitString
      extended by org.apache.directory.shared.kerberos.flags.AbstractKerberosFlags
          extended by org.apache.directory.shared.kerberos.codec.options.Options
Direct Known Subclasses:
ApOptions, KdcOptions

public abstract class Options
extends AbstractKerberosFlags

A base class to manage Kerberos BitSet elements.

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.kerberos.flags.AbstractKerberosFlags
MAX_SIZE, value
 
Fields inherited from class org.apache.directory.shared.asn1.util.BitString
EMPTY_STRING
 
Constructor Summary
protected Options(int maxSize)
          Creates a new BitSet with a specific number of bits.
 
Method Summary
 void clear(int index)
          Clears (sets false) the option at a given index.
 boolean get(int index)
          Returns the value of the option at the given index.
 byte[] getBytes()
          Byte-reversing methods are an anomaly of the BouncyCastle DERBitString endianness.
 boolean match(Options options, int option)
          Returns whether the option at a given index matches the option in this Options.
 void set(int index)
          Sets the option at a given index.
protected  void setBytes(byte[] bytes)
          Set the array of bytes representing the bits
 String toString()
          
 
Methods inherited from class org.apache.directory.shared.kerberos.flags.AbstractKerberosFlags
clearFlag, clearFlag, equals, getIntValue, hashCode, isFlagSet, isFlagSet, isFlagSet, setData, setFlag, setFlag
 
Methods inherited from class org.apache.directory.shared.asn1.util.BitString
clearBit, getBit, getData, getUnusedBits, setBit, setData, size
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Options

protected Options(int maxSize)
Creates a new BitSet with a specific number of bits.

Parameters:
maxSize - The number of bits to allocate
Method Detail

match

public boolean match(Options options,
                     int option)
Returns whether the option at a given index matches the option in this Options.

Parameters:
options - The set of possible options
option - The Option we are looking for
Returns:
true if two options are the same.

get

public boolean get(int index)
Returns the value of the option at the given index.

Parameters:
index - The position in the BitSet for the option we are looking for
Returns:
true if the option at the given index is set.

set

public void set(int index)
Sets the option at a given index.

Parameters:
index - The position of the Option w want to set

clear

public void clear(int index)
Clears (sets false) the option at a given index.

Parameters:
index - The position of the Option we want to clear

getBytes

public byte[] getBytes()
Byte-reversing methods are an anomaly of the BouncyCastle DERBitString endianness. These methods can be removed if the Apache Directory Snickers codecs operate differently.

Returns:
The raw Options bytes.

setBytes

protected void setBytes(byte[] bytes)
Set the array of bytes representing the bits

Parameters:
bytes - The bytes to store

toString

public String toString()

Overrides:
toString in class org.apache.directory.shared.asn1.util.BitString


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.