Java Doc for AbstractSequentialList.java in  » 6.0-JDK-Modules » j2me » java » util » 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 » 6.0 JDK Modules » j2me » java.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.AbstractCollection
      java.util.AbstractList
         java.util.AbstractSequentialList

All known Subclasses:   java.util.LinkedList,
AbstractSequentialList
abstract public class AbstractSequentialList extends AbstractList (Code)
This class provides a skeletal implementation of the List interface to minimize the effort required to implement this interface backed by a "sequential access" data store (such as a linked list). For random access data (such as an array), AbstractList should be used in preference to this class.

This class is the opposite of the AbstractList class in the sense that it implements the "random access" methods (get(int index), set(int index, Object element), set(int index, Object element), add(int index, Object element) and remove(int index)) on top of the list's list iterator, instead of the other way around.

To implement a list the programmer needs only to extend this class and provide implementations for the listIterator and size methods. For an unmodifiable list, the programmer need only implement the list iterator's hasNext, next, hasPrevious, previous and index methods.

For a modifiable list the programmer should additionally implement the list iterator's set method. For a variable-size list the programmer should additionally implement the list iterator's remove and add methods.

The programmer should generally provide a void (no argument) and collection constructor, as per the recommendation in the Collection interface specification.

This class is a member of the Java Collections Framework.
author:
   Josh Bloch
version:
   1.21, 02/02/00
See Also:   Collection
See Also:   List
See Also:   AbstractList
See Also:   AbstractCollection
since:
   1.2




Constructor Summary
protected  AbstractSequentialList()
     Sole constructor.

Method Summary
public  voidadd(int index, Object element)
     Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

This implementation first gets a list iterator pointing to the indexed element (with listIterator(index)).

public  booleanaddAll(int index, Collection c)
     Inserts all of the elements in in the specified collection into this list at the specified position.
public  Objectget(int index)
     Returns the element at the specified position in this list.
public  Iteratoriterator()
     Returns an iterator over the elements in this list (in proper sequence).

This implementation merely returns a list iterator over the list.

abstract public  ListIteratorlistIterator(int index)
     Returns a list iterator over the elements in this list (in proper sequence).
public  Objectremove(int index)
     Removes the element at the specified position in this list.
public  Objectset(int index, Object element)
     Replaces the element at the specified position in this list with the specified element.


Constructor Detail
AbstractSequentialList
protected AbstractSequentialList()(Code)
Sole constructor. (For invocation by subclass constructors, typically implicit.)




Method Detail
add
public void add(int index, Object element)(Code)
Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

This implementation first gets a list iterator pointing to the indexed element (with listIterator(index)). Then, it inserts the specified element with ListIterator.add.

Note that this implementation will throw an UnsupportedOperationException if list iterator does not implement the add operation.
Parameters:
  index - index at which the specified element is to be inserted.
Parameters:
  element - element to be inserted.
throws:
  UnsupportedOperationException - if the add operation isnot supported by this list.
throws:
  NullPointerException - this list does not permit nullelements and one of the elements of c isnull.
throws:
  ClassCastException - if the class of the specified elementprevents it from being added to this list.
throws:
  IllegalArgumentException - if some aspect of the specifiedelement prevents it from being added to this list.
throws:
  IndexOutOfBoundsException - if the specified index is out ofrange (index < 0 || index > size()).




addAll
public boolean addAll(int index, Collection c)(Code)
Inserts all of the elements in in the specified collection into this list at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in the list in the order that they are returned by the specified collection's iterator. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.) Optional operation.

This implementation gets an iterator over the specified collection and a list iterator over this list pointing to the indexed element (with listIterator(index)). Then, it iterates over the specified collection, inserting the elements obtained from the iterator into this list, one at a time, using ListIterator.add followed by ListIterator.next (to skip over the added element).

Note that this implementation will throw an UnsupportedOperationException if the list iterator returned by the listIterator method does not implement the add operation. true if this list changed as a result of the call.
Parameters:
  index - index at which to insert first element from the specifiedcollection.
Parameters:
  c - elements to be inserted into this list.
throws:
  UnsupportedOperationException - if the addAll operationis not supported by this list.
throws:
  NullPointerException - this list does not permit nullelements and one of the elements of the specified collectionis null.
throws:
  ClassCastException - if the class of the specified elementprevents it from being added to this list.
throws:
  IllegalArgumentException - if some aspect of the specifiedelement prevents it from being added to this list.
throws:
  IndexOutOfBoundsException - if the specified index is out ofrange (index < 0 || index > size()).
throws:
  NullPointerException - if the specified collection is null.




get
public Object get(int index)(Code)
Returns the element at the specified position in this list.

This implementation first gets a list iterator pointing to the indexed element (with listIterator(index)). Then, it gets the element using ListIterator.next and returns it.
Parameters:
  index - index of element to return. the element at the specified position in this list.
throws:
  IndexOutOfBoundsException - if the specified index is out ofrange (index < 0 || index >= size()).




iterator
public Iterator iterator()(Code)
Returns an iterator over the elements in this list (in proper sequence).

This implementation merely returns a list iterator over the list. an iterator over the elements in this list (in proper sequence).




listIterator
abstract public ListIterator listIterator(int index)(Code)
Returns a list iterator over the elements in this list (in proper sequence).
Parameters:
  index - index of first element to be returned from the list iterator (by a call to the next method) a list iterator over the elements in this list (in propersequence).



remove
public Object remove(int index)(Code)
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).

This implementation first gets a list iterator pointing to the indexed element (with listIterator(index)). Then, it removes the element with ListIterator.remove.

Note that this implementation will throw an UnsupportedOperationException if list iterator does not implement the remove operation.
Parameters:
  index - index of the element to be removed from the List. the element that was removed from the list.
throws:
  UnsupportedOperationException - if the remove operationis not supported by this list.
throws:
  IndexOutOfBoundsException - if the specified index is out ofrange (index < 0 || index >= size()).




set
public Object set(int index, Object element)(Code)
Replaces the element at the specified position in this list with the specified element.

This implementation first gets a list iterator pointing to the indexed element (with listIterator(index)). Then, it gets the current element using ListIterator.next and replaces it with ListIterator.set.

Note that this implementation will throw an UnsupportedOperationException if list iterator does not implement the set operation.
Parameters:
  index - index of element to replace.
Parameters:
  element - element to be stored at the specified position. the element previously at the specified position.
throws:
  UnsupportedOperationException - set is not supportedby this list.
throws:
  NullPointerException - this list does not permit nullelements and one of the elements of c is null.
throws:
  ClassCastException - class of the specified elementprevents it from being added to this list.
throws:
  IllegalArgumentException - some aspect of the specifiedelement prevents it from being added to this list.
throws:
  IndexOutOfBoundsException - index out of range(index < 0 || index >= size()).
throws:
  IllegalArgumentException - fromIndex > toIndex.




Fields inherited from java.util.AbstractList
protected transient int modCount(Code)(Java Doc)

Methods inherited from java.util.AbstractList
public boolean add(Object o)(Code)(Java Doc)
public void add(int index, Object element)(Code)(Java Doc)
public boolean addAll(int index, Collection c)(Code)(Java Doc)
public void clear()(Code)(Java Doc)
public boolean equals(Object o)(Code)(Java Doc)
abstract public Object get(int index)(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public int indexOf(Object o)(Code)(Java Doc)
public Iterator iterator()(Code)(Java Doc)
public int lastIndexOf(Object o)(Code)(Java Doc)
public ListIterator listIterator()(Code)(Java Doc)
public ListIterator listIterator(int index)(Code)(Java Doc)
public Object remove(int index)(Code)(Java Doc)
protected void removeRange(int fromIndex, int toIndex)(Code)(Java Doc)
public Object set(int index, Object element)(Code)(Java Doc)
public List subList(int fromIndex, int toIndex)(Code)(Java Doc)

Methods inherited from java.util.AbstractCollection
public boolean add(Object o)(Code)(Java Doc)
public boolean addAll(Collection c)(Code)(Java Doc)
public void clear()(Code)(Java Doc)
public boolean contains(Object o)(Code)(Java Doc)
public boolean containsAll(Collection c)(Code)(Java Doc)
public boolean isEmpty()(Code)(Java Doc)
abstract public Iterator iterator()(Code)(Java Doc)
public boolean remove(Object o)(Code)(Java Doc)
public boolean removeAll(Collection c)(Code)(Java Doc)
public boolean retainAll(Collection c)(Code)(Java Doc)
abstract public int size()(Code)(Java Doc)
public Object[] toArray()(Code)(Java Doc)
public Object[] toArray(Object a)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
public boolean equals(Object obj)(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.