org.codehaus.jackson.map.util
Class ArrayBuilders

java.lang.Object
  extended by org.codehaus.jackson.map.util.ArrayBuilders

public final class ArrayBuilders
extends Object

Helper class that contains set of distinct builders for different arrays of primitive values. It also provides trivially simple reuse scheme, which assumes that caller knows not to use instances concurrently (which works ok with primitive arrays since they can not contain other non-primitive types).


Nested Class Summary
static class ArrayBuilders.BooleanBuilder
           
static class ArrayBuilders.ByteBuilder
           
static class ArrayBuilders.DoubleBuilder
           
static class ArrayBuilders.FloatBuilder
           
static class ArrayBuilders.IntBuilder
           
static class ArrayBuilders.LongBuilder
           
static class ArrayBuilders.ShortBuilder
           
 
Constructor Summary
ArrayBuilders()
           
 
Method Summary
static
<T> List<T>
addToList(List<T> list, T element)
          Helper method for adding specified element to a List, but also considering case where the List may not have been yet constructed (that is, null is passed instead).
static
<T> HashSet<T>
arrayToSet(T[] elements)
           
 ArrayBuilders.BooleanBuilder getBooleanBuilder()
           
 ArrayBuilders.ByteBuilder getByteBuilder()
           
 ArrayBuilders.DoubleBuilder getDoubleBuilder()
           
 ArrayBuilders.FloatBuilder getFloatBuilder()
           
 ArrayBuilders.IntBuilder getIntBuilder()
           
 ArrayBuilders.LongBuilder getLongBuilder()
           
 ArrayBuilders.ShortBuilder getShortBuilder()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayBuilders

public ArrayBuilders()
Method Detail

getBooleanBuilder

public ArrayBuilders.BooleanBuilder getBooleanBuilder()

getByteBuilder

public ArrayBuilders.ByteBuilder getByteBuilder()

getShortBuilder

public ArrayBuilders.ShortBuilder getShortBuilder()

getIntBuilder

public ArrayBuilders.IntBuilder getIntBuilder()

getLongBuilder

public ArrayBuilders.LongBuilder getLongBuilder()

getFloatBuilder

public ArrayBuilders.FloatBuilder getFloatBuilder()

getDoubleBuilder

public ArrayBuilders.DoubleBuilder getDoubleBuilder()

arrayToSet

public static <T> HashSet<T> arrayToSet(T[] elements)

addToList

public static <T> List<T> addToList(List<T> list,
                                    T element)
Helper method for adding specified element to a List, but also considering case where the List may not have been yet constructed (that is, null is passed instead).

Parameters:
list - List to add to; may be null to indicate that a new List is to be constructed
element - Element to add to list
Returns:
List in which element was added; either list (if it was not null), or a newly constructed List.