com.wewebu.ow.server.ecm
Class OwObjectCollectionDelegator

java.lang.Object
  extended by com.wewebu.ow.server.ecm.OwObjectCollectionDelegator
All Implemented Interfaces:
OwObjectCollection, OwAttributeBag, Iterable, Collection, List
Direct Known Subclasses:
OwQueriedCollection

public class OwObjectCollectionDelegator
extends Object
implements OwObjectCollection

An object list wrapper/delegate class. Delegates all behavior to the inner delegate. Subclasses can override certain object list methods thus lists can have their behavior "decorated".

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com

Since:
2.5.3.1

Field Summary
 
Fields inherited from interface com.wewebu.ow.server.ecm.OwObjectCollection
ATTRIBUTE_IS_COMPLETE, ATTRIBUTE_SIZE, ATTRIBUTE_SQL
 
Constructor Summary
OwObjectCollectionDelegator(OwObjectCollection delegateeCollection_p)
          Constructor
 
Method Summary
 void add(int index_p, Object element_p)
           
 boolean add(Object o_p)
           
 boolean addAll(Collection c_p)
           
 boolean addAll(int index_p, Collection c_p)
           
 int attributecount()
          get the number of attributes, or -1 if unknown
 void clear()
           
 boolean contains(Object o_p)
           
 boolean containsAll(Collection c_p)
           
 boolean equals(Object o_p)
           
 Object get(int index_p)
           
 Object getAttribute(int index_p)
          get a object at the specified index or throws OwObjectNotFoundException
 Object getAttribute(String strName_p)
          get the attribute with the given name or throws OwObjectNotFoundException
 Collection getAttributeNames()
          get all attribute names in the bag
 void getNext()
          retrieve further objects, than currently added.
 void getPrev()
          retrieve further objects, than currently added.
 Object getSafeAttribute(String strName_p, Object default_p)
          get the attribute with the given name, returns default if not found.
 boolean hasAttribute(String strName_p)
          check if attribute exists
 int hashCode()
           
 boolean hasNext()
          check if object list has access to more next objects, than currently added.
 boolean hasPrev()
          check if object list has access to more previous objects, than currently added.
 int indexOf(Object o_p)
           
 boolean isComplete()
          check if object list has retrieved all objects If false, there are more objects available, but it is not guaranteed that you can retrieve them with the next / prev functions.
 boolean isEmpty()
           
 Iterator iterator()
           
 int lastIndexOf(Object o_p)
           
 ListIterator listIterator()
           
 ListIterator listIterator(int index_p)
           
 Object remove(int index_p)
           
 boolean remove(Object o_p)
           
 boolean removeAll(Collection c_p)
           
protected  void replaceDelegatee(OwObjectCollection objectCollection_p)
           
 boolean retainAll(Collection c_p)
           
 Object set(int index_p, Object element_p)
           
 int size()
           
 void sort(OwSort sortCriteria_p)
          sort the list by the given criteria.
 List subList(int fromIndex_p, int toIndex_p)
           
 Object[] toArray()
           
 Object[] toArray(Object[] a_p)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OwObjectCollectionDelegator

public OwObjectCollectionDelegator(OwObjectCollection delegateeCollection_p)
Constructor

Parameters:
delegateeCollection_p -
Method Detail

replaceDelegatee

protected void replaceDelegatee(OwObjectCollection objectCollection_p)
Parameters:
objectCollection_p - the collection to replace the inner delegate with

add

public void add(int index_p,
                Object element_p)
Specified by:
add in interface List

add

public boolean add(Object o_p)
Specified by:
add in interface Collection
Specified by:
add in interface List

addAll

public boolean addAll(Collection c_p)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface List

addAll

public boolean addAll(int index_p,
                      Collection c_p)
Specified by:
addAll in interface List

attributecount

public int attributecount()
Description copied from interface: OwAttributeBag
get the number of attributes, or -1 if unknown

Specified by:
attributecount in interface OwAttributeBag

clear

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

contains

public boolean contains(Object o_p)
Specified by:
contains in interface Collection
Specified by:
contains in interface List

containsAll

public boolean containsAll(Collection c_p)
Specified by:
containsAll in interface Collection
Specified by:
containsAll in interface List

equals

public boolean equals(Object o_p)
Specified by:
equals in interface Collection
Specified by:
equals in interface List
Overrides:
equals in class Object

get

public Object get(int index_p)
Specified by:
get in interface List

getAttribute

public Object getAttribute(int index_p)
                    throws Exception
Description copied from interface: OwAttributeBag
get a object at the specified index or throws OwObjectNotFoundException

Specified by:
getAttribute in interface OwAttributeBag
Parameters:
index_p - int index
Returns:
Object
Throws:
Exception

getAttribute

public Object getAttribute(String strName_p)
                    throws Exception
Description copied from interface: OwAttributeBag
get the attribute with the given name or throws OwObjectNotFoundException

Specified by:
getAttribute in interface OwAttributeBag
Throws:
Exception

getAttributeNames

public Collection getAttributeNames()
Description copied from interface: OwAttributeBag
get all attribute names in the bag

Specified by:
getAttributeNames in interface OwAttributeBag

getNext

public void getNext()
             throws Exception
Description copied from interface: OwObjectCollection
retrieve further objects, than currently added. I.e. submit another SQL Query and obtain more objects from the ECM System. NOTE: The retrieved objects will replace the current objects in the list

Specified by:
getNext in interface OwObjectCollection
Throws:
Exception

getPrev

public void getPrev()
             throws Exception
Description copied from interface: OwObjectCollection
retrieve further objects, than currently added. I.e. submit another SQL Query and obtain more objects from the ECM System. NOTE: The retrieved objects will replace the current objects in the list

Specified by:
getPrev in interface OwObjectCollection
Throws:
Exception

getSafeAttribute

public Object getSafeAttribute(String strName_p,
                               Object default_p)
Description copied from interface: OwAttributeBag
get the attribute with the given name, returns default if not found.

Specified by:
getSafeAttribute in interface OwAttributeBag

hasAttribute

public boolean hasAttribute(String strName_p)
Description copied from interface: OwAttributeBag
check if attribute exists

Specified by:
hasAttribute in interface OwAttributeBag

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Specified by:
hashCode in interface List
Overrides:
hashCode in class Object

hasNext

public boolean hasNext()
                throws Exception
Description copied from interface: OwObjectCollection
check if object list has access to more next objects, than currently added. I.e. if it could do another SQL Query and obtain more objects from the ECM System.

Specified by:
hasNext in interface OwObjectCollection
Returns:
boolean true = there are more objects available, call getNext() to retrieve additional objects.
Throws:
Exception

hasPrev

public boolean hasPrev()
                throws Exception
Description copied from interface: OwObjectCollection
check if object list has access to more previous objects, than currently added. I.e. if it could do another SQL Query and obtain more objects from the ECM System.

Specified by:
hasPrev in interface OwObjectCollection
Returns:
boolean true = there are more objects available, call getPrev() to retrieve additional objects.
Throws:
Exception

indexOf

public int indexOf(Object o_p)
Specified by:
indexOf in interface List

isComplete

public boolean isComplete()
                   throws Exception
Description copied from interface: OwObjectCollection
check if object list has retrieved all objects If false, there are more objects available, but it is not guaranteed that you can retrieve them with the next / prev functions. I.e. hasNext / Prev might still return false.

Specified by:
isComplete in interface OwObjectCollection
Returns:
boolean true = all available objects have been added to the list
Throws:
Exception

isEmpty

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

iterator

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

lastIndexOf

public int lastIndexOf(Object o_p)
Specified by:
lastIndexOf in interface List

listIterator

public ListIterator listIterator()
Specified by:
listIterator in interface List

listIterator

public ListIterator listIterator(int index_p)
Specified by:
listIterator in interface List

remove

public Object remove(int index_p)
Specified by:
remove in interface List

remove

public boolean remove(Object o_p)
Specified by:
remove in interface Collection
Specified by:
remove in interface List

removeAll

public boolean removeAll(Collection c_p)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface List

retainAll

public boolean retainAll(Collection c_p)
Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface List

set

public Object set(int index_p,
                  Object element_p)
Specified by:
set in interface List

size

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

sort

public void sort(OwSort sortCriteria_p)
          throws Exception
Description copied from interface: OwObjectCollection
sort the list by the given criteria. The default implementation sorts on the cached objects in the application server. The function may be overloaded to sort by the ECM System with SQL sort statements.

Specified by:
sort in interface OwObjectCollection
Parameters:
sortCriteria_p - list of sort criteria
Throws:
Exception

subList

public List subList(int fromIndex_p,
                    int toIndex_p)
Specified by:
subList in interface List

toArray

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

toArray

public Object[] toArray(Object[] a_p)
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.