|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.activemq.kaha.impl.container.BaseContainerImpl
org.apache.activemq.kaha.impl.container.ListContainerImpl
public class ListContainerImpl
Implementation of a ListContainer
| Field Summary | |
|---|---|
protected Marshaller |
marshaller
|
| Fields inherited from class org.apache.activemq.kaha.impl.container.BaseContainerImpl |
|---|
closed, containerId, dataManager, indexList, indexManager, initialized, loaded, persistentIndex, root |
| Constructor Summary | |
|---|---|
ListContainerImpl(ContainerId id,
IndexItem root,
IndexManager indexManager,
DataManager dataManager,
boolean persistentIndex)
|
|
| Method Summary | |
|---|---|
void |
add(int index,
Object element)
|
boolean |
add(Object o)
|
boolean |
addAll(Collection c)
|
boolean |
addAll(int index,
Collection c)
|
void |
addFirst(Object o)
Inserts the given element at the beginning of this list. |
void |
addLast(Object o)
Appends the given element to the end of this list. |
void |
clear()
|
boolean |
contains(Object o)
|
boolean |
containsAll(Collection c)
|
boolean |
doRemove(int index)
remove an objecr from the list without retrieving the old value from the store |
boolean |
equals(Object obj)
|
Object |
get(int index)
|
Object |
get(StoreEntry entry)
Retrieve an Object from the Store by its location |
StoreEntry |
getFirst()
Get the StoreEntry for the first item of the list |
StoreEntry |
getLast()
Get the StoreEntry for the last item of the list |
StoreEntry |
getNext(StoreEntry entry)
Get the next StoreEntry from the list |
StoreEntry |
getPrevious(StoreEntry entry)
Get the previous StoreEntry from the list |
protected Object |
getValue(StoreEntry item)
|
int |
hashCode()
|
int |
indexOf(Object o)
|
protected IndexItem |
insert(int insertPos,
Object value)
|
protected IndexItem |
internalAdd(int index,
Object element)
|
protected StoreEntry |
internalAddFirst(Object o)
|
protected StoreEntry |
internalAddLast(Object o)
|
protected StoreEntry |
internalGet(int index)
|
protected IndexItem |
internalSet(int index,
Object element)
|
boolean |
isEmpty()
|
protected void |
itemAdded(IndexItem item,
int pos,
Object value)
|
protected void |
itemRemoved(int pos)
|
Iterator |
iterator()
|
int |
lastIndexOf(Object o)
|
ListIterator |
listIterator()
|
ListIterator |
listIterator(int index)
|
void |
load()
The container is created or retrieved in an unloaded state. |
StoreEntry |
placeFirst(Object object)
insert an Object in first position int the list but get a StoreEntry of its position |
StoreEntry |
placeLast(Object object)
add an Object to the list but get a StoreEntry of its position |
StoreEntry |
refresh(StoreEntry entry)
It's possible that a StoreEntry could be come stale this will return an upto date entry for the StoreEntry position |
protected void |
remove(IndexItem item)
|
Object |
remove(int index)
|
boolean |
remove(Object o)
|
boolean |
remove(StoreEntry entry)
remove the Object at the StoreEntry |
boolean |
removeAll(Collection c)
|
Object |
removeFirst()
Removes and returns the first element from this list. |
Object |
removeLast()
Removes and returns the last element from this list. |
boolean |
retainAll(Collection c)
|
Object |
set(int index,
Object element)
|
void |
setMarshaller(Marshaller marshaller)
For homogenous containers can set a custom marshaller for loading values The default uses Object serialization |
int |
size()
|
List<Object> |
subList(int fromIndex,
int toIndex)
|
Object[] |
toArray()
|
Object[] |
toArray(Object[] a)
|
String |
toString()
|
void |
unload()
unload indexes from the container |
void |
update(StoreEntry entry,
Object object)
Advanced feature = must ensure the object written doesn't overwrite other objects in the container |
protected IndexItem |
writeFirst(Object value)
|
protected IndexItem |
writeLast(Object value)
|
| Methods inherited from class org.apache.activemq.kaha.impl.container.BaseContainerImpl |
|---|
checkClosed, close, delete, doClear, expressDataInterest, getContainerId, getDataManager, getId, getIndexManager, getInternalList, getList, init, isLoaded, isRoot, setList, storeIndex, updateIndexes |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.activemq.kaha.ListContainer |
|---|
getId, isLoaded |
| Field Detail |
|---|
protected Marshaller marshaller
| Constructor Detail |
|---|
public ListContainerImpl(ContainerId id,
IndexItem root,
IndexManager indexManager,
DataManager dataManager,
boolean persistentIndex)
throws IOException
IOException| Method Detail |
|---|
public void load()
ListContainer
load in interface ListContainerload in class BaseContainerImplpublic void unload()
ListContainer
unload in interface ListContainerunload in class BaseContainerImplpublic void setMarshaller(Marshaller marshaller)
ListContainer
setMarshaller in interface ListContainerpublic boolean equals(Object obj)
equals in interface Collectionequals in interface Listequals in class Objectpublic int hashCode()
hashCode in interface CollectionhashCode in interface ListhashCode in class Objectpublic int size()
size in interface Collectionsize in interface Listsize in interface ListContainersize in class BaseContainerImplpublic void addFirst(Object o)
ListContainer
addFirst in interface ListContainero - the element to be inserted at the beginning of this list.public void addLast(Object o)
ListContainer
addLast in interface ListContainero - the element to be inserted at the end of this list.public Object removeFirst()
ListContainer
removeFirst in interface ListContainerpublic Object removeLast()
ListContainer
removeLast in interface ListContainerpublic boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface Listpublic boolean contains(Object o)
contains in interface Collectioncontains in interface Listpublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Listpublic Object[] toArray()
toArray in interface CollectiontoArray in interface Listpublic Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface Listpublic boolean add(Object o)
add in interface Collectionadd in interface Listpublic boolean remove(Object o)
remove in interface Collectionremove in interface Listprotected void remove(IndexItem item)
remove in class BaseContainerImplpublic boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface Listpublic boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface List
public boolean addAll(int index,
Collection c)
addAll in interface Listpublic boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface Listpublic boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface Listpublic void clear()
clear in interface Collectionclear in interface Listclear in class BaseContainerImplpublic Object get(int index)
get in interface List
public Object set(int index,
Object element)
set in interface List
protected IndexItem internalSet(int index,
Object element)
public void add(int index,
Object element)
add in interface Listprotected StoreEntry internalAddLast(Object o)
protected StoreEntry internalAddFirst(Object o)
protected IndexItem internalAdd(int index,
Object element)
protected StoreEntry internalGet(int index)
public boolean doRemove(int index)
ListContainer
doRemove in interface ListContainerpublic Object remove(int index)
remove in interface Listpublic int indexOf(Object o)
indexOf in interface Listpublic int lastIndexOf(Object o)
lastIndexOf in interface Listpublic ListIterator listIterator()
listIterator in interface Listpublic ListIterator listIterator(int index)
listIterator in interface List
public List<Object> subList(int fromIndex,
int toIndex)
subList in interface Listpublic StoreEntry placeLast(Object object)
placeLast in interface ListContainerobject -
public StoreEntry placeFirst(Object object)
placeFirst in interface ListContainerobject -
public void update(StoreEntry entry,
Object object)
ListContainer
update in interface ListContainerentry - object - ListContainer.update(org.apache.activemq.kaha.StoreEntry,
java.lang.Object)public Object get(StoreEntry entry)
get in interface ListContainerentry -
public boolean remove(StoreEntry entry)
remove in interface ListContainerentry -
public StoreEntry getFirst()
getFirst in interface ListContainerpublic StoreEntry getLast()
getLast in interface ListContainerpublic StoreEntry getNext(StoreEntry entry)
getNext in interface ListContainerentry -
public StoreEntry getPrevious(StoreEntry entry)
getPrevious in interface ListContainerentry -
public StoreEntry refresh(StoreEntry entry)
refresh in interface ListContainerentry - old entry
protected IndexItem writeLast(Object value)
protected IndexItem writeFirst(Object value)
protected IndexItem insert(int insertPos,
Object value)
protected Object getValue(StoreEntry item)
getValue in class BaseContainerImplpublic String toString()
toString in class Object
protected void itemAdded(IndexItem item,
int pos,
Object value)
protected void itemRemoved(int pos)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||