Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.api.repository.cache
Class CachingDocumentList

java.lang.Object
  extended by org.nuxeo.ecm.core.api.repository.cache.CachingDocumentList
All Implemented Interfaces:
Serializable, Iterable<DocumentModel>, Collection<DocumentModel>, List<DocumentModel>, DocumentModelList

public class CachingDocumentList
extends Object
implements DocumentModelList

A document list that uses document cached from the document cache. This is not using the children cache. If you need to cache getChildren calls it is better to use the DocumentChildrenList which is caching children lists

Author:
Bogdan Stefanescu
See Also:
Serialized Form

Constructor Summary
CachingDocumentList(DocumentModelCache cache, List<DocumentModel> list)
           
 
Method Summary
 boolean add(DocumentModel o)
           
 void add(int index, DocumentModel element)
           
 boolean addAll(Collection<? extends DocumentModel> c)
           
 boolean addAll(int index, Collection<? extends DocumentModel> c)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 DocumentModel get(int index)
           
 int indexOf(Object o)
           
 boolean isEmpty()
           
 Iterator<DocumentModel> iterator()
           
 int lastIndexOf(Object o)
           
 ListIterator<DocumentModel> listIterator()
           
 ListIterator<DocumentModel> listIterator(int index)
           
 DocumentModel remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 DocumentModel set(int index, DocumentModel element)
           
 int size()
           
 List<DocumentModel> subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 long totalSize()
          Returns the total size of the bigger list this is a part of.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 

Constructor Detail

CachingDocumentList

public CachingDocumentList(DocumentModelCache cache,
                           List<DocumentModel> list)
Method Detail

add

public boolean add(DocumentModel o)
Specified by:
add in interface Collection<DocumentModel>
Specified by:
add in interface List<DocumentModel>

add

public void add(int index,
                DocumentModel element)
Specified by:
add in interface List<DocumentModel>

addAll

public boolean addAll(Collection<? extends DocumentModel> c)
Specified by:
addAll in interface Collection<DocumentModel>
Specified by:
addAll in interface List<DocumentModel>

addAll

public boolean addAll(int index,
                      Collection<? extends DocumentModel> c)
Specified by:
addAll in interface List<DocumentModel>

clear

public void clear()
Specified by:
clear in interface Collection<DocumentModel>
Specified by:
clear in interface List<DocumentModel>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<DocumentModel>
Specified by:
contains in interface List<DocumentModel>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<DocumentModel>
Specified by:
containsAll in interface List<DocumentModel>

get

public DocumentModel get(int index)
Specified by:
get in interface List<DocumentModel>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<DocumentModel>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<DocumentModel>
Specified by:
isEmpty in interface List<DocumentModel>

iterator

public Iterator<DocumentModel> iterator()
Specified by:
iterator in interface Iterable<DocumentModel>
Specified by:
iterator in interface Collection<DocumentModel>
Specified by:
iterator in interface List<DocumentModel>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<DocumentModel>

listIterator

public ListIterator<DocumentModel> listIterator()
Specified by:
listIterator in interface List<DocumentModel>

listIterator

public ListIterator<DocumentModel> listIterator(int index)
Specified by:
listIterator in interface List<DocumentModel>

remove

public DocumentModel remove(int index)
Specified by:
remove in interface List<DocumentModel>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<DocumentModel>
Specified by:
remove in interface List<DocumentModel>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<DocumentModel>
Specified by:
removeAll in interface List<DocumentModel>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<DocumentModel>
Specified by:
retainAll in interface List<DocumentModel>

set

public DocumentModel set(int index,
                         DocumentModel element)
Specified by:
set in interface List<DocumentModel>

size

public int size()
Specified by:
size in interface Collection<DocumentModel>
Specified by:
size in interface List<DocumentModel>

totalSize

public long totalSize()
Description copied from interface: DocumentModelList
Returns the total size of the bigger list this is a part of.

Specified by:
totalSize in interface DocumentModelList
Returns:
the total size

subList

public List<DocumentModel> subList(int fromIndex,
                                   int toIndex)
Specified by:
subList in interface List<DocumentModel>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<DocumentModel>
Specified by:
toArray in interface List<DocumentModel>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<DocumentModel>
Specified by:
toArray in interface List<DocumentModel>

Nuxeo Enterprise Platform 5.4

Copyright © 2011 Nuxeo SAS. All Rights Reserved.