Class intArrayContainer

java.lang.Object
hec.heclib.util.intArrayContainer
All Implemented Interfaces:
Serializable

public class intArrayContainer extends Object implements Serializable
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int[]
     
    int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    intArrayContainer(int numberElements)
     
    intArrayContainer(int[] values)
     
    intArrayContainer(int numberElements, int initialValue)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    boolean
    isDefined(intContainer elementNumber)
    Returns TRUE if any element is defined, and the element number of the first defined element.
    int
     
    int
    maximum(intContainer elementNumber)
     
    int
     
    int
    minimum(intContainer elementNumber)
     
    int
    resize(int numberElements)
    Resize the array.
    int
    resize(int numberElements, int beginningElement)
    Resize the array.
    int
    resize(int numberElements, int beginningElementOld, int beginningElementNew)
    Resize the array, while moving elements (a more complex resize) numberElements is the new size beginningElementOld is the position in the old array to start copying from beginningElementNew is the position in the new array to start copying to This function can be used to increase the size of the array (most common), or remove data from the beginning and end of the array.
    int
    setSize(int numberElements)
     
    void
    shiftLeft(int elementPosition)
     
    int
     
    int
    value(int elementNumber)
     

    Methods inherited from class java.lang.Object

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

    • array

      public int[] array
    • length

      public int length
  • Constructor Details

    • intArrayContainer

      public intArrayContainer()
    • intArrayContainer

      public intArrayContainer(int[] values)
    • intArrayContainer

      public intArrayContainer(int numberElements)
    • intArrayContainer

      public intArrayContainer(int numberElements, int initialValue)
  • Method Details

    • setSize

      public int setSize(int numberElements)
    • size

      public int size()
    • value

      public int value(int elementNumber)
    • resize

      public int resize(int numberElements)
      Resize the array. numberElements is the new size Removes elements from the end, or adds elements to the end Example: For an arrary of 3, then resize(5) resize(2) 10 --> 10 10 11 11 11 12 12 __ __
    • shiftLeft

      public void shiftLeft(int elementPosition)
    • resize

      public int resize(int numberElements, int beginningElement)
      Resize the array. numberElements is the new size beginningElement is where to start deleting elements from, if decreasing beginningElement is where to start adding (undefined) elements to, if increasing Example: For an arrary of 3, then resize(5,1) resize(2,1) 10 --> 10 10 11 __ 12 12 __ 11 12
    • resize

      public int resize(int numberElements, int beginningElementOld, int beginningElementNew)
      Resize the array, while moving elements (a more complex resize) numberElements is the new size beginningElementOld is the position in the old array to start copying from beginningElementNew is the position in the new array to start copying to This function can be used to increase the size of the array (most common), or remove data from the beginning and end of the array. Example: For an arrary of 3, then resize(5,1,2) resize(2,1,1) 10 --> __ __ 11 __ 11 12 11 12 __ Any new values are undefined.
    • maximum

      public int maximum(intContainer elementNumber)
    • minimum

      public int minimum(intContainer elementNumber)
    • minimum

      public int minimum()
    • maximum

      public int maximum()
    • isDefined

      public boolean isDefined(intContainer elementNumber)
      Returns TRUE if any element is defined, and the element number of the first defined element.
    • isDefined

      public boolean isDefined()