Class BeanItemContainer<BEANTYPE>

Type Parameters:
BEANTYPE - The type of the Bean
All Implemented Interfaces:
Container, Container.Filterable, Container.Indexed, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeNotifier, Container.SimpleFilterable, Container.Sortable, Property.ValueChangeListener, Serializable

public class BeanItemContainer<BEANTYPE> extends AbstractBeanContainer<BEANTYPE,BEANTYPE>
An in-memory container for JavaBeans.

The properties of the container are determined automatically by introspecting the used JavaBean class. Only beans of the same type can be added to the container.

BeanItemContainer uses the beans themselves as identifiers. The Object.hashCode() of a bean is used when storing and looking up beans so it must not change during the lifetime of the bean (it should not depend on any part of the bean that can be modified). Typically this restricts the implementation of Object.equals(Object) as well in order for it to fulfill the contract between equals() and hashCode().

To add items to the container, use the methods addBean(Object), AbstractBeanContainer.addBeanAfter(Object, Object) and AbstractBeanContainer.addBeanAt(int, Object). Also addItem(Object), addItemAfter(Object, Object) and addItemAt(int, Object) can be used as synonyms for them.

It is not possible to add additional properties to the container.

Since:
5.4
See Also: