public class ListContainerImpl extends BaseContainerImpl implements ListContainer
Modifier and Type | Field and Description |
---|---|
protected Marshaller |
marshaller |
closed, containerId, dataManager, indexList, indexManager, initialized, loaded, persistentIndex, root
Constructor and Description |
---|
ListContainerImpl(ContainerId id,
IndexItem root,
IndexManager indexManager,
DataManager dataManager,
boolean persistentIndex) |
Modifier and Type | Method and Description |
---|---|
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) |
checkClosed, close, delete, doClear, expressDataInterest, getContainerId, getDataManager, getId, getIndexManager, getInternalList, getList, init, isLoaded, isRoot, setList, storeIndex, updateIndexes
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, isLoaded
protected Marshaller marshaller
public ListContainerImpl(ContainerId id, IndexItem root, IndexManager indexManager, DataManager dataManager, boolean persistentIndex) throws IOException
IOException
public void load()
ListContainer
load
in interface ListContainer
load
in class BaseContainerImpl
public void unload()
ListContainer
unload
in interface ListContainer
unload
in class BaseContainerImpl
public void setMarshaller(Marshaller marshaller)
ListContainer
setMarshaller
in interface ListContainer
public boolean equals(Object obj)
public int hashCode()
public int size()
size
in interface Collection
size
in interface List
size
in interface ListContainer
size
in class BaseContainerImpl
public void addFirst(Object o)
ListContainer
addFirst
in interface ListContainer
o
- the element to be inserted at the beginning of this list.public void addLast(Object o)
ListContainer
addLast
in interface ListContainer
o
- the element to be inserted at the end of this list.public Object removeFirst()
ListContainer
removeFirst
in interface ListContainer
public Object removeLast()
ListContainer
removeLast
in interface ListContainer
public boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in interface List
public boolean contains(Object o)
contains
in interface Collection
contains
in interface List
public Iterator iterator()
public Object[] toArray()
toArray
in interface Collection
toArray
in interface List
public Object[] toArray(Object[] a)
toArray
in interface Collection
toArray
in interface List
public boolean add(Object o)
add
in interface Collection
add
in interface List
public boolean remove(Object o)
remove
in interface Collection
remove
in interface List
protected void remove(IndexItem item)
remove
in class BaseContainerImpl
public boolean containsAll(Collection c)
containsAll
in interface Collection
containsAll
in interface List
public boolean addAll(Collection c)
addAll
in interface Collection
addAll
in interface List
public boolean addAll(int index, Collection c)
public boolean removeAll(Collection c)
removeAll
in interface Collection
removeAll
in interface List
public boolean retainAll(Collection c)
retainAll
in interface Collection
retainAll
in interface List
public void clear()
clear
in interface Collection
clear
in interface List
clear
in class BaseContainerImpl
protected StoreEntry internalAddLast(Object o)
protected StoreEntry internalAddFirst(Object o)
protected StoreEntry internalGet(int index)
public boolean doRemove(int index)
ListContainer
doRemove
in interface ListContainer
public int lastIndexOf(Object o)
lastIndexOf
in interface List
public ListIterator listIterator()
listIterator
in interface List
public ListIterator listIterator(int index)
listIterator
in interface List
public StoreEntry placeLast(Object object)
placeLast
in interface ListContainer
object
- public StoreEntry placeFirst(Object object)
placeFirst
in interface ListContainer
object
- public void update(StoreEntry entry, Object object)
ListContainer
update
in interface ListContainer
entry
- object
- ListContainer.update(org.apache.activemq.kaha.StoreEntry,
java.lang.Object)
public Object get(StoreEntry entry)
get
in interface ListContainer
entry
- public boolean remove(StoreEntry entry)
remove
in interface ListContainer
entry
- public StoreEntry getFirst()
getFirst
in interface ListContainer
public StoreEntry getLast()
getLast
in interface ListContainer
public StoreEntry getNext(StoreEntry entry)
getNext
in interface ListContainer
entry
- public StoreEntry getPrevious(StoreEntry entry)
getPrevious
in interface ListContainer
entry
- public StoreEntry refresh(StoreEntry entry)
refresh
in interface ListContainer
entry
- old entryprotected Object getValue(StoreEntry item)
getValue
in class BaseContainerImpl
public String toString()
protected void itemRemoved(int pos)
Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.