org.apache.directory.api.asn1.actions
Class AbstractReadInteger<E extends Asn1Container>

java.lang.Object
  extended by org.apache.directory.api.asn1.ber.grammar.GrammarAction<E>
      extended by org.apache.directory.api.asn1.actions.AbstractReadInteger<E>
All Implemented Interfaces:
Action<E>

public abstract class AbstractReadInteger<E extends Asn1Container>
extends GrammarAction<E>

The action used to read an integer value

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.api.asn1.ber.grammar.GrammarAction
name
 
Constructor Summary
AbstractReadInteger(String name)
          Instantiates a new AbstractReadInteger action.
AbstractReadInteger(String name, int minValue, int maxValue)
          Creates a new instance of AbstractReadInteger.
 
Method Summary
 void action(E container)
          The action to be executed.
protected abstract  void setIntegerValue(int value, E container)
          set the integer value to the appropriate field of ASN.1 object present in the container
 
Methods inherited from class org.apache.directory.api.asn1.ber.grammar.GrammarAction
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractReadInteger

public AbstractReadInteger(String name)
Instantiates a new AbstractReadInteger action.

Parameters:
name - the action's name

AbstractReadInteger

public AbstractReadInteger(String name,
                           int minValue,
                           int maxValue)
Creates a new instance of AbstractReadInteger.

Parameters:
name - the action's name
minValue - the acceptable minimum value for the expected value to be read
maxValue - the acceptable maximum value for the value to be read
Method Detail

setIntegerValue

protected abstract void setIntegerValue(int value,
                                        E container)
set the integer value to the appropriate field of ASN.1 object present in the container

Parameters:
value - the integer value
container - the ASN.1 object's container

action

public final void action(E container)
                  throws org.apache.directory.api.asn1.DecoderException
The action to be executed.

Parameters:
container - The container which stores the current data
Throws:
org.apache.directory.api.asn1.DecoderException - Thrown if something went wrong.


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