|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.salespointframework.core.data.PersistentList<E>
E
- generic type of itemspublic class PersistentList<E>
A PersistentList
represents a List
which persists its items via PersistenceManager
's listing methods.
This lists need a unique id which is composed of host
and id
This list doesn't provide an order, so you should not use get(int)
and remove(int)
methods.
make sure that all objects you store in it, are persistable by PersistenceManager.persist(Object)
items in this list are cached for performance reasons.
most methods are thread safe.
Field Summary | |
---|---|
static long |
DEFAULT_CACHE_LIFETIME
the default cache life time |
Constructor Summary | |
---|---|
PersistentList(java.lang.Object host,
java.lang.String id,
java.lang.Class oc,
java.lang.Object recoveryContext)
constructor |
|
PersistentList(java.lang.Object host,
java.lang.String id,
java.lang.Class oc,
java.lang.Object respectKey,
java.lang.Class contextMap,
java.lang.Class kc,
java.lang.Object recoveryContext,
PersistentMap map)
constructor. |
|
PersistentList(java.lang.String id,
java.lang.Class oc)
default constructor because of a java language weakness you need to pass the type of generic argument explicitly |
Method Summary | ||
---|---|---|
boolean |
add(E e)
|
|
void |
add(int index,
E element)
|
|
boolean |
addAll(java.util.Collection<? extends E> c)
|
|
boolean |
addAll(int index,
java.util.Collection<? extends E> c)
this method is not implemented |
|
boolean |
addExternalModificationListener(ExternalModificationListener eml)
add a ExternalModificationListener |
|
void |
clear()
|
|
boolean |
contains(java.lang.Object o)
|
|
boolean |
containsAll(java.util.Collection<?> c)
this method is not implemented |
|
void |
DatasourceChanged(boolean pumpUp)
invalidate caches, when datasource changed. and pump up the event |
|
void |
DatasourceOnChange()
pump up the datasource on change event |
|
void |
externalModificationOccurred()
invalidate caches and pump up the event |
|
E |
get(int index)
|
|
java.lang.Object |
getHost()
get host |
|
java.lang.String |
getId()
get id |
|
java.lang.String |
getListId()
get encoded list id |
|
java.lang.String |
getListId(boolean raw)
get list id |
|
java.lang.Object |
getLock()
get lock |
|
int |
indexOf(java.lang.Object o)
|
|
void |
invalidateCache()
invalidate caches |
|
boolean |
isEmpty()
|
|
java.util.Iterator<E> |
iterator()
|
|
int |
lastIndexOf(java.lang.Object o)
this method is not implemented |
|
java.util.ListIterator<E> |
listIterator()
this method is not implemented |
|
java.util.ListIterator<E> |
listIterator(int index)
this method is not implemented |
|
E |
remove(int index)
|
|
boolean |
remove(java.lang.Object o)
|
|
boolean |
removeAll(java.util.Collection<?> c)
this method is not implemented |
|
void |
removeExternalModificationListener(ExternalModificationListener eml)
remove ExternalModificationListener |
|
boolean |
retainAll(java.util.Collection<?> c)
this method is not implemented |
|
E |
set(int index,
E element)
|
|
void |
setCacheLifetime(long cacheLifetime)
set cacheLifetime |
|
int |
size()
|
|
java.util.List<E> |
subList(int fromIndex,
int toIndex)
this method is not implemented |
|
java.lang.Object[] |
toArray()
|
|
|
toArray(T[] a)
this method is not implemented |
|
void |
unsubscribe()
unsubscribe listeners from PersistenceManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
equals, hashCode |
Field Detail |
---|
public static long DEFAULT_CACHE_LIFETIME
Constructor Detail |
---|
public PersistentList(java.lang.String id, java.lang.Class oc)
id
- id
oc
- oc
public PersistentList(java.lang.Object host, java.lang.String id, java.lang.Class oc, java.lang.Object recoveryContext)
host
- host
id
- id
oc
- oc
recoveryContext
- recoveryContext
public PersistentList(java.lang.Object host, java.lang.String id, java.lang.Class oc, java.lang.Object respectKey, java.lang.Class contextMap, java.lang.Class kc, java.lang.Object recoveryContext, PersistentMap map)
host
- host
id
- id
oc
- oc
respectKey
- respectKey
contextMap
- c
kc
- kc
recoveryContext
- recoveryContext
map
- map
Method Detail |
---|
public java.lang.Object getLock()
lock
public java.lang.String getId()
id
public java.lang.Object getHost()
host
public void setCacheLifetime(long cacheLifetime)
cacheLifetime
cacheLifetime
- public void unsubscribe()
PersistenceManager
public java.lang.String getListId()
public java.lang.String getListId(boolean raw)
raw
- true, if id should not be encoded
public void invalidateCache()
public boolean add(E e)
add
in interface java.util.Collection<E>
add
in interface java.util.List<E>
List.add(Object)
public void add(int index, E element)
add
in interface java.util.List<E>
List.add(int, Object)
public boolean addAll(java.util.Collection<? extends E> c)
addAll
in interface java.util.Collection<E>
addAll
in interface java.util.List<E>
List.addAll(Collection)
public boolean addAll(int index, java.util.Collection<? extends E> c)
addAll
in interface java.util.List<E>
public void clear()
clear
in interface java.util.Collection<E>
clear
in interface java.util.List<E>
List.clear()
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<E>
contains
in interface java.util.List<E>
List.contains(Object)
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<E>
containsAll
in interface java.util.List<E>
public E get(int index)
get
in interface java.util.List<E>
List.get(int)
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<E>
List.indexOf(Object)
public boolean isEmpty()
isEmpty
in interface java.util.Collection<E>
isEmpty
in interface java.util.List<E>
List.isEmpty()
public java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
iterator
in interface java.util.Collection<E>
iterator
in interface java.util.List<E>
List.iterator()
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<E>
public java.util.ListIterator<E> listIterator()
listIterator
in interface java.util.List<E>
public java.util.ListIterator<E> listIterator(int index)
listIterator
in interface java.util.List<E>
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<E>
remove
in interface java.util.List<E>
List.remove(Object)
public E remove(int index)
remove
in interface java.util.List<E>
List.remove(int)
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<E>
removeAll
in interface java.util.List<E>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<E>
retainAll
in interface java.util.List<E>
public E set(int index, E element)
set
in interface java.util.List<E>
List.set(int, Object)
public int size()
size
in interface java.util.Collection<E>
size
in interface java.util.List<E>
List.size()
public java.util.List<E> subList(int fromIndex, int toIndex)
subList
in interface java.util.List<E>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<E>
toArray
in interface java.util.List<E>
List.toArray()
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<E>
toArray
in interface java.util.List<E>
public void DatasourceOnChange()
DatasourceOnChange
in interface DatasourceOnChangeListener
public void DatasourceChanged(boolean pumpUp)
DatasourceChanged
in interface DatasourceChangeListener
pumpUp
- true if the event should be pumped up to hosts, because this event is mostly triggered twice.
first time to invalidate caches. second time for load new datapublic boolean addExternalModificationListener(ExternalModificationListener eml)
ExternalModificationListener
eml
- the listener
public void removeExternalModificationListener(ExternalModificationListener eml)
ExternalModificationListener
eml
- the listener to removepublic void externalModificationOccurred()
externalModificationOccurred
in interface ExternalModificationListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |