|
Oracle Fusion Middleware Java API Reference for Oracle Real-Time Decisions 11g Release 1 (11.1.1) E17787-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
com.sigmadynamics.util.SDArray
com.sigmadynamics.sdo.support.SDChoiceArray
public class SDChoiceArray
Type safe implementation of resizable array containing elements of type Choice.
| Field Summary | |
|---|---|
protected Choice[] |
buf |
(package private) boolean |
needsRehashing |
(package private) java.util.HashSet<Choice> |
set |
| Fields inherited from class com.sigmadynamics.util.SDArray |
|---|
ALLOC_UNIT, DEFAULT_INITIAL_SIZE, size |
| Constructor Summary | |
|---|---|
SDChoiceArray()Constructs an empty array. |
|
SDChoiceArray(int capacity)Constructs an empty array with the specified initial capacity. |
|
| Method Summary | |
|---|---|
void |
add(Choice element)Appends the specified element to the end of this array. |
void |
add(ChoiceInterface element)Appends the specified ChoiceInterface to the end of this array. |
void |
addAll(ChoiceArrayInterface array)Appends all of the elements in the specified array to the end of this array. |
void |
addAll(SDChoiceArray array)Appends all of the elements in the specified array to the end of this array. |
int |
capacity()Returns buffer capacity. |
boolean |
contains(Choice element)Returns true if this array contains the specified element. |
boolean |
contains(ChoiceInterface val)Returns true if this array contains the specified element. |
boolean |
containsAll(ChoiceArrayInterface sdArr)Returns true if this array contains all elements of the specified array. |
boolean |
containsAll(SDChoiceArray elements)Returns true if this array contains all elements of the specified array. |
boolean |
containsAny(ChoiceArrayInterface sdArr)Returns true if this array contains any one of the elements of the specified array. |
boolean |
containsAny(SDChoiceArray elements)Returns true if this array contains any one of the elements of the specified array. |
protected void |
ensureCapacity(int capacity)Grows the internal buffer as needed to accomodate the specified number of elements. |
boolean |
equals(java.lang.Object anObject)Element by element comparison. |
void |
fill(Choice element)Replaces all elements of this array with the same value. |
void |
fill(int fromIndex, int toIndex, Choice element)Replaces a group of consequtive elements of this array with the same value. |
Choice |
get(int index)Returns the element at the specified position in this array. |
ChoiceInterface |
getChoiceInterface(int index)Returns the element at the specified position in this array. |
static int |
indexOf(Choice element, Choice[] array)Returns the index in an array of the first occurence of the specified element, or -1 if the array does not contain such element. |
void |
set(int index, Choice element)Replaces the element at the specified position in this array with the specified element. |
void |
setSize(int size)Adds or deletes elements at the end of the array. |
void |
sort()Sorts the array in ascending order. |
void |
sort(java.util.Comparator<Choice> c)Sorts the array of objects according to the order induced by the specified comparator. |
Choice[] |
toArray()Returns an array of Choice containing all elements of this one. |
void |
toArray(Choice[] array)Copies elements to a given array. |
java.lang.String |
toString()Returns a string representation of this array. |
void |
trimToSize()Removes any excess buffer capacity above the actual number of elements. |
| Methods inherited from class com.sigmadynamics.util.SDArray |
|---|
clear, isEmpty, rangeCheck, size |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.sigmadynamics.sdo.interfaces.client.ChoiceArrayInterface |
|---|
clear, size |
| Field Detail |
|---|
protected Choice[] buf
boolean needsRehashing
java.util.HashSet<Choice> set
| Constructor Detail |
|---|
public SDChoiceArray()
public SDChoiceArray(int capacity)
capacity - the initial capacity of the array.| Method Detail |
|---|
public int capacity()
capacity in class SDArraypublic Choice get(int index)
index - index of the element to return.
public void set(int index,
Choice element)
index - index of the element to replace.element - element to be stored at the specified position.public void add(Choice element)
element - element to be appended to this array.public void addAll(SDChoiceArray array)
array - array containing elements to be appended to this array.public void fill(Choice element)
element - element that replaces all elements of this array.
public void fill(int fromIndex,
int toIndex,
Choice element)
fromIndex, inclusive, and toIndex, exclusive.fromIndex - index of the first element to be replaced.toIndex - index after the last element to be replaced.element - element that replaces the elements from fromIndex to toIndex.public boolean contains(Choice element)
true if this array contains the specified element.element - element whose presence in this array is to be tested.true if the specified element is present; false otherwise.public boolean containsAll(SDChoiceArray elements)
true if this array contains all elements of the specified array.elements - elements whose presence in this array is to be tested.true if all specified elements is present in this array; false otherwise.public boolean containsAny(SDChoiceArray elements)
true if this array contains any one of the elements of the specified array.elements - elements whose presence in this array is to be tested.true if any specified elements are present in this array; false otherwise.public void sort()
java.lang.ClassCastException - if the array elements do not implement Comparable interface.Comparablepublic void sort(java.util.Comparator<Choice> c)
c - the comparator to determine the order of the array. A null value indicates that the natural ordering of the elements should be used.java.lang.ClassCastException - if the array contains elements that are not mutually comparable using the specified comparator.Comparatorpublic boolean equals(java.lang.Object anObject)
equals in class java.lang.ObjectanObject - an object to compare this array with.true if the arrays are equal, false otherwise.public Choice[] toArray()
Choice containing all elements of this one.Choice containing all elements of this one.public void toArray(Choice[] array)
array - the array to which the elements of this one are to be copied.java.lang.ArrayStoreException - if the runtime type of the supplied array is not a supertype of the runtime type of every element in this one.public void setSize(int size)
setSize in class SDArraysize - new number or elements.java.lang.IllegalArgumentException - if size < 0.public void trimToSize()
trimToSize in class SDArraypublic java.lang.String toString()
"[]"). Adjacent elements are separated by the characters ", " (comma and space). Elements are converted to strings by String.valueOf(Object).toString in class java.lang.Object
public static int indexOf(Choice element,
Choice[] array)
protected void ensureCapacity(int capacity)
ensureCapacity in class SDArraycapacity - number of elements to accomodate.public ChoiceInterface getChoiceInterface(int index)
getChoiceInterface in interface ChoiceArrayInterfaceindex - index of the element to return.public void add(ChoiceInterface element)
add in interface ChoiceArrayInterfaceelement - ChoiceInterface to be appended to this array.public void addAll(ChoiceArrayInterface array)
addAll in interface ChoiceArrayInterfacearray - ChoiceArrayInterface containing ChoiceInterface elements to be appended to this array.public boolean contains(ChoiceInterface val)
true if this array contains the specified element.contains in interface ChoiceArrayInterfaceval - element whose presence in this array is to be tested.true if the specified element is present; false otherwise.public boolean containsAll(ChoiceArrayInterface sdArr)
true if this array contains all elements of the specified array.containsAll in interface ChoiceArrayInterfacesdArr - elements whose presence in this array is to be tested.true if all specified elements is present in this array; false otherwise.public boolean containsAny(ChoiceArrayInterface sdArr)
true if this array contains any one of the elements of the specified array.containsAny in interface ChoiceArrayInterfacesdArr - elements whose presence in this array is to be tested.true if any specified elements are present in this array; false otherwise.
|
Oracle Fusion Middleware Java API Reference for Oracle Real-Time Decisions 11g Release 1 (11.1.1) E17787-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||