ariba.ui.aribaweb.util
Class AWArrayManager
java.lang.Object
ariba.ui.aribaweb.util.AWBaseObject
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.
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 |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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)
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.