org.codehaus.stax2.ri.typed
Class ValueDecoderFactory.BaseArrayDecoder

java.lang.Object
  extended by org.codehaus.stax2.typed.TypedArrayDecoder
      extended by org.codehaus.stax2.ri.typed.ValueDecoderFactory.BaseArrayDecoder
Direct Known Subclasses:
ValueDecoderFactory.DoubleArrayDecoder, ValueDecoderFactory.FloatArrayDecoder, ValueDecoderFactory.IntArrayDecoder, ValueDecoderFactory.LongArrayDecoder
Enclosing class:
ValueDecoderFactory

public abstract static class ValueDecoderFactory.BaseArrayDecoder
extends TypedArrayDecoder

Intermediate shared base class for token array decoders. The most important additional part is the abstract method that can be used to expand storage space; this is needed when decoding attribute values when all values must fit in the result array.


Field Summary
protected static int INITIAL_RESULT_BUFFER_SIZE
          Let's use some modest array size for allocating initial result buffer
protected  int mCount
           
protected  int mEnd
           
protected  int mStart
           
protected static int SMALL_RESULT_BUFFER_SIZE
          When expanding 'small' result buffers, we will expand size by bigger factor than for larger ones.
 
Constructor Summary
protected ValueDecoderFactory.BaseArrayDecoder(int start, int maxCount)
           
 
Method Summary
protected  int calcNewSize(int currSize)
           
abstract  void expand()
          Method that can be called if the internal result buffer fills up (when hasRoom() returns false) and will expand result buffer to hold at least one more value.
 int getCount()
           
 boolean hasRoom()
           
 
Methods inherited from class org.codehaus.stax2.typed.TypedArrayDecoder
decodeValue, decodeValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_RESULT_BUFFER_SIZE

protected static final int INITIAL_RESULT_BUFFER_SIZE
Let's use some modest array size for allocating initial result buffer

See Also:
Constant Field Values

SMALL_RESULT_BUFFER_SIZE

protected static final int SMALL_RESULT_BUFFER_SIZE
When expanding 'small' result buffers, we will expand size by bigger factor than for larger ones.

See Also:
Constant Field Values

mStart

protected int mStart

mEnd

protected int mEnd

mCount

protected int mCount
Constructor Detail

ValueDecoderFactory.BaseArrayDecoder

protected ValueDecoderFactory.BaseArrayDecoder(int start,
                                               int maxCount)
Method Detail

getCount

public final int getCount()
Specified by:
getCount in class TypedArrayDecoder
Returns:
Number of elements decoded and contained

hasRoom

public final boolean hasRoom()
Specified by:
hasRoom in class TypedArrayDecoder

expand

public abstract void expand()
Method that can be called if the internal result buffer fills up (when hasRoom() returns false) and will expand result buffer to hold at least one more value.


calcNewSize

protected int calcNewSize(int currSize)


Copyright © 2011 Codehaus. All Rights Reserved.