cds.util
Class VarArgs

java.lang.Object
  extended bycds.util.VarArgs

public class VarArgs
extends java.lang.Object

This class allows to manage variable length argument lists for methods. It mimics the vararg (or stdarg) mechanism of C/C++. It was originally linked with tapprintf (renamed CFormat at CDS).
Contains a List object and provides add() methods that return the object itself. The add() methods are special in that they return the object itself, allowing one to build up an arbitrary-length list in a single expression, e.g., as new Parameters(x).add(y).add(z). There are add() methods for all the primitive types, and for Object. Format.sprintf(format, parameters) treat this class specially -- it clears out the parameters list just before it returns. This allows a parameters variable to be reused.

Version:
V2.0 Jan 2004 adapted to CDS requirements
- clear returns CParams Copyright 1999,2000 Tony Plate
Author:
Tony Plate tplate@attglobal.net, Marc Wenger/CDS

Field Summary
(package private)  java.util.ArrayList list
           
 
Constructor Summary
VarArgs()
           
VarArgs(boolean x)
           
VarArgs(byte x)
           
VarArgs(char x)
           
VarArgs(double x)
           
VarArgs(float x)
           
VarArgs(int x)
           
VarArgs(long x)
           
VarArgs(java.lang.Object x)
           
VarArgs(short x)
           
 
Method Summary
 VarArgs add(boolean x)
           
 VarArgs add(byte x)
           
 VarArgs add(char x)
           
 VarArgs add(double x)
           
 VarArgs add(float x)
           
 VarArgs add(int x)
           
 VarArgs add(long x)
           
 VarArgs add(java.lang.Object x)
           
 VarArgs add(java.lang.Object[] anArray)
          Add the array as a single object.
 VarArgs add(short x)
           
 VarArgs addElts(java.util.List list)
          Add all of the elements in the list.
 VarArgs addElts(java.lang.Object[] anArray)
          Add all of the elements in the array.
 VarArgs clear()
           
 java.lang.Object get(int i)
           
 int indexOf(java.lang.Object obj)
           
 java.util.Iterator iterator()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

java.util.ArrayList list
Constructor Detail

VarArgs

public VarArgs()

VarArgs

public VarArgs(long x)

VarArgs

public VarArgs(int x)

VarArgs

public VarArgs(short x)

VarArgs

public VarArgs(byte x)

VarArgs

public VarArgs(boolean x)

VarArgs

public VarArgs(char x)

VarArgs

public VarArgs(double x)

VarArgs

public VarArgs(float x)

VarArgs

public VarArgs(java.lang.Object x)
Method Detail

addElts

public VarArgs addElts(java.lang.Object[] anArray)
Add all of the elements in the array. (The array is not added as a single object, but rather each object in the array is added to the list).

Parameters:
anArray - array of elements to add individually
Returns:
CParams object

addElts

public VarArgs addElts(java.util.List list)
Add all of the elements in the list. (The array is not added as a single object, but rather each object in the array is added to the list).

Parameters:
list - list of elements to add individually
Returns:
the CParams object

add

public VarArgs add(java.lang.Object[] anArray)
Add the array as a single object.

Parameters:
anArray - array to add as a single object
Returns:
the CParams object

add

public VarArgs add(long x)

add

public VarArgs add(int x)

add

public VarArgs add(short x)

add

public VarArgs add(byte x)

add

public VarArgs add(boolean x)

add

public VarArgs add(char x)

add

public VarArgs add(double x)

add

public VarArgs add(float x)

add

public VarArgs add(java.lang.Object x)

iterator

public java.util.Iterator iterator()

clear

public VarArgs clear()

indexOf

public int indexOf(java.lang.Object obj)

get

public java.lang.Object get(int i)

size

public int size()