Class ListAccessor<E>

java.lang.Object
one.microstream.collections.ListAccessor<E>
All Implemented Interfaces:
Iterable<E>, CapacityCarrying, ExtendedBag<E>, ExtendedCollection<E>, ExtendedList<E>, ExtendedSequence<E>, ReleasingCollection<E>, Sized, Sortable<E>, XGettingBag<E>, XGettingCollection<E>, XGettingList<E>, XGettingSequence<E>, XIndexIterable<E>, XIterable<E>, XJoinable<E>, XOrderingSequence<E>, XReplacingBag<E>, XReplacingCollection<E>, XSettingList<E>, XSettingSequence<E>, XSortableSequence<E>, Copyable

public class ListAccessor<E>
extends Object
implements XSettingList<E>
Wrapper class that reduces the services provided by any wrapped XSettingList to only those ofXSettingList, effectively making the wrapped XSettingList instance structural unmodifiable if used through an instance of this class.

All methods declared in XSettingList are transparently passed to the wrapped list.
All structural modifying methods declared in Collection and List(all variations of add~(), remove~() and retain~() as well as clear()) immediately throw an UnsupportedOperationException when called.

This concept can be very useful if a class wants to provide public read and write access to an internal list without either the danger of the list being structurally modified from the outside or the need to copy the whole list on every access.

This is one of many useful concepts that are missing in the JDK Collections Framework and thus so far lead to either inefficient or unneccessary verbose program code (or both).