Diamond Control Suite 3.0

diamondedge.util
Class VbCollection

java.lang.Object
  extended by diamondedge.util.VbCollection

public class VbCollection
extends Object


Field Summary
static int AFTER
           
static int BEFORE
           
 
Constructor Summary
VbCollection()
           
 
Method Summary
 void add(Object val)
          Adds a value to the end of the collection with a default key.
 void add(Object val, String key)
          Adds a value to the end of the collection with a given key.
 void add(Object val, String key, int index, int beforeOrAfter)
          Adds a value to the collection with a given key at the position specified by relativeKey and beforeOrAfter.
 void add(Object val, String key, String relativeKey, int beforeOrAfter)
          Adds a value to the collection with a given key at the position specified by relativeKey and beforeOrAfter.
 void changeKey(String key, String newkey)
           
 void clear()
           
 boolean containsKey(Object key)
          Returns true if this map contains a mapping for the specified key.
 boolean containsValue(Object value)
          Returns true if this map maps one or more keys to the specified value.
 int getCount()
           
 int getIndex(String key)
          return 1-based index for key
 Variant getItem(int index)
          Returns the value at the specified position in this list.
 Variant getItem(String key)
          Returns the value to which this collection maps the specified key.
 Variant getItem(Variant indexOrKey)
          Returns the value at the specified position in this list or the value mapped to the specified key.
 String getKey(int index)
          return key for 1-based index.
 String getNextKey()
           
 void remove(int index)
           
 void remove(String key)
           
 void remove(Variant indexOrKey)
           
 void setKey(int index, String newkey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEFORE

public static final int BEFORE
See Also:
Constant Field Values

AFTER

public static final int AFTER
See Also:
Constant Field Values
Constructor Detail

VbCollection

public VbCollection()
Method Detail

getItem

public Variant getItem(int index)
Returns the value at the specified position in this list. index - An expression that specifies the position of a member of the collection. index must be a number from 1 to the value of the collection's Count property.

Throws:
ArrayIndexOutOfBoundsException - - if index is not valid

getItem

public Variant getItem(String key)
Returns the value to which this collection maps the specified key. key - An expression that specifies the position of a member of the collection. It must correspond to the key argument specified when the member referred to was added to the collection

Throws:
IndexOutOfBoundsException - - if key does not exist

getItem

public Variant getItem(Variant indexOrKey)
Returns the value at the specified position in this list or the value mapped to the specified key. indexOrKey - An expression that specifies the position of a member of the collection. If a numeric expression, index must be a number from 1 to the value of the collection's Count property. If a string expression, indexOrKey must correspond to the key argument specified when the member referred to was added to the collection

Throws:
IndexOutOfBoundsException - - if index or key is not valid

getCount

public int getCount()

add

public void add(Object val)
         throws RuntimeException
Adds a value to the end of the collection with a default key.

Throws:
RuntimeException

add

public void add(Object val,
                String key)
         throws RuntimeException
Adds a value to the end of the collection with a given key.

Throws:
RuntimeException

add

public void add(Object val,
                String key,
                String relativeKey,
                int beforeOrAfter)
         throws IndexOutOfBoundsException
Adds a value to the collection with a given key at the position specified by relativeKey and beforeOrAfter.

Parameters:
val - value to be added
key - the key that can be used to lookup this value
relativeKey - the key to another member of the collection used to specify where to put the new value
beforeOrAfter - One of: BEFORE or AFTER that in conjunction with relativeKey specifies the position of the new value to be inserted
Throws:
IndexOutOfBoundsException

add

public void add(Object val,
                String key,
                int index,
                int beforeOrAfter)
         throws IndexOutOfBoundsException,
                RuntimeException
Adds a value to the collection with a given key at the position specified by relativeKey and beforeOrAfter.

Parameters:
val - value to be added
key - the key that can be used to lookup this value
index - the index to another member of the collection used to specify where to put the new value
beforeOrAfter - One of: BEFORE or AFTER that in conjunction with relativeKey specifies the position of the new value to be inserted
Throws:
IndexOutOfBoundsException
RuntimeException

remove

public void remove(int index)

remove

public void remove(String key)

remove

public void remove(Variant indexOrKey)

clear

public void clear()

getIndex

public int getIndex(String key)
return 1-based index for key


getKey

public String getKey(int index)
return key for 1-based index. The keys returned will always be in lower case.


setKey

public void setKey(int index,
                   String newkey)

changeKey

public void changeKey(String key,
                      String newkey)

getNextKey

public String getNextKey()

containsKey

public boolean containsKey(Object key)
Returns true if this map contains a mapping for the specified key.


containsValue

public boolean containsValue(Object value)
Returns true if this map maps one or more keys to the specified value.


Diamond Control Suite 3.0

Diamond Edge and Diamond Control Suite are trademarks or registered trademarks of Diamond Edge, Inc. Copyright 1999-2005 Diamond Edge, Inc. All Rights Reserved.