Java Doc for LinkedList.java in  » Database-ORM » JPOX » org » jpox » sco » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » JPOX » org.jpox.sco 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.util.LinkedList
   org.jpox.sco.LinkedList

LinkedList
public class LinkedList extends java.util.LinkedList implements SCOList,Cloneable,Queryable(Code)
A mutable second-class LinkedList object. This class extends LinkedList, using that class to contain the current objects, and the backing ListStore to be the interface to the datastore. A "backing store" is not present for datastores that dont use DatastoreClass, or if the container is serialised or non-persistent.

Modes of Operation

The user can operate the list in 2 modes. The cached mode will use an internal cache of the elements (in the "delegate") reading them at the first opportunity and then using the cache thereafter. The non-cached mode will just go direct to the "backing store" each call.

Mutators

When the "backing store" is present any updates are passed direct to the datastore as well as to the "delegate". If the "backing store" isn't present the changes are made to the "delegate" only.

Accessors

When any accessor method is invoked, it typically checks whether the container has been loaded from its "backing store" (where present) and does this as necessary. Some methods (size()) just check if everything is loaded and use the delegate if possible, otherwise going direct to the datastore.
version:
   $Revision: 1.93 $


Field Summary
final protected static  LocaliserLOCALISER
    
protected  booleanisCacheLoaded
     Status flag whether the collection is loaded into the cache.
 booleanqueued
     Whether the SCO is in "direct" or "queued" mode.
protected  booleanuseCache
     Whether to use "delegate" caching.

Constructor Summary
public  LinkedList(StateManager ownerSM, String fieldName)
     Constructor, using the StateManager of the "owner" and the field name.

Method Summary
public  voidadd(int index, Object element)
     Method to add an element to a position in the LinkedList.
public  booleanadd(Object element)
     Method to add an element to the LinkedList.
public  booleanaddAll(Collection elements)
     Method to add a Collection to the LinkedList.
public  booleanaddAll(int index, Collection elements)
     Method to add a Collection to a position in the LinkedList.
public  voidaddFirst(Object element)
     Method to add an element as first in the LinkedList.
public  voidaddLast(Object element)
     Method to add an element as last in the LinkedList.
protected  voidaddQueuedOperation(QueuedOperation op)
     Convenience method to add a queued operation to the operations we perform at commit.
public  voidattachCopy(Object value)
     Method to return an attached copy of the passed (detached) value.
public synchronized  voidclear()
     Method to clear the LinkedList.
public  Objectclone()
     Clone operator to return a copy of this object.

Mutable second-class Objects are required to provide a public clone method in order to allow for copying PersistenceCapable objects.

public  booleancontains(Object element)
     Method to return if the list contains this element.
public synchronized  booleancontainsAll(java.util.Collection c)
     Accessor for whether a collection of elements are contained here.
Parameters:
  c - The collection of elements.
public  ObjectdetachCopy(FetchPlanState state)
     Method to return a detached copy of the container.
public synchronized  booleanequals(Object o)
     Equality operator.
Parameters:
  o - The object to compare against.
public  voidflush()
     Method to flush the changes to the datastore when operating in queued mode.
public  Objectget(int index)
     Method to retrieve an element no.
public  ClassgetElementType()
     Accessor for the element type.
public  StringgetFieldName()
     Accessor for the field name.
public  ObjectgetFirst()
     Method to retrieve the first element.
public  ObjectgetLast()
     Method to retrieve the last element.
public  ObjectgetOwner()
     Accessor for the owner object.
public  ObjectgetValue()
     Accessor for the unwrapped value that we are wrapping.
public synchronized  inthashCode()
     Hashcode operator.
public  intindexOf(Object element)
     Method to the position of an element.
Parameters:
  element - The element.
public  voidinitialise(Object o, boolean forInsert, boolean forUpdate)
     Method to initialise the SCO from an existing value.
public  voidinitialise()
     Method to initialise the SCO for use.
public  booleanisEmpty()
     Accessor for whether the LinkedList is empty.
public  Iteratoriterator()
     Method to retrieve an iterator for the list.
public  intlastIndexOf(Object element)
     Method to retrieve the last position of the element.
public  ListIteratorlistIterator(int index)
     Method to retrieve a List iterator for the list from the index.
public  voidload()
     Method to effect the load of the data in the SCO.
protected  voidloadFromStore()
     Method to load all elements from the "backing store" where appropriate.
public  voidmakeDirty()
     Utility to mark the object as dirty.
public synchronized  QueryExpressionnewQueryStatement()
     Method to generate a QueryStatement for the SCO.
public synchronized  QueryExpressionnewQueryStatement(Class candidateClass, DatastoreIdentifier candidateAlias)
     Method to return a QueryStatement, using the specified candidate class.
public synchronized  ResultObjectFactorynewResultObjectFactory(QueryExpression stmt, boolean ignoreCache, Class resultClass, boolean useFetchPlan)
     Method to return a ResultObjectFactory for the SCO.
public  Objectremove(int index)
     Method to remove an element from the LinkedList.
Parameters:
  index - The element position.
public  booleanremove(Object element)
     Method to remove an element from the LinkedList.
public  booleanremove(Object element, boolean allowCascadeDelete)
     Method to remove an element from the collection, and observe the flag for whether to allow cascade delete.
public  booleanremoveAll(Collection elements)
     Method to remove a Collection from the LinkedList.
public  ObjectremoveFirst()
     Method to remove the first element from the LinkedList.
public  ObjectremoveLast()
     Method to remove the last element from the LinkedList.
public synchronized  booleanretainAll(java.util.Collection c)
     Method to retain a Collection of elements (and remove all others).
public  Objectset(int index, Object element, boolean allowDependentField)
     JPOX wrapper addition that allows turning off of the dependent-field checks when doing the position setting.
public  Objectset(int index, Object element)
     Method to set the element at a position in the LinkedList.
public  intsize()
     Accessor for the size of the LinkedList.
public synchronized  java.util.ListsubList(int from, int to)
    
public synchronized  Object[]toArray()
     Method to return the list as an array.
public synchronized  Object[]toArray(Object a)
     Method to return the list as an array.
public synchronized  voidunsetOwner()
     Method to unset the owner and field information.
public  voidupdateEmbeddedElement(Object element, int fieldNumber, Object value)
     Method to update an embedded element in this collection.
protected  ObjectwriteReplace()
     The writeReplace method is called when ObjectOutputStream is preparing to write the object to the stream.

Field Detail
LOCALISER
final protected static Localiser LOCALISER(Code)



isCacheLoaded
protected boolean isCacheLoaded(Code)
Status flag whether the collection is loaded into the cache.



queued
boolean queued(Code)
Whether the SCO is in "direct" or "queued" mode.



useCache
protected boolean useCache(Code)
Whether to use "delegate" caching.




Constructor Detail
LinkedList
public LinkedList(StateManager ownerSM, String fieldName)(Code)
Constructor, using the StateManager of the "owner" and the field name.
Parameters:
  ownerSM - The owner StateManager
Parameters:
  fieldName - The name of the field of the SCO.




Method Detail
add
public void add(int index, Object element)(Code)
Method to add an element to a position in the LinkedList.
Parameters:
  index - The position
Parameters:
  element - The new element



add
public boolean add(Object element)(Code)
Method to add an element to the LinkedList.
Parameters:
  element - The new element Whether it was added ok.



addAll
public boolean addAll(Collection elements)(Code)
Method to add a Collection to the LinkedList.
Parameters:
  elements - The collection Whether it was added ok.



addAll
public boolean addAll(int index, Collection elements)(Code)
Method to add a Collection to a position in the LinkedList.
Parameters:
  index - Position to insert the collection.
Parameters:
  elements - The collection Whether it was added ok.



addFirst
public void addFirst(Object element)(Code)
Method to add an element as first in the LinkedList.
Parameters:
  element - The new element



addLast
public void addLast(Object element)(Code)
Method to add an element as last in the LinkedList.
Parameters:
  element - The new element



addQueuedOperation
protected void addQueuedOperation(QueuedOperation op)(Code)
Convenience method to add a queued operation to the operations we perform at commit.
Parameters:
  op - The operation



attachCopy
public void attachCopy(Object value)(Code)
Method to return an attached copy of the passed (detached) value. The returned attached copy is a SCO wrapper. Goes through the existing elements in the store for this owner field and removes ones no longer present, and adds new elements. All elements in the (detached) value are attached.
Parameters:
  value - The new (collection) value



clear
public synchronized void clear()(Code)
Method to clear the LinkedList.



clone
public Object clone()(Code)
Clone operator to return a copy of this object.

Mutable second-class Objects are required to provide a public clone method in order to allow for copying PersistenceCapable objects. In contrast to Object.clone(), this method must not throw a CloneNotSupportedException.

The cloned object



contains
public boolean contains(Object element)(Code)
Method to return if the list contains this element.
Parameters:
  element - The element Whether it is contained



containsAll
public synchronized boolean containsAll(java.util.Collection c)(Code)
Accessor for whether a collection of elements are contained here.
Parameters:
  c - The collection of elements. Whether they are contained.



detachCopy
public Object detachCopy(FetchPlanState state)(Code)
Method to return a detached copy of the container. Recurse sthrough the elements so that they are likewise detached.
Parameters:
  state - State for detachment process The detached container



equals
public synchronized boolean equals(Object o)(Code)
Equality operator.
Parameters:
  o - The object to compare against. Whether this object is the same.



flush
public void flush()(Code)
Method to flush the changes to the datastore when operating in queued mode. Does nothing in "direct" mode.



get
public Object get(int index)(Code)
Method to retrieve an element no.
Parameters:
  index - The item to retrieve The element at that position.



getElementType
public Class getElementType()(Code)
Accessor for the element type. the element type contained in the collection



getFieldName
public String getFieldName()(Code)
Accessor for the field name. The field name



getFirst
public Object getFirst()(Code)
Method to retrieve the first element. The first element



getLast
public Object getLast()(Code)
Method to retrieve the last element. The last element



getOwner
public Object getOwner()(Code)
Accessor for the owner object. The owner object



getValue
public Object getValue()(Code)
Accessor for the unwrapped value that we are wrapping. The unwrapped value



hashCode
public synchronized int hashCode()(Code)
Hashcode operator. The Hash code.



indexOf
public int indexOf(Object element)(Code)
Method to the position of an element.
Parameters:
  element - The element. The position.



initialise
public void initialise(Object o, boolean forInsert, boolean forUpdate)(Code)
Method to initialise the SCO from an existing value.
Parameters:
  o - The object to set from
Parameters:
  forInsert - Whether the object needs inserting in the datastore with this value
Parameters:
  forUpdate - Whether to update the datastore with this value



initialise
public void initialise()(Code)
Method to initialise the SCO for use.



isEmpty
public boolean isEmpty()(Code)
Accessor for whether the LinkedList is empty. Whether it is empty.



iterator
public Iterator iterator()(Code)
Method to retrieve an iterator for the list. The iterator



lastIndexOf
public int lastIndexOf(Object element)(Code)
Method to retrieve the last position of the element.
Parameters:
  element - The element The last position of this element in the List.



listIterator
public ListIterator listIterator(int index)(Code)
Method to retrieve a List iterator for the list from the index.
Parameters:
  index - The start point The iterator



load
public void load()(Code)
Method to effect the load of the data in the SCO. Used when the SCO supports lazy-loading to tell it to load all now.



loadFromStore
protected void loadFromStore()(Code)
Method to load all elements from the "backing store" where appropriate.



makeDirty
public void makeDirty()(Code)
Utility to mark the object as dirty.



newQueryStatement
public synchronized QueryExpression newQueryStatement()(Code)
Method to generate a QueryStatement for the SCO. The QueryStatement



newQueryStatement
public synchronized QueryExpression newQueryStatement(Class candidateClass, DatastoreIdentifier candidateAlias)(Code)
Method to return a QueryStatement, using the specified candidate class.
Parameters:
  candidateClass - the candidate class
Parameters:
  candidateAlias - Alias for the candidate The QueryStatement



newResultObjectFactory
public synchronized ResultObjectFactory newResultObjectFactory(QueryExpression stmt, boolean ignoreCache, Class resultClass, boolean useFetchPlan)(Code)
Method to return a ResultObjectFactory for the SCO.
Parameters:
  stmt - The QueryStatement
Parameters:
  ignoreCache - Whether to ignore the cache
Parameters:
  resultClass - Whether to create objects of a particular class
Parameters:
  useFetchPlan - whether to use the fetch plan to retrieve fields in the same query The ResultObjectFactory



remove
public Object remove(int index)(Code)
Method to remove an element from the LinkedList.
Parameters:
  index - The element position. The object that was removed



remove
public boolean remove(Object element)(Code)
Method to remove an element from the LinkedList.
Parameters:
  element - The element Whether the object was removed ok



remove
public boolean remove(Object element, boolean allowCascadeDelete)(Code)
Method to remove an element from the collection, and observe the flag for whether to allow cascade delete.
Parameters:
  element - The element
Parameters:
  allowCascadeDelete - Whether to allow cascade delete



removeAll
public boolean removeAll(Collection elements)(Code)
Method to remove a Collection from the LinkedList.
Parameters:
  elements - The collection Whether it was removed ok.



removeFirst
public Object removeFirst()(Code)
Method to remove the first element from the LinkedList. The object that was removed



removeLast
public Object removeLast()(Code)
Method to remove the last element from the LinkedList. The object that was removed



retainAll
public synchronized boolean retainAll(java.util.Collection c)(Code)
Method to retain a Collection of elements (and remove all others).
Parameters:
  c - The collection to retain Whether they were retained successfully.



set
public Object set(int index, Object element, boolean allowDependentField)(Code)
JPOX wrapper addition that allows turning off of the dependent-field checks when doing the position setting. This means that we can prevent the deletion of the object that was previously in that position. This particular feature is used when attaching a list field and where some elements have changed positions.
Parameters:
  index - The position
Parameters:
  element - The new element The element previously at that position



set
public Object set(int index, Object element)(Code)
Method to set the element at a position in the LinkedList.
Parameters:
  index - The position
Parameters:
  element - The new element The element previously at that position



size
public int size()(Code)
Accessor for the size of the LinkedList. The size.



subList
public synchronized java.util.List subList(int from, int to)(Code)
Accessor for the subList of elements between from and to of the List
Parameters:
  from - Start index (inclusive)
Parameters:
  to - End index (exclusive) The subList



toArray
public synchronized Object[] toArray()(Code)
Method to return the list as an array. The array



toArray
public synchronized Object[] toArray(Object a)(Code)
Method to return the list as an array.
Parameters:
  a - The runtime types of the array being defined by this param The array



unsetOwner
public synchronized void unsetOwner()(Code)
Method to unset the owner and field information.



updateEmbeddedElement
public void updateEmbeddedElement(Object element, int fieldNumber, Object value)(Code)
Method to update an embedded element in this collection.
Parameters:
  element - The element
Parameters:
  fieldNumber - Number of field in the element
Parameters:
  value - New value for this field



writeReplace
protected Object writeReplace() throws ObjectStreamException(Code)
The writeReplace method is called when ObjectOutputStream is preparing to write the object to the stream. The ObjectOutputStream checks whether the class defines the writeReplace method. If the method is defined, the writeReplace method is called to allow the object to designate its replacement in the stream. The object returned should be either of the same type as the object passed in or an object that when read and resolved will result in an object of a type that is compatible with all references to the object. the replaced object
throws:
  ObjectStreamException -



Methods inherited from java.util.LinkedList
public boolean add(E e)(Code)(Java Doc)
public void add(int index, E element)(Code)(Java Doc)
public boolean addAll(Collection<? extends E> c)(Code)(Java Doc)
public boolean addAll(int index, Collection<? extends E> c)(Code)(Java Doc)
public void addFirst(E e)(Code)(Java Doc)
public void addLast(E e)(Code)(Java Doc)
public void clear()(Code)(Java Doc)
public Object clone()(Code)(Java Doc)
public boolean contains(Object o)(Code)(Java Doc)
public Iterator<E> descendingIterator()(Code)(Java Doc)
public E element()(Code)(Java Doc)
public E get(int index)(Code)(Java Doc)
public E getFirst()(Code)(Java Doc)
public E getLast()(Code)(Java Doc)
public int indexOf(Object o)(Code)(Java Doc)
public int lastIndexOf(Object o)(Code)(Java Doc)
public ListIterator<E> listIterator(int index)(Code)(Java Doc)
public boolean offer(E e)(Code)(Java Doc)
public boolean offerFirst(E e)(Code)(Java Doc)
public boolean offerLast(E e)(Code)(Java Doc)
public E peek()(Code)(Java Doc)
public E peekFirst()(Code)(Java Doc)
public E peekLast()(Code)(Java Doc)
public E poll()(Code)(Java Doc)
public E pollFirst()(Code)(Java Doc)
public E pollLast()(Code)(Java Doc)
public E pop()(Code)(Java Doc)
public void push(E e)(Code)(Java Doc)
public boolean remove(Object o)(Code)(Java Doc)
public E remove(int index)(Code)(Java Doc)
public E remove()(Code)(Java Doc)
public E removeFirst()(Code)(Java Doc)
public boolean removeFirstOccurrence(Object o)(Code)(Java Doc)
public E removeLast()(Code)(Java Doc)
public boolean removeLastOccurrence(Object o)(Code)(Java Doc)
public E set(int index, E element)(Code)(Java Doc)
public int size()(Code)(Java Doc)
public Object[] toArray()(Code)(Java Doc)
public T[] toArray(T[] a)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.