Java Doc for AbstractLinkedList.java in  » Library » Apache-common-Collections » org » apache » commons » collections » list » 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 » Library » Apache common Collections » org.apache.commons.collections.list 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.collections.list.AbstractLinkedList

All known Subclasses:   org.apache.commons.collections.list.CursorableLinkedList,  org.apache.commons.collections.list.NodeCachingLinkedList,
AbstractLinkedList
abstract public class AbstractLinkedList implements List(Code)
An abstract implementation of a linked list which provides numerous points for subclasses to override.

Overridable methods are provided to change the storage node and to change how nodes are added to and removed. Hopefully, all you need for unusual subclasses is here.
since:
   Commons Collections 3.0
version:
   $Revision: 219343 $ $Date: 2005-07-16 18:08:16 +0100 (Sat, 16 Jul 2005) $
author:
   Rich Dougherty
author:
   Phil Steitz
author:
   Stephen Colebourne


Inner Class :protected static class Node
Inner Class :protected static class LinkedListIterator implements ListIterator,OrderedIterator
Inner Class :protected static class LinkedSubListIterator extends LinkedListIterator
Inner Class :protected static class LinkedSubList extends AbstractList

Field Summary
protected transient  Nodeheader
     A Node which indicates the start and end of the list and does not hold a value.
protected transient  intmodCount
    
protected transient  intsize
    

Constructor Summary
protected  AbstractLinkedList()
     Constructor that does nothing intended for deserialization.
protected  AbstractLinkedList(Collection coll)
     Constructs a list copying data from the specified collection.

Method Summary
public  booleanadd(Object value)
    
public  voidadd(int index, Object value)
    
public  booleanaddAll(Collection coll)
    
public  booleanaddAll(int index, Collection coll)
    
public  booleanaddFirst(Object o)
    
public  booleanaddLast(Object o)
    
protected  voidaddNode(Node nodeToInsert, Node insertBeforeNode)
     Inserts a new node into the list.
protected  voidaddNodeAfter(Node node, Object value)
     Creates a new node with the specified object as its value and inserts it after node.
protected  voidaddNodeBefore(Node node, Object value)
     Creates a new node with the specified object as its value and inserts it before node.
public  voidclear()
    
public  booleancontains(Object value)
    
public  booleancontainsAll(Collection coll)
    
protected  NodecreateHeaderNode()
     Creates a new node with previous, next and element all set to null.
protected  NodecreateNode(Object value)
     Creates a new node with the specified properties.
protected  IteratorcreateSubListIterator(LinkedSubList subList)
     Creates an iterator for the sublist.
protected  ListIteratorcreateSubListListIterator(LinkedSubList subList, int fromIndex)
     Creates a list iterator for the sublist.
protected  voiddoReadObject(ObjectInputStream inputStream)
     Deserializes the data held in this object to the stream specified.
protected  voiddoWriteObject(ObjectOutputStream outputStream)
     Serializes the data held in this object to the stream specified.
public  booleanequals(Object obj)
    
public  Objectget(int index)
    
public  ObjectgetFirst()
    
public  ObjectgetLast()
    
protected  NodegetNode(int index, boolean endMarkerAllowed)
     Gets the node at a particular index.
public  inthashCode()
    
public  intindexOf(Object value)
    
protected  voidinit()
     The equivalent of a default constructor, broken out so it can be called by any constructor and by readObject.
public  booleanisEmpty()
    
protected  booleanisEqualValue(Object value1, Object value2)
     Compares two values for equals.
public  Iteratoriterator()
    
public  intlastIndexOf(Object value)
    
public  ListIteratorlistIterator()
    
public  ListIteratorlistIterator(int fromIndex)
    
public  Objectremove(int index)
    
public  booleanremove(Object value)
    
public  booleanremoveAll(Collection coll)
    
protected  voidremoveAllNodes()
     Removes all nodes by resetting the circular list marker.
public  ObjectremoveFirst()
    
public  ObjectremoveLast()
    
protected  voidremoveNode(Node node)
     Removes the specified node from the list.
public  booleanretainAll(Collection coll)
    
public  Objectset(int index, Object value)
    
public  intsize()
    
public  ListsubList(int fromIndexInclusive, int toIndexExclusive)
     Gets a sublist of the main list.
public  Object[]toArray()
    
public  Object[]toArray(Object[] array)
    
public  StringtoString()
    
protected  voidupdateNode(Node node, Object value)
     Updates the node with a new value.

Field Detail
header
protected transient Node header(Code)
A Node which indicates the start and end of the list and does not hold a value. The value of next is the first item in the list. The value of of previous is the last item in the list.



modCount
protected transient int modCount(Code)
Modification count for iterators



size
protected transient int size(Code)
The size of the list




Constructor Detail
AbstractLinkedList
protected AbstractLinkedList()(Code)
Constructor that does nothing intended for deserialization.

If this constructor is used by a serializable subclass then the init() method must be called.




AbstractLinkedList
protected AbstractLinkedList(Collection coll)(Code)
Constructs a list copying data from the specified collection.
Parameters:
  coll - the collection to copy




Method Detail
add
public boolean add(Object value)(Code)



add
public void add(int index, Object value)(Code)



addAll
public boolean addAll(Collection coll)(Code)



addAll
public boolean addAll(int index, Collection coll)(Code)



addFirst
public boolean addFirst(Object o)(Code)



addLast
public boolean addLast(Object o)(Code)



addNode
protected void addNode(Node nodeToInsert, Node insertBeforeNode)(Code)
Inserts a new node into the list.
Parameters:
  nodeToInsert - new node to insert
Parameters:
  insertBeforeNode - node to insert before
throws:
  NullPointerException - if either node is null



addNodeAfter
protected void addNodeAfter(Node node, Object value)(Code)
Creates a new node with the specified object as its value and inserts it after node.

This implementation uses AbstractLinkedList.createNode(Object) and AbstractLinkedList.addNode(AbstractLinkedList.Node,AbstractLinkedList.Node) .
Parameters:
  node - node to insert after
Parameters:
  value - value of the newly added node
throws:
  NullPointerException - if node is null




addNodeBefore
protected void addNodeBefore(Node node, Object value)(Code)
Creates a new node with the specified object as its value and inserts it before node.

This implementation uses AbstractLinkedList.createNode(Object) and AbstractLinkedList.addNode(AbstractLinkedList.Node,AbstractLinkedList.Node) .
Parameters:
  node - node to insert before
Parameters:
  value - value of the newly added node
throws:
  NullPointerException - if node is null




clear
public void clear()(Code)



contains
public boolean contains(Object value)(Code)



containsAll
public boolean containsAll(Collection coll)(Code)



createHeaderNode
protected Node createHeaderNode()(Code)
Creates a new node with previous, next and element all set to null. This implementation creates a new empty Node. Subclasses can override this to create a different class. newly created node



createNode
protected Node createNode(Object value)(Code)
Creates a new node with the specified properties. This implementation creates a new Node with data. Subclasses can override this to create a different class.
Parameters:
  value - value of the new node



createSubListIterator
protected Iterator createSubListIterator(LinkedSubList subList)(Code)
Creates an iterator for the sublist.
Parameters:
  subList - the sublist to get an iterator for



createSubListListIterator
protected ListIterator createSubListListIterator(LinkedSubList subList, int fromIndex)(Code)
Creates a list iterator for the sublist.
Parameters:
  subList - the sublist to get an iterator for
Parameters:
  fromIndex - the index to start from, relative to the sublist



doReadObject
protected void doReadObject(ObjectInputStream inputStream) throws IOException, ClassNotFoundException(Code)
Deserializes the data held in this object to the stream specified.

The first serializable subclass must call this method from readObject.




doWriteObject
protected void doWriteObject(ObjectOutputStream outputStream) throws IOException(Code)
Serializes the data held in this object to the stream specified.

The first serializable subclass must call this method from writeObject.




equals
public boolean equals(Object obj)(Code)



get
public Object get(int index)(Code)



getFirst
public Object getFirst()(Code)



getLast
public Object getLast()(Code)



getNode
protected Node getNode(int index, boolean endMarkerAllowed) throws IndexOutOfBoundsException(Code)
Gets the node at a particular index.
Parameters:
  index - the index, starting from 0
Parameters:
  endMarkerAllowed - whether or not the end marker can be returned ifstartIndex is set to the list's size
throws:
  IndexOutOfBoundsException - if the index is less than 0; equal tothe size of the list and endMakerAllowed is false; or greater than thesize of the list



hashCode
public int hashCode()(Code)



indexOf
public int indexOf(Object value)(Code)



init
protected void init()(Code)
The equivalent of a default constructor, broken out so it can be called by any constructor and by readObject. Subclasses which override this method should make sure they call super, so the list is initialised properly.



isEmpty
public boolean isEmpty()(Code)



isEqualValue
protected boolean isEqualValue(Object value1, Object value2)(Code)
Compares two values for equals. This implementation uses the equals method. Subclasses can override this to match differently.
Parameters:
  value1 - the first value to compare, may be null
Parameters:
  value2 - the second value to compare, may be null true if equal



iterator
public Iterator iterator()(Code)



lastIndexOf
public int lastIndexOf(Object value)(Code)



listIterator
public ListIterator listIterator()(Code)



listIterator
public ListIterator listIterator(int fromIndex)(Code)



remove
public Object remove(int index)(Code)



remove
public boolean remove(Object value)(Code)



removeAll
public boolean removeAll(Collection coll)(Code)



removeAllNodes
protected void removeAllNodes()(Code)
Removes all nodes by resetting the circular list marker.



removeFirst
public Object removeFirst()(Code)



removeLast
public Object removeLast()(Code)



removeNode
protected void removeNode(Node node)(Code)
Removes the specified node from the list.
Parameters:
  node - the node to remove
throws:
  NullPointerException - if node is null



retainAll
public boolean retainAll(Collection coll)(Code)



set
public Object set(int index, Object value)(Code)



size
public int size()(Code)



subList
public List subList(int fromIndexInclusive, int toIndexExclusive)(Code)
Gets a sublist of the main list.
Parameters:
  fromIndexInclusive - the index to start from
Parameters:
  toIndexExclusive - the index to end at the new sublist



toArray
public Object[] toArray()(Code)



toArray
public Object[] toArray(Object[] array)(Code)



toString
public String toString()(Code)



updateNode
protected void updateNode(Node node, Object value)(Code)
Updates the node with a new value. This implementation sets the value on the node. Subclasses can override this to record the change.
Parameters:
  node - node to update
Parameters:
  value - new value of the node



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.