Class PrimitiveArray

java.lang.Object
overit.geocall.util.PrimitiveArray

public class PrimitiveArray extends Object
Utility class used to box primitive-types inside an array. Changes in the given array will be visible in the returned list, and vice versa. The list does not allow for structural modifications, meaning that it is not possible to change the size of the list.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<Boolean>
    asList(boolean modifiable, boolean... array)
    Returns a view on the given array, as a list of boxed Boolean Changes in the given array will be visible in the returned list, and vice versa.
    static List<Byte>
    asList(boolean modifiable, byte... array)
    Returns a view on the given array, as a list of boxed Long Changes in the given array will be visible in the returned list, and vice versa.
    static List<Character>
    asList(boolean modifiable, char... array)
    Returns a view on the given array, as a list of boxed Character Changes in the given array will be visible in the returned list, and vice versa.
    static List<Double>
    asList(boolean modifiable, double... array)
    Returns a view on the given array, as a list of boxed Float Changes in the given array will be visible in the returned list, and vice versa.
    static List<Float>
    asList(boolean modifiable, float... array)
    Returns a view on the given array, as a list of boxed Float Changes in the given array will be visible in the returned list, and vice versa.
    static List<Integer>
    asList(boolean modifiable, int... array)
    Returns a view on the given array, as a list of boxed Long Changes in the given array will be visible in the returned list, and vice versa.
    static List<Long>
    asList(boolean modifiable, long... array)
    Returns a view on the given array, as a list of boxed Long Changes in the given array will be visible in the returned list, and vice versa.
    static List<Short>
    asList(boolean modifiable, short... array)
    Returns a view on the given array, as a list of boxed Short Changes in the given array will be visible in the returned list, and vice versa.
    static List
    asList(boolean modifiable, Object primitiveArray)
    Returns a view on the given array of primitive-tyes, as a list of boxed primitive-types.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PrimitiveArray

      public PrimitiveArray()
  • Method Details

    • asList

      public static List asList(boolean modifiable, Object primitiveArray)
      Returns a view on the given array of primitive-tyes, as a list of boxed primitive-types. Changes in the given array will be visible in the returned list, and vice versa. The list does not allow for structural modifications, meaning that it is not possible to change the size of the list.
      Parameters:
      modifiable - true to obtain a modifiable list, false for an unomdifiable list
      primitiveArray - The primitive array. Only
      invalid reference
      int
      ,
      invalid reference
      long
      ,
      invalid reference
      float
      ,
      invalid reference
      double
      ,
      invalid reference
      char
      ,
      invalid reference
      boolean
      ,
      invalid reference
      short
      are accepted. The array cannot be null. If something is passed different thanan array of a primitive-type, than an assertion exception is thrown.
      Returns:
      The list view
    • asList

      public static List<Short> asList(boolean modifiable, short... array)
      Returns a view on the given array, as a list of boxed Short Changes in the given array will be visible in the returned list, and vice versa. The list does not allow for structural modifications, meaning that it is not possible to change the size of the list.
      Parameters:
      modifiable - true to obtain a modifiable list, false for an unomdifiable list
      array - The array
      Returns:
      The list view
    • asList

      public static List<Long> asList(boolean modifiable, long... array)
      Returns a view on the given array, as a list of boxed Long Changes in the given array will be visible in the returned list, and vice versa. The list does not allow for structural modifications, meaning that it is not possible to change the size of the list.
      Parameters:
      modifiable - true for obtaining a modifiable list, false for an unomdifiable list
      array - The array
      Returns:
      The list view
    • asList

      public static List<Integer> asList(boolean modifiable, int... array)
      Returns a view on the given array, as a list of boxed Long Changes in the given array will be visible in the returned list, and vice versa. The list does not allow for structural modifications, meaning that it is not possible to change the size of the list.
      Parameters:
      modifiable - true to obtain a modifiable list, false for an unomdifiable list
      array - The array
      Returns:
      The list view
    • asList

      public static List<Byte> asList(boolean modifiable, byte... array)
      Returns a view on the given array, as a list of boxed Long Changes in the given array will be visible in the returned list, and vice versa. The list does not allow for structural modifications, meaning that it is not possible to change the size of the list.
      Parameters:
      modifiable - true to obtain a modifiable list, false for an unomdifiable list
      array - The array
      Returns:
      The list view
    • asList

      public static List<Float> asList(boolean modifiable, float... array)
      Returns a view on the given array, as a list of boxed Float Changes in the given array will be visible in the returned list, and vice versa. The list does not allow for structural modifications, meaning that it is not possible to change the size of the list.
      Parameters:
      modifiable - true to obtain a modifiable list, false for an unomdifiable list
      array - The array
      Returns:
      The list view
    • asList

      public static List<Double> asList(boolean modifiable, double... array)
      Returns a view on the given array, as a list of boxed Float Changes in the given array will be visible in the returned list, and vice versa. The list does not allow for structural modifications, meaning that it is not possible to change the size of the list.
      Parameters:
      modifiable - true to obtain a modifiable list, false for an unomdifiable list
      array - The array
      Returns:
      The list view
    • asList

      public static List<Character> asList(boolean modifiable, char... array)
      Returns a view on the given array, as a list of boxed Character Changes in the given array will be visible in the returned list, and vice versa. The list does not allow for structural modifications, meaning that it is not possible to change the size of the list.
      Parameters:
      modifiable - true to obtain a modifiable list, false for an unomdifiable list
      array - The array
      Returns:
      The list view
    • asList

      public static List<Boolean> asList(boolean modifiable, boolean... array)
      Returns a view on the given array, as a list of boxed Boolean Changes in the given array will be visible in the returned list, and vice versa. The list does not allow for structural modifications, meaning that it is not possible to change the size of the list.
      Parameters:
      modifiable - true to obtain a modifiable list, false for an unomdifiable list
      array - The array
      Returns:
      The list view