|
||||||||||
| 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>
com.miginfocom.property.ListProperty<T>
public class ListProperty<T>
| Field Summary |
|---|
| Fields inherited from class com.miginfocom.property.Property |
|---|
UNINITIALIZED |
| Constructor Summary | |
|---|---|
ListProperty()
Constructor to create a property that is initialized. |
|
ListProperty(java.util.List<T> cols)
Constructor. |
|
ListProperty(T... values)
Constructor. |
|
| Method Summary | |
|---|---|
Result<T> |
add(T value,
int ix)
Adds an element at specified index in the list. |
protected java.util.List<T> |
create()
Creates the list. |
T |
get(int ix)
Returns the element at the specified index. |
protected java.util.List<T> |
makeUnmodifiable(java.util.Collection<T> value)
Makes the value unmodifiable, usually by wrapping it. |
Result<T> |
removeIndex(int ix)
Removed the element at the specified index in the list. |
Result<T> |
set(T value,
int ix)
Sets (exchanges) an element at specified index in the list. |
| Methods inherited from class com.miginfocom.property.CollectionProperty |
|---|
add, addAll, checkModifyAccess, contains, containsAll, iterator, remove, removeAll, size |
| 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.CollectionPropertyI |
|---|
add, addAll, contains, containsAll, iterator, remove, removeAll, size |
| Methods inherited from interface net.java.properties.PropertyI |
|---|
get, set |
| Constructor Detail |
|---|
public ListProperty()
public ListProperty(java.util.List<T> cols)
cols - The initial collection. NOTE! The reference will be used as the backing collection and
will not be cloned! May be null.public ListProperty(T... values)
values - The initial collection. Will be cloned and changes to the array will not be reflected in this
property.| Method Detail |
|---|
protected java.util.List<T> create()
create in class CollectionProperty<T>ArrayList of default size.protected java.util.List<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 CollectionProperty<T>value - The value. May be null in which canse null should be returned.
public T get(int ix)
ListPropertyI
get in interface ListPropertyI<T>ix - The index for which to return the element. If >= size or < 0 an IndexOutOfBoundsException will be thrown.
ix.
public Result<T> set(T value,
int ix)
ListPropertyI
set in interface ListPropertyI<T>value - The value to set.ix - The index for which to set the element. If >= size or < 0 an IndexOutOfBoundsException will be thrown.
public Result<T> add(T value,
int ix)
ListPropertyI
add in interface ListPropertyI<T>value - The value to add.ix - The index that the index will be added at. If > size or < 0 an IndexOutOfBoundsException will be thrown.
If ix == size the value will be added last in the list.
public Result<T> removeIndex(int ix)
ListPropertyI
removeIndex in interface ListPropertyI<T>ix - The index for which the element should be removed. If > size or < 0 an IndexOutOfBoundsException will be thrown.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||