rrdService.util
Class DataSourceContainer

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

public class DataSourceContainer
extends java.util.Vector

The class DataSourceContainer allows to stock a list of data source

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

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData, serialVersionUID
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DataSourceContainer()
          Constructs an empty DataSourceContainer so that its internal data array has size 10 and its standard capacity increment is zero.
DataSourceContainer(java.util.Collection c)
          Constructs a DataSourceContainer containing the DataSource of the specified collection, in the order they are returned by the collection's iterator.
DataSourceContainer(int initialCapacity)
          Constructs an empty DataSourceContainer with the specified initial capacity and with its capacity increment equal to zero. param initialCapacity the initial capacity of the DataSourceContainer.
DataSourceContainer(int initialCapacity, int capacityIncrement)
          Constructs an empty DataSourceContainer with the specified initial capacity and capacity increment.
 
Method Summary
 DataSourceContainer cloneDataSourceContainer()
          Returns a clone of this DataSourceContainer. return DataSourceContainer
 DataSource dataSourceAt(int index)
          Returns the component at the specified index.
 DataSource firstDataSource()
          Returns the first component (the item at index 0) of this DataSourceContainer.
 DataSource getDataSource(int index)
          Returns the DataSource at the specified position in this DataSourceContainer.
 DataSource lastDataSource()
          Returns the last component of the DataSourceContainer.
 DataSource removeDataSource(int index)
          Removes the DataSource at the specified position in this DataSourceContainer.
 DataSource setDataSource(int index, DataSource lib)
          Replaces the DataSource at the specified position in this DataSourceContainer with the specified DataSource.
 DataSource[] toDataSourceArray()
          Returns an array containing all of the DataSource in this DataSourceContainer in the correct order.
 DataSource[] toDataSourceArray(DataSource[] a)
          Returns an array containing all of the DataSource in this DataSourceContainer in the correct order.
 java.lang.String toString()
          toString return a string representation of this DataSourceContainer
 
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, 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

DataSourceContainer

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

DataSourceContainer

public DataSourceContainer(java.util.Collection c)
Constructs a DataSourceContainer containing the DataSource 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 DataSourceContainer.

DataSourceContainer

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

DataSourceContainer

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

cloneDataSourceContainer

public DataSourceContainer cloneDataSourceContainer()
Returns a clone of this DataSourceContainer. return DataSourceContainer

dataSourceAt

public DataSource dataSourceAt(int index)
                        throws java.lang.ArrayIndexOutOfBoundsException
Returns the component at the specified index.
Parameters:
index - an index into this DataSourceContainer.
Returns:
DataSource

firstDataSource

public DataSource firstDataSource()
                           throws java.util.NoSuchElementException
Returns the first component (the item at index 0) of this DataSourceContainer.
Returns:
DataSource

getDataSource

public DataSource getDataSource(int index)
                         throws java.lang.ArrayIndexOutOfBoundsException
Returns the DataSource at the specified position in this DataSourceContainer.
Parameters:
index - index of DataSource to return.
Returns:
DataSource

lastDataSource

public DataSource lastDataSource()
                          throws java.util.NoSuchElementException
Returns the last component of the DataSourceContainer.
Returns:
DataSource

removeDataSource

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

setDataSource

public DataSource setDataSource(int index,
                                DataSource lib)
                         throws java.lang.ArrayIndexOutOfBoundsException,
                                java.lang.IllegalArgumentException
Replaces the DataSource at the specified position in this DataSourceContainer with the specified DataSource.
Parameters:
index - index of DataSource to replace.
lib - RoundRobinDataBase to be stored at the specified position.
Returns:
DataSource

toDataSourceArray

public DataSource[] toDataSourceArray()
Returns an array containing all of the DataSource in this DataSourceContainer in the correct order.
Returns:
DataSource

toDataSourceArray

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

toString

public java.lang.String toString()
toString return a string representation of this DataSourceContainer
Overrides:
toString in class java.util.Vector

Copyright 1885-2001 FIRMENICH SA, Geneva

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