org.jscience.physics.fluids.dynamics.util
Class VectorFastInt

java.lang.Object
  extended by org.jscience.physics.fluids.dynamics.util.VectorFastInt

public class VectorFastInt
extends java.lang.Object

DOCUMENT ME!


Constructor Summary
VectorFastInt()
          constructor by default
VectorFastInt(int initialSize, int incr)
          constructor
 
Method Summary
 void addElement(int value)
          add an element.
 void addElementNoRep(int value)
          add an element only if not contained yet.
 int[] array()
          returns the data contained in the container as an array of int's.
 int elementAt(int i)
          returns the element at the given position
 int[] getTruncatedArray()
          returns the data contained in the container as an array of int's with the exact size.
 boolean isElement(int value)
          returns true if the element is contained in the container.
 void reset()
          Empty the vector quickly, but keeping the memory RAM.
 int size()
          returns the number of stored elements.
 void sortArray(int tipo)
          Sorts the elements of the array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorFastInt

public VectorFastInt()
constructor by default


VectorFastInt

public VectorFastInt(int initialSize,
                     int incr)
constructor

Parameters:
initialSize - DOCUMENT ME!
incr - DOCUMENT ME!
Method Detail

addElement

public void addElement(int value)
add an element.

Parameters:
value - DOCUMENT ME!

addElementNoRep

public void addElementNoRep(int value)
add an element only if not contained yet.

Parameters:
value - DOCUMENT ME!

array

public int[] array()
returns the data contained in the container as an array of int's.

Returns:
DOCUMENT ME!

elementAt

public int elementAt(int i)
returns the element at the given position

Parameters:
i - DOCUMENT ME!
Returns:
DOCUMENT ME!

getTruncatedArray

public int[] getTruncatedArray()
returns the data contained in the container as an array of int's with the exact size.

Returns:
DOCUMENT ME!

sortArray

public void sortArray(int tipo)
Sorts the elements of the array.

Parameters:
tipo - 1 for going from lower to bigger, -1 for going from bigger to lower.

isElement

public boolean isElement(int value)
returns true if the element is contained in the container.

Parameters:
value - DOCUMENT ME!
Returns:
DOCUMENT ME!

reset

public void reset()
Empty the vector quickly, but keeping the memory RAM. This method es useful to reuse the array without freeing it and reserving another.


size

public int size()
returns the number of stored elements.

Returns:
DOCUMENT ME!