|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.util.WeightedList<E>
public class WeightedList<E>
Like a list but stores elements in the order specified by the weight. For example if you add(a, .5) and add(b,.3) the iterator() will return b then a.
Constructor Summary | |
---|---|
WeightedList() |
|
WeightedList(int initialCapacity) |
Method Summary | |
---|---|
boolean |
add(E e) |
void |
add(E e, double weight) Adds e after the last existing entry that has a weight equal or higher than weight . |
boolean |
addAll(java.util.Collection<? extends E> c) |
void |
addFirst(E e, double weight) Adds e before the first existing entry that has a weight equal or higher than weight . |
void |
addLast(E e, double weight) Adds e after the last existing entry that has a weight equal or higher than weight . |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
E |
get(int index) |
int |
indexOf(java.lang.Object e) |
boolean |
isEmpty() |
java.util.Iterator<E> |
iterator() |
boolean |
remove(java.lang.Object object) Removes the first entry that is equal to object |
boolean |
remove(java.lang.Object object, double weight) Removes the first entry that is equal to object and has the specified weight. |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection c) |
int |
size() |
java.lang.Object[] |
toArray() |
java.lang.Object[] |
toArray(java.lang.Object[] a) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
equals, hashCode |
Constructor Detail |
---|
public WeightedList()
public WeightedList(int initialCapacity)
Method Detail |
---|
public void add(E e, double weight)
e
after the last existing entry that has a weight equal or higher than weight
. This method is equivalent to addLast(E, double)
e
- The entry to addweight
- The entry weightpublic void addFirst(E e, double weight)
e
before the first existing entry that has a weight equal or higher than weight
.e
- The entry to addweight
- The entry weightpublic void addLast(E e, double weight)
e
after the last existing entry that has a weight equal or higher than weight
.e
- The entry to addweight
- The entry weightpublic boolean remove(java.lang.Object object)
object
remove
in interface java.util.Collection<E>
object
- the object to removepublic boolean remove(java.lang.Object object, double weight)
object
and has the specified weight.object
- the object to removeweight
- the corresponding weightpublic java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
iterator
in interface java.util.Collection<E>
public E get(int index)
public int size()
size
in interface java.util.Collection<E>
public void clear()
clear
in interface java.util.Collection<E>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<E>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<E>
public boolean add(E e)
add
in interface java.util.Collection<E>
public int indexOf(java.lang.Object e)
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<E>
public boolean addAll(java.util.Collection<? extends E> c)
addAll
in interface java.util.Collection<E>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<E>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<E>
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection<E>
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection<E>
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |