org.asnlab.asndt.runtime.conv
Class ChoiceConverter

java.lang.Object
  extended by org.asnlab.asndt.runtime.conv.AsnConverter
      extended by org.asnlab.asndt.runtime.conv.ChoiceConverter
Direct Known Subclasses:
ChoiceValue.ChoiceValueConverter

public abstract class ChoiceConverter
extends AsnConverter

The ChoiceConverter can convert choice value. This class is intent to be extended.


Field Summary
protected  AsnConverter[] alternativeConverters
          The alternative converters
 
Constructor Summary
ChoiceConverter()
           
ChoiceConverter(AsnConverter[] alternativeConverters)
           
 
Method Summary
abstract  java.lang.Object createAlternative(int index, java.lang.Object alternativeObject)
          Given the choice index, and the alternative object, create the choice value object.
 AsnConverter getAlternativeConverter(int index)
          Returns this ChoiceConverter's alternative converters.
abstract  int getAlternativeIndex(java.lang.Object object)
          Given the choice value object, return the choice index.
abstract  java.lang.Object getAlternativeObject(java.lang.Object object)
          Given the choice value object, return the alternative object.
 void setAlternativeConverters(AsnConverter[] alternativeConverters)
          Sets this ChoiceConverter's alternative converters
 
Methods inherited from class org.asnlab.asndt.runtime.conv.AsnConverter
convert, convert, convert, convert, createAsnConverterConverter, createAsnConverterType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

alternativeConverters

protected AsnConverter[] alternativeConverters
The alternative converters

Constructor Detail

ChoiceConverter

public ChoiceConverter()

ChoiceConverter

public ChoiceConverter(AsnConverter[] alternativeConverters)
Method Detail

setAlternativeConverters

public void setAlternativeConverters(AsnConverter[] alternativeConverters)
Sets this ChoiceConverter's alternative converters

Parameters:
alternativeConverters - The alternative converters

getAlternativeConverter

public AsnConverter getAlternativeConverter(int index)
Returns this ChoiceConverter's alternative converters.

Returns:
The alternative converters of this ChoiceConverter

createAlternative

public abstract java.lang.Object createAlternative(int index,
                                                   java.lang.Object alternativeObject)
Given the choice index, and the alternative object, create the choice value object.

Parameters:
index - The choice index
alternativeObject - The alternative object
Returns:
The new choice value object

getAlternativeIndex

public abstract int getAlternativeIndex(java.lang.Object object)
Given the choice value object, return the choice index.

Parameters:
object - The choice value object
Returns:
The choice index

getAlternativeObject

public abstract java.lang.Object getAlternativeObject(java.lang.Object object)
Given the choice value object, return the alternative object.

Parameters:
object - The choice value object
Returns:
The alternative object


Copyright �2009-2012 ASN Lab