net.java.properties
Interface CollectionPropertyI<T>

All Superinterfaces:
PropertyI<java.util.Collection<T>>
All Known Subinterfaces:
ListPropertyI<T>
All Known Implementing Classes:
CollectionProperty, ListProperty

public interface CollectionPropertyI<T>
extends PropertyI<java.util.Collection<T>>

A property that holds a value that is a Collection. The interface denotes how to access the elements of that collection.

It is not defined if the collection itself can be null or if the elements can be null.


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.
 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.
 java.util.Iterator<T> iterator()
          Returns an iterator that iterates over this property's entries.
 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 interface net.java.properties.PropertyI
get, set
 

Method Detail

add

Result<T> add(T value)
Adds a value to the collection. Will throw a NullPointerException if the collection is null.

Parameters:
value - The value to add.
Returns:
The result for the add. Never null.

remove

Result<T> remove(T value)
Removes a value from the collection. Will throw a NullPointerException if the collection is null.

Parameters:
value - The value to remove.
Returns:
The result for the remove. Never null.

addAll

ResultList<T> addAll(java.util.Collection<? extends T> elements)
Adds a whole collection to this one.

This method iterates over the collection and adds with add(T)

Parameters:
elements - The collection which elements to add. Not null.
Returns:
All the results for the add. Never null.

removeAll

ResultList<T> removeAll()
Removes all elements in this property by iterating and removing. Will throw a NullPointerException if the collection is null.

Returns:
The results for all the removes. Never null.

contains

boolean contains(T value)
Returns if value is in this property collecion. Will throw a NullPointerException if the collection is null.

Parameters:
value - The value to check for. May be null.
Returns:
If value is in this property collecion. Never null.

containsAll

boolean containsAll(java.util.Collection<?> c)
Returns if all c elements is in this property collecion. Will throw a NullPointerException if the collection is null.

Parameters:
c - The collection containing the elements to check. Not null.
Returns:
If all c elements is in this property collecion. Never null.

iterator

java.util.Iterator<T> iterator()
Returns an iterator that iterates over this property's entries. Will throw a NullPointerException if the collection is null.

Returns:
An iterator that iterates over this property's entries. Never null.

size

int size()
Returns the number of elements in this property. Will throw a NullPointerException if the collection is null.

Returns:
The number of elements in this property.


Copyright © 2007 MiG InfoCom AB. All Rights Reserved.