org.joda.primitives
Class IntUtils

java.lang.Object
  extended by org.joda.primitives.IntUtils

public class IntUtils
extends Object

Provides utility methods and constants for int.

Since:
1.0
Version:
CODE GENERATED
Author:
Stephen Colebourne, Jason Tiscione

Field Summary
static int[] EMPTY_INT_ARRAY
          Immutable empty array.
 
Constructor Summary
IntUtils()
          Constructor that should not usually be used.
 
Method Summary
static Integer toObject(int value)
          Wraps an int with an Object wrapper.
static int toPrimitive(Object value)
          Unwraps the Integer to retrieve the primitive int.
static int[] toPrimitiveArray(Collection<?> coll)
          Unwraps a Collection to retrieve the primitive int.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_INT_ARRAY

public static final int[] EMPTY_INT_ARRAY
Immutable empty array.

Constructor Detail

IntUtils

public IntUtils()
Constructor that should not usually be used.

Method Detail

toObject

public static Integer toObject(int value)
Wraps an int with an Object wrapper.

Parameters:
value - the primitive value
Returns:
the Object wrapper

toPrimitive

public static int toPrimitive(Object value)
Unwraps the Integer to retrieve the primitive int.

Parameters:
value - the Object wrapper, must not be null
Returns:
the primitive value
Throws:
NullPointerException - if the value if null
ClassCastException - if the object is not Integer

toPrimitiveArray

public static int[] toPrimitiveArray(Collection<?> coll)
Unwraps a Collection to retrieve the primitive int.

Parameters:
coll - the Collection of Integer, must not be null
Returns:
the primitive value array
Throws:
NullPointerException - if the collection if null
ClassCastException - if any object is not Integer


Copyright © 2005-2010 Joda.org. All Rights Reserved.