rrdService.util
Class DataContainer

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--rrdService.util.DataContainer
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable

public class DataContainer
extends java.util.Vector

The class DataContainer allows to stock a list of data source

Version:
1.0 date : 15/07/2001
Author:
Damien Pellier
See Also:
DataContainer, Vector, Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData, serialVersionUID
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DataContainer()
          Constructs an empty DataContainer so that its internal data array has size 10 and its standard capacity increment is zero.
DataContainer(java.util.Collection c)
          Constructs a DataContainer containing the Data of the specified collection, in the order they are returned by the collection's iterator.
DataContainer(int initialCapacity)
          Constructs an empty DataContainer with the specified initial capacity and with its capacity increment equal to zero. param initialCapacity the initial capacity of the DataContainer.
DataContainer(int initialCapacity, int capacityIncrement)
          Constructs an empty DataContainer with the specified initial capacity and capacity increment.
 
Method Summary
 DataContainer cloneDataContainer()
          Returns a clone of this DataContainer. return DataContainer
 Data dataAt(int index)
          Returns the component at the specified index.
 Data firstData()
          Returns the first component (the item at index 0) of this DataContainer.
 Data getData(int index)
          Returns the Data at the specified position in this DataContainer.
 Data lastDatae()
          Returns the last component of the DataContainer.
 Data removeData(int index)
          Removes the Data at the specified position in this DataContainer.
 Data setData(int index, Data data)
          Replaces the Data at the specified position in this DataContainer with the specified Data.
 Data[] toDataArray()
          Returns an array containing all of the Data in this DataContainer in the correct order.
 Data[] toDataArray(Data[] a)
          Returns an array containing all of the Data in this DataContainer in the correct order.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, ensureCapacityHelper, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
, finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

DataContainer

public DataContainer()
Constructs an empty DataContainer so that its internal data array has size 10 and its standard capacity increment is zero.

DataContainer

public DataContainer(java.util.Collection c)
Constructs a DataContainer containing the Data of the specified collection, in the order they are returned by the collection's iterator.
Parameters:
c - the collection whose DataSources are to be placed into this DataContainer.

DataContainer

public DataContainer(int initialCapacity)
              throws java.lang.IllegalArgumentException
Constructs an empty DataContainer with the specified initial capacity and with its capacity increment equal to zero. param initialCapacity the initial capacity of the DataContainer.

DataContainer

public DataContainer(int initialCapacity,
                     int capacityIncrement)
              throws java.lang.IllegalArgumentException
Constructs an empty DataContainer with the specified initial capacity and capacity increment.
Parameters:
initialCapacity - the initial capacity of the DataContainer.
capacityIncrement - the amount by which the capacity is increased when the DataContainer overflows
Method Detail

cloneDataContainer

public DataContainer cloneDataContainer()
Returns a clone of this DataContainer. return DataContainer

dataAt

public Data dataAt(int index)
            throws java.lang.ArrayIndexOutOfBoundsException
Returns the component at the specified index.
Parameters:
index - an index into this DataContainer.
Returns:
Data

firstData

public Data firstData()
               throws java.util.NoSuchElementException
Returns the first component (the item at index 0) of this DataContainer.
Returns:
Data

getData

public Data getData(int index)
             throws java.lang.ArrayIndexOutOfBoundsException
Returns the Data at the specified position in this DataContainer.
Parameters:
index - index of Data to return.
Returns:
Data

lastDatae

public Data lastDatae()
               throws java.util.NoSuchElementException
Returns the last component of the DataContainer.
Returns:
Data

removeData

public Data removeData(int index)
                throws java.lang.ArrayIndexOutOfBoundsException
Removes the Data at the specified position in this DataContainer.
Parameters:
index - index of Data to remove
Returns:
Data

setData

public Data setData(int index,
                    Data data)
             throws java.lang.ArrayIndexOutOfBoundsException,
                    java.lang.IllegalArgumentException
Replaces the Data at the specified position in this DataContainer with the specified Data.
Parameters:
index - index of Data to replace.
data - the data to be stored at the specified position.
Returns:
Data

toDataArray

public Data[] toDataArray()
Returns an array containing all of the Data in this DataContainer in the correct order.
Returns:
Data

toDataArray

public Data[] toDataArray(Data[] a)
                   throws java.lang.ArrayStoreException
Returns an array containing all of the Data in this DataContainer in the correct order.
Parameters:
a - the array into which the Data of the DataContainer are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
Returns:
Data

Copyright 1885-2001 FIRMENICH SA, Geneva

Submit a bug or feature
Copyright 1885-2001 FIRMENICH SA, Geneva,
All Rights Reserved.