org.silverpeas.attachment.util
Class SimpleDocumentList<SIMPLE_DOCUMENT extends SimpleDocument>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<SIMPLE_DOCUMENT>
              extended by org.silverpeas.attachment.util.SimpleDocumentList<SIMPLE_DOCUMENT>
Type Parameters:
SIMPLE_DOCUMENT - the type of simple document that the list contains.
All Implemented Interfaces:
Serializable, Cloneable, Iterable<SIMPLE_DOCUMENT>, Collection<SIMPLE_DOCUMENT>, List<SIMPLE_DOCUMENT>, RandomAccess

public class SimpleDocumentList<SIMPLE_DOCUMENT extends SimpleDocument>
extends ArrayList<SIMPLE_DOCUMENT>

This list provides some additional useful behaviors around simple documents.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SimpleDocumentList()
           
SimpleDocumentList(Collection<? extends SIMPLE_DOCUMENT> c)
           
SimpleDocumentList(int initialCapacity)
           
 
Method Summary
 String getQueryLanguage()
          Gets the language used to perform the JCR query in order to load the current list.
 SimpleDocumentList<SIMPLE_DOCUMENT> orderByLanguageAndLastUpdate(String... languageOrderedByPriority)
          Orders the list by descending priority of the language and descending last update date.
 SimpleDocumentList<SIMPLE_DOCUMENT> removeLanguageFallbacks()
          Removes from the current list all documents which content is in an other language than the one returned by getQueryLanguage().
 SimpleDocumentList<SIMPLE_DOCUMENT> setQueryLanguage(String queryLanguage)
          Sets the language used to perform the JCR query in order to load the current list.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

SimpleDocumentList

public SimpleDocumentList(int initialCapacity)

SimpleDocumentList

public SimpleDocumentList()

SimpleDocumentList

public SimpleDocumentList(Collection<? extends SIMPLE_DOCUMENT> c)
Method Detail

getQueryLanguage

public String getQueryLanguage()
Gets the language used to perform the JCR query in order to load the current list.

Returns:
the language is defined, null value otherwise.

setQueryLanguage

public SimpleDocumentList<SIMPLE_DOCUMENT> setQueryLanguage(String queryLanguage)
Sets the language used to perform the JCR query in order to load the current list.

Parameters:
queryLanguage - the language used to perform the JCR query in order to load the list.
Returns:
itself.

removeLanguageFallbacks

public SimpleDocumentList<SIMPLE_DOCUMENT> removeLanguageFallbacks()
Removes from the current list all documents which content is in an other language than the one returned by getQueryLanguage(). If getQueryLanguage() returns null or an unknown languague, nothing is done.

Returns:
itself.

orderByLanguageAndLastUpdate

public SimpleDocumentList<SIMPLE_DOCUMENT> orderByLanguageAndLastUpdate(String... languageOrderedByPriority)
Orders the list by descending priority of the language and descending last update date. By default, if no language priority is given, then the language priority of the platform is taken into account. If a language priority is specified, then the language priorities of the platform are overridden.

Parameters:
languageOrderedByPriority - manual language priority definition ​​from the highest to the lowest.
Returns:
itself.


Copyright © 2016 Silverpeas. All Rights Reserved.