ariba.ui.aribaweb.util
Class AWArrayManager

java.lang.Object
  extended by ariba.ui.aribaweb.util.AWBaseObject
      extended by ariba.ui.aribaweb.util.AWArrayManager
All Implemented Interfaces:
AWObject

public final class AWArrayManager
extends AWBaseObject

This class manages a one-dimensional java array and allows for easily adding to the array by managing resizing and by keeping track of how many elements are in the array. Any type of array can be managed, not just Object[] types.


Field Summary
 
Fields inherited from class ariba.ui.aribaweb.util.AWBaseObject
AribaHashtableClass, AribaVectorClass, ClassClass, EmptyHashtable, EmptyMap, EmptyVector, False, IntegerClass, JavaHashtableClass, JavaMapClass, JavaVectorClass, LogHandling, NullObject, ObjectClass, StringClass, True, UndefinedObject, UndefinedString, UninitializedRealNumber
 
Constructor Summary
AWArrayManager(java.lang.Class componentType)
           
AWArrayManager(java.lang.Class componentType, int capacity)
           
AWArrayManager(java.lang.Object array, int currentSize)
           
 
Method Summary
 void addElement(boolean value)
           
 void addElement(byte value)
           
 void addElement(char value)
           
 void addElement(double value)
           
 void addElement(float value)
           
 void addElement(int value)
           
 void addElement(long value)
           
 void addElement(java.lang.Object value)
           
 void addElement(short value)
           
 java.lang.Object array()
           
 int capacity()
           
 void clear()
           
 java.lang.Class componentType()
           
 void insertElementAt(int index, int intValue)
          Replaces the existing value at index with intValue.
 void insertElementAt(int index, java.lang.Object object)
           
 int[] intArray()
           
 int intAt(int index)
           
 boolean isEmpty()
           
 byte lastByte()
           
 java.lang.Object lastElement()
           
 int lastInt()
           
 java.lang.Object[] objectArray()
           
 java.lang.Object objectAt(int index)
           
 void printf(java.io.PrintStream printStream)
           
 void removeAllElements()
          Resets the size without decreasing the capacity If the componentType is Object or subclass, then sets all slots to null, otherwise leaves slots with existing values.
 void removeLast()
          Note: does NOT clear the value of the last element -- simply reduces the size.
 java.lang.Object removeLastElement()
           
 int removeLastInt()
           
 void reset()
          Use this instead of clear() when it doesn't matter if the contents are cleared out.
 int size()
           
 java.lang.String toString()
           
 java.lang.Object trimmedArrayCopy()
           
 
Methods inherited from class ariba.ui.aribaweb.util.AWBaseObject
debugString, ensureFieldValuesClear, getFieldValue, init, isKindOfClass, localizedJavaString, logString, logWarning, setFieldValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AWArrayManager

public AWArrayManager(java.lang.Object array,
                      int currentSize)

AWArrayManager

public AWArrayManager(java.lang.Class componentType,
                      int capacity)

AWArrayManager

public AWArrayManager(java.lang.Class componentType)
Method Detail

array

public java.lang.Object array()

intArray

public int[] intArray()

componentType

public java.lang.Class componentType()

capacity

public int capacity()

size

public int size()

clear

public void clear()

reset

public void reset()
Use this instead of clear() when it doesn't matter if the contents are cleared out.


addElement

public void addElement(java.lang.Object value)

addElement

public void addElement(boolean value)

addElement

public void addElement(byte value)

addElement

public void addElement(char value)

addElement

public void addElement(double value)

addElement

public void addElement(float value)

addElement

public void addElement(int value)

addElement

public void addElement(long value)

addElement

public void addElement(short value)

insertElementAt

public void insertElementAt(int index,
                            java.lang.Object object)

insertElementAt

public void insertElementAt(int index,
                            int intValue)
Replaces the existing value at index with intValue. Does NOT attempt to scoot things down. This may need to change in the future as this naming is a bit misleading.

Parameters:
intValue -
index -

objectAt

public java.lang.Object objectAt(int index)

intAt

public int intAt(int index)

isEmpty

public boolean isEmpty()

removeAllElements

public void removeAllElements()
Resets the size without decreasing the capacity If the componentType is Object or subclass, then sets all slots to null, otherwise leaves slots with existing values.


objectArray

public java.lang.Object[] objectArray()

lastElement

public java.lang.Object lastElement()

removeLastElement

public java.lang.Object removeLastElement()

lastInt

public int lastInt()

lastByte

public byte lastByte()

removeLastInt

public int removeLastInt()

removeLast

public void removeLast()
Note: does NOT clear the value of the last element -- simply reduces the size.


printf

public void printf(java.io.PrintStream printStream)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

trimmedArrayCopy

public java.lang.Object trimmedArrayCopy()


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.