|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.miginfocom.property.Property<java.util.Collection<T>>
com.miginfocom.property.CollectionProperty<T>
public class CollectionProperty<T>
| Field Summary |
|---|
| Fields inherited from class com.miginfocom.property.Property |
|---|
UNINITIALIZED |
| Constructor Summary | |
|---|---|
CollectionProperty()
Constructor for creating a lazy-initialized collection. |
|
CollectionProperty(java.util.Collection<T> col)
Constructor. |
|
CollectionProperty(T... values)
Constructor. |
|
| Method Summary | |
|---|---|
Result<T> |
add(T value)
Adds a value to the collection. |
ResultList<T> |
addAll(java.util.Collection<? extends T> elements)
Adds a whole collection to this one. |
protected void |
checkModifyAccess()
|
boolean |
contains(T value)
Returns if value is in this property collecion. |
boolean |
containsAll(java.util.Collection<?> c)
Returns if all c elements is in this property collecion. |
protected java.util.Collection<T> |
create()
Creates the collection. |
PropertyIterator<T> |
iterator()
Returns an iterator that iterates over this property's entries. |
protected java.util.Collection<T> |
makeUnmodifiable(java.util.Collection<T> value)
Makes the value unmodifiable, usually by wrapping it. |
Result<T> |
remove(T value)
Removes a value from the collection. |
ResultList<T> |
removeAll()
Removes all elements in this property by iterating and removing. |
int |
size()
Returns the number of elements in this property. |
| Methods inherited from class com.miginfocom.property.Property |
|---|
addPropertyListener, addPropertyListener, checkInit, cloneObject, createInfo, get, getBean, getInfo, getInternal, getName, init, initNotify, isNull, removePropertyListener, set, setInternal, toString, writeReplace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.java.properties.PropertyI |
|---|
get, set |
| Constructor Detail |
|---|
public CollectionProperty()
create() will be called
when the first real need for a collection object comes unless 'nullable' is true and 'lazy' is false
in which case a NullPointerException will be thrown.
public CollectionProperty(java.util.Collection<T> col)
col - The initial collection. NOTE! The reference will be used as the backing collection and
will not be cloned! May be null which is the same as calling the empty argument constructor.public CollectionProperty(T... values)
create().
values - The initial collection. Will be cloned and changes to the array will not be reflected in this
property. May be null which is the same as calling the empty argument constructor.| Method Detail |
|---|
protected java.util.Collection<T> create()
create in class Property<java.util.Collection<T>>ArrayList of default size.protected java.util.Collection<T> makeUnmodifiable(java.util.Collection<T> value)
PropertyTransfer.UNMODIFIABLE. Should be overridden by collection and map properties to wrap. Other property
type can also overrider this to make the value unmidifiable.
makeUnmodifiable in class Property<java.util.Collection<T>>value - The value. May be null in which canse null should be returned.
public Result<T> add(T value)
CollectionPropertyINullPointerException if the collection
is null.
add in interface CollectionPropertyI<T>value - The value to add.
null.public ResultList<T> addAll(java.util.Collection<? extends T> elements)
CollectionPropertyI
This method iterates over the collection and adds with CollectionPropertyI.add(T)
addAll in interface CollectionPropertyI<T>elements - The collection which elements to add. Not null.
null.public Result<T> remove(T value)
CollectionPropertyINullPointerException if the collection
is null.
remove in interface CollectionPropertyI<T>value - The value to remove.
null.public ResultList<T> removeAll()
CollectionPropertyINullPointerException if the collection
is null.
removeAll in interface CollectionPropertyI<T>null.public boolean contains(T value)
CollectionPropertyIvalue is in this property collecion. Will throw a NullPointerException if the collection
is null.
contains in interface CollectionPropertyI<T>value - The value to check for. May be null.
value is in this property collecion. Never null.public boolean containsAll(java.util.Collection<?> c)
CollectionPropertyIc elements is in this property collecion. Will throw a NullPointerException if the collection
is null.
containsAll in interface CollectionPropertyI<T>c - The collection containing the elements to check. Not null.
c elements is in this property collecion. Never null.public PropertyIterator<T> iterator()
CollectionPropertyINullPointerException if the collection
is null.
iterator in interface java.lang.Iterable<T>iterator in interface CollectionPropertyI<T>null.public int size()
CollectionPropertyINullPointerException if the collection
is null.
size in interface CollectionPropertyI<T>protected final void checkModifyAccess()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||