Interface COM.odi.coll.Array
- public interface Array
- extends List
An array is an ordered collection that always allows duplicates
and might allow nulls.
The Array interface provides additional constructor
arguments and an additional method, which fills the slots
in the array.
The NewCollection method that creates an array always
specifies ALLOW_NULLS. To create an array that does not
allow nulls, you must create it with NewCollection. Then
use the getBehavior() and changeBehavior() methods to remove
the ALLOW_NULLS flag. For example:
Array array = NewCollection.createArray(placement);
array.changeBehavior(array.getBehavior() & ~ALLOW_NULLS);
(Dictionaries do not permit null values and you cannot use this
technique to get around that.)
- See Also:
- Collection, List
-
setCardinality(int, Object)
- Sets the cardinality to the specified value.
setCardinality
public abstract void setCardinality(int newCardinality,
Object fillValue)
- Sets the cardinality to the specified value.
The cardinality of an array is the number of items in the array.
If the new
cardinality is greater than the old cardinality, this method sets the new
elements to the specified object. For example, suppose the
array has seven elements, a,b,c,d,e,f,g. A call to
setCardinality(5, null) removes f and g.
A call to setCardinality(9, null) adds two elements at
the end of the array and makes them both null.
- Parameters:
- newCardinality - The new number of objects in the array.
- fillValue - The object to put into any new slots.
Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.