Documentation of 'visad.util.FloatTupleArrayImpl' Java class
FloatTupleArrayImpl
visad.util

Class FloatTupleArrayImpl

  • All Implemented Interfaces:
    FloatTupleArray


    public class FloatTupleArrayImpl
    extends java.lang.Object
    implements FloatTupleArray
    Growable array of float tuples.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static float DEF_GROW_FACTOR
      Factor by which the arrays are grown when they run out of space.
    • Constructor Summary

      Constructors 
      Constructor and Description
      FloatTupleArrayImpl(int dim, int initialSize) 
      FloatTupleArrayImpl(int dim, int initialSize, float growFactor)
      Construct an instance of initialSize.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(float[][] values)
      Add values.
      void add(float[][] values, int start, int num)
      Add values.
      int dim()
      Get the dimension of the tuple.
      float[][] elements()
      Reference to the backing data array.
      float[] get(int idx)
      Get a tuple.
      float get(int i, int j)
      Get a value.
      void set(int i, int j, float val)
      Set a value.
      int size()
      Get the size of the valid data.
      float[][] toArray()
      Get contained data as array.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEF_GROW_FACTOR

        public static final float DEF_GROW_FACTOR
        Factor by which the arrays are grown when they run out of space.
        See Also:
        Constant Field Values
    • Constructor Detail

      • FloatTupleArrayImpl

        public FloatTupleArrayImpl(int dim,
                                   int initialSize)
      • FloatTupleArrayImpl

        public FloatTupleArrayImpl(int dim,
                                   int initialSize,
                                   float growFactor)
        Construct an instance of initialSize.
        Parameters:
        dim - The tuple dimension.
        initialSize - The initial size of the internal array.
        growFactor - Factor to grow by when resizing is necessary.
    • Method Detail

      • add

        public void add(float[][] values,
                        int start,
                        int num)
        Add values. If there is not enough space for the number of values to be added the array is continually grown until there is room.
        Specified by:
        add in interface FloatTupleArray
        Parameters:
        values - Source array.
        start - index in the source array to start at
        num - number of values to add.
      • elements

        public float[][] elements()
        Reference to the backing data array. Any changes made to this array will be reflected in the actual data.
        Specified by:
        elements in interface FloatTupleArray
        Returns:
        This may return a reference or copy depending on the implementation.
      • add

        public void add(float[][] values)
        Add values. If there is not enough space for the number of values to be added the array is continually grown until there is room.
        Specified by:
        add in interface FloatTupleArray
        Parameters:
        values - Source array.
      • set

        public void set(int i,
                        int j,
                        float val)
        Set a value.
        Specified by:
        set in interface FloatTupleArray
        Parameters:
        i - dimension index of the values to set
        j - tuple index of the value to set
        val - the value
      • get

        public float[] get(int idx)
        Get a tuple.
        Parameters:
        idx - The index of the tuple
        Returns:
        an array of the tuple values at the provided index.
      • get

        public float get(int i,
                         int j)
        Get a value.
        Specified by:
        get in interface FloatTupleArray
        Parameters:
        i - dimension index
        j - tuple index.
        Returns:
        The value for tuple i at tuple index j.
      • toArray

        public float[][] toArray()
        Get contained data as array. The size of the array is exactly the size of the data.

        NOTE: This is an expensive operation.

        Specified by:
        toArray in interface FloatTupleArray
        Returns:
        A copy of the array data.
      • size

        public int size()
        Get the size of the valid data.
        Specified by:
        size in interface FloatTupleArray
        Returns:
        size of array
      • dim

        public int dim()
        Get the dimension of the tuple.
        Specified by:
        dim in interface FloatTupleArray
        Returns:
        The array tuple dimension

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.