Package uk.ac.rdg.resc.edal.util
Class CollectionUtils
- java.lang.Object
-
- uk.ac.rdg.resc.edal.util.CollectionUtils
-
public final class CollectionUtils extends Object
Contains some useful utility methods for working with Collections.- Author:
- Jon, Guy
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Double>
listFromDoubleArray(double[] arr)
Creates and returns an unmodifiable List that wraps the given array.static List<Float>
listFromFloatArray(float[] arr)
Creates and returns an unmodifiable List that wraps the given array.static <T> Set<T>
setOf(T... values)
-
-
-
Method Detail
-
listFromFloatArray
public static List<Float> listFromFloatArray(float[] arr)
Creates and returns an unmodifiable List that wraps the given array. Changes to the array will be reflected in the List.- Parameters:
arr
- The array to wrap as a List- Returns:
- an unmodifiable List that wraps the array
- Throws:
NullPointerException
- if the array is null
-
listFromDoubleArray
public static List<Double> listFromDoubleArray(double[] arr)
Creates and returns an unmodifiable List that wraps the given array. Changes to the array will be reflected in the List.- Parameters:
arr
- The array to wrap as a List- Returns:
- an unmodifiable List that wraps the array
- Throws:
NullPointerException
- if the array is null
-
setOf
@SafeVarargs public static <T> Set<T> setOf(T... values)
-
-