|
||||||||||
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,
java.lang.Object element)
|
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
boolean |
addAll(int index,
java.util.Collection c)
|
void |
addFirst(java.lang.Object o)
Inserts the given element at the beginning of this list. |
void |
addLast(java.lang.Object o)
Appends the given element to the end of this list. |
void |
clear()
|
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection c)
|
boolean |
doRemove(int index)
remove an objecr from the list without retrieving the old value from the store |
boolean |
equals(java.lang.Object obj)
|
java.lang.Object |
get(int index)
|
java.lang.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 java.lang.Object |
getValue(StoreEntry item)
|
int |
hashCode()
|
int |
indexOf(java.lang.Object o)
|
protected IndexItem |
insert(int insertPos,
java.lang.Object value)
|
protected IndexItem |
internalAdd(int index,
java.lang.Object element)
|
protected StoreEntry |
internalAddFirst(java.lang.Object o)
|
protected StoreEntry |
internalAddLast(java.lang.Object o)
|
protected StoreEntry |
internalGet(int index)
|
protected IndexItem |
internalSet(int index,
java.lang.Object element)
|
boolean |
isEmpty()
|
protected void |
itemAdded(IndexItem item,
int pos,
java.lang.Object value)
|
protected void |
itemRemoved(int pos)
|
java.util.Iterator |
iterator()
|
int |
lastIndexOf(java.lang.Object o)
|
java.util.ListIterator |
listIterator()
|
java.util.ListIterator |
listIterator(int index)
|
void |
load()
The container is created or retrieved in an unloaded state. |
StoreEntry |
placeFirst(java.lang.Object object)
insert an Object in first position int the list but get a StoreEntry of its position |
StoreEntry |
placeLast(java.lang.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)
|
java.lang.Object |
remove(int index)
|
boolean |
remove(java.lang.Object o)
|
boolean |
remove(StoreEntry entry)
remove the Object at the StoreEntry |
boolean |
removeAll(java.util.Collection c)
|
java.lang.Object |
removeFirst()
Removes and returns the first element from this list. |
java.lang.Object |
removeLast()
Removes and returns the last element from this list. |
boolean |
retainAll(java.util.Collection c)
|
java.lang.Object |
set(int index,
java.lang.Object element)
|
void |
setMarshaller(Marshaller marshaller)
For homogenous containers can set a custom marshaller for loading values The default uses Object serialization |
int |
size()
|
java.util.List<java.lang.Object> |
subList(int fromIndex,
int toIndex)
|
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
java.lang.String |
toString()
|
void |
unload()
unload indexes from the container |
void |
update(StoreEntry entry,
java.lang.Object object)
Advanced feature = must ensure the object written doesn't overwrite other objects in the container |
protected IndexItem |
writeFirst(java.lang.Object value)
|
protected IndexItem |
writeLast(java.lang.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 java.io.IOException
java.io.IOException
Method Detail |
---|
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(java.lang.Object obj)
equals
in interface java.util.Collection
equals
in interface java.util.List
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Collection
hashCode
in interface java.util.List
hashCode
in class java.lang.Object
public int size()
size
in interface java.util.Collection
size
in interface java.util.List
size
in interface ListContainer
size
in class BaseContainerImpl
public void addFirst(java.lang.Object o)
ListContainer
addFirst
in interface ListContainer
o
- the element to be inserted at the beginning of this list.public void addLast(java.lang.Object o)
ListContainer
addLast
in interface ListContainer
o
- the element to be inserted at the end of this list.public java.lang.Object removeFirst()
ListContainer
removeFirst
in interface ListContainer
public java.lang.Object removeLast()
ListContainer
removeLast
in interface ListContainer
public boolean isEmpty()
isEmpty
in interface java.util.Collection
isEmpty
in interface java.util.List
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection
contains
in interface java.util.List
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.List
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
toArray
in interface java.util.List
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
toArray
in interface java.util.List
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
add
in interface java.util.List
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.List
protected void remove(IndexItem item)
remove
in class BaseContainerImpl
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
containsAll
in interface java.util.List
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
clear
in class BaseContainerImpl
public java.lang.Object get(int index)
get
in interface java.util.List
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
protected IndexItem internalSet(int index, java.lang.Object element)
public void add(int index, java.lang.Object element)
add
in interface java.util.List
protected StoreEntry internalAddLast(java.lang.Object o)
protected StoreEntry internalAddFirst(java.lang.Object o)
protected IndexItem internalAdd(int index, java.lang.Object element)
protected StoreEntry internalGet(int index)
public boolean doRemove(int index)
ListContainer
doRemove
in interface ListContainer
public java.lang.Object remove(int index)
remove
in interface java.util.List
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List
public java.util.ListIterator listIterator()
listIterator
in interface java.util.List
public java.util.ListIterator listIterator(int index)
listIterator
in interface java.util.List
public java.util.List<java.lang.Object> subList(int fromIndex, int toIndex)
subList
in interface java.util.List
public StoreEntry placeLast(java.lang.Object object)
placeLast
in interface ListContainer
object
-
public StoreEntry placeFirst(java.lang.Object object)
placeFirst
in interface ListContainer
object
-
public void update(StoreEntry entry, java.lang.Object object)
ListContainer
update
in interface ListContainer
entry
- object
- ListContainer.update(org.apache.activemq.kaha.StoreEntry,
java.lang.Object)
public java.lang.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 entry
protected IndexItem writeLast(java.lang.Object value)
protected IndexItem writeFirst(java.lang.Object value)
protected IndexItem insert(int insertPos, java.lang.Object value)
protected java.lang.Object getValue(StoreEntry item)
getValue
in class BaseContainerImpl
public java.lang.String toString()
toString
in class java.lang.Object
protected void itemAdded(IndexItem item, int pos, java.lang.Object value)
protected void itemRemoved(int pos)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |