Java Doc for LinkedListModel.java in  » Swing-Library » jgoodies-data-binding » com » jgoodies » binding » 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 » Swing Library » jgoodies data binding » com.jgoodies.binding.list 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.jgoodies.binding.list.LinkedListModel

LinkedListModel
final public class LinkedListModel extends LinkedList implements ObservableList<E>(Code)
Adds javax.swing.ListModel capabilities to its superclass LinkedList, i. e. allows to observe changes in the content and structure. Useful for lists that are bound to list views, for example JList, JComboBox and JTable.
author:
   Karsten Lentzsch
version:
   $Revision: 1.6 $
See Also:   ArrayListModel
See Also:   java.util.ListIterator<
Parameters:
  E - > the type of the list elements



Constructor Summary
public  LinkedListModel()
     Constructs an empty linked list.
public  LinkedListModel(Collection<? extends E> c)
     Constructs a linked list containing the elements of the specified collection, in the order they are returned by the collection's iterator.

Method Summary
public  voidadd(int index, E element)
     Inserts the specified element at the specified position in this list.
public  booleanadd(E e)
     Appends the specified element to the end of this list.
Parameters:
  e - element to be appended to this list.
public  booleanaddAll(int index, Collection<? extends E> c)
     Inserts all of the elements in the specified Collection into this list, starting at the specified position.
public  voidaddFirst(E e)
     Inserts the given element at the beginning of this list.
public  voidaddLast(E e)
     Appends the given element to the end of this list.
public  voidaddListDataListener(ListDataListener l)
     Adds a listener to the list that's notified each time a change to the data model occurs.
public  voidclear()
     Removes all of the elements from this list.
public  voidfireContentsChanged(int index)
     Notifies all registered ListDataListeners that the element at the specified index has changed.
public  EgetElementAt(int index)
     Returns the value at the specified index.
public  ListDataListener[]getListDataListeners()
     Returns an array of all the list data listeners registered on this LinkedListModel.
public  intgetSize()
     Returns the length of the list or 0 if there's no list.
public  ListIterator<E>listIterator(int index)
     Returns a list-iterator of the elements in this list (in proper sequence), starting at the specified position in the list. Obeys the general contract of List.listIterator(int).

The list-iterator is fail-fast: if the list is structurally modified at any time after the Iterator is created, in any way except through the list-iterator's own remove or add methods, the list-iterator will throw a ConcurrentModificationException.

public  Eremove(int index)
     Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).
Parameters:
  index - the index of the element to removed.
public  booleanremove(Object o)
     Removes a single instance of the specified element from this collection, if it is present (optional operation).
public  EremoveFirst()
     Removes and returns the first element from this list.
public  EremoveLast()
     Removes and returns the last element from this list.
public  voidremoveListDataListener(ListDataListener l)
     Removes a listener from the list that's notified each time a change to the data model occurs.
protected  voidremoveRange(int fromIndex, int toIndex)
     Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.
public  Eset(int index, E element)
     Replaces the element at the specified position in this list with the specified element.
Parameters:
  index - index of element to replace.
Parameters:
  element - element to be stored at the specified position.


Constructor Detail
LinkedListModel
public LinkedListModel()(Code)
Constructs an empty linked list.



LinkedListModel
public LinkedListModel(Collection<? extends E> c)(Code)
Constructs a linked list containing the elements of the specified collection, in the order they are returned by the collection's iterator.
Parameters:
  c - the collection whose elements are to be placed into this list.
throws:
  NullPointerException - if the specified collection isnull




Method Detail
add
public void add(int index, E 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).
Parameters:
  index - index at which the specified element is to be inserted.
Parameters:
  element - element to be inserted.
throws:
  IndexOutOfBoundsException - if index is out of range(index < 0 || index > size()).



add
public boolean add(E e)(Code)
Appends the specified element to the end of this list.
Parameters:
  e - element to be appended to this list. true (as per the general contract of Collection.add).



addAll
public boolean addAll(int index, Collection<? extends E> c)(Code)
Inserts all of the elements in the specified Collection into this list, starting 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.
Parameters:
  index - index at which to insert first elementfrom the specified collection.
Parameters:
  c - elements to be inserted into this list. true if this list changed as a result of the call.
throws:
  IndexOutOfBoundsException - if index out of range(index < 0 || index > size()).
throws:
  NullPointerException - if the specified Collection is null.



addFirst
public void addFirst(E e)(Code)
Inserts the given element at the beginning of this list.
Parameters:
  e - the element to be inserted at the beginning of this list.



addLast
public void addLast(E e)(Code)
Appends the given element to the end of this list. (Identical in function to the add method; included only for consistency.)
Parameters:
  e - the element to be inserted at the end of this list.



addListDataListener
public void addListDataListener(ListDataListener l)(Code)
Adds a listener to the list that's notified each time a change to the data model occurs.
Parameters:
  l - the ListDataListener to be added



clear
public void clear()(Code)
Removes all of the elements from this list. The list will be empty after this call returns.



fireContentsChanged
public void fireContentsChanged(int index)(Code)
Notifies all registered ListDataListeners that the element at the specified index has changed. Useful if there's a content change without any structural change.

This method must be called after the element of the list changes.
Parameters:
  index - the index of the element that has changed
See Also:   EventListenerList




getElementAt
public E getElementAt(int index)(Code)
Returns the value at the specified index.
Parameters:
  index - the requested index the value at index



getListDataListeners
public ListDataListener[] getListDataListeners()(Code)
Returns an array of all the list data listeners registered on this LinkedListModel. all of this model's ListDataListeners,or an empty array if no list data listenersare currently registered
See Also:   LinkedListModel.addListDataListener(ListDataListener)
See Also:   LinkedListModel.removeListDataListener(ListDataListener)



getSize
public int getSize()(Code)
Returns the length of the list or 0 if there's no list. the length of the list or 0 if there's no list



listIterator
public ListIterator<E> listIterator(int index)(Code)
Returns a list-iterator of the elements in this list (in proper sequence), starting at the specified position in the list. Obeys the general contract of List.listIterator(int).

The list-iterator is fail-fast: if the list is structurally modified at any time after the Iterator is created, in any way except through the list-iterator's own remove or add methods, the list-iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future.
Parameters:
  index - index of first element to be returned from thelist-iterator (by a call to next). a ListIterator of the elements in this list (in propersequence), starting at the specified position in the list.
throws:
  IndexOutOfBoundsException - if index is out of range(index < 0 || index > size()).
See Also:   java.util.List.listIterator(int)




remove
public E 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).
Parameters:
  index - the index of the element to removed. the element that was removed from the list.
throws:
  IndexOutOfBoundsException - if index out of range(index < 0 || index >= size()).



remove
public boolean remove(Object o)(Code)
Removes a single instance of the specified element from this collection, if it is present (optional operation). More formally, removes an element e such that (o==null ? e==null : o.equals(e)), if the collection contains one or more such elements. Returns true if the collection contained the specified element (or equivalently, if the collection changed as a result of the call).

This implementation iterates over the collection looking for the specified element. If it finds the element, it removes the element from the collection using the iterator's remove method.

Note that this implementation throws an UnsupportedOperationException if the iterator returned by this collection's iterator method does not implement the remove method and this collection contains the specified object.
Parameters:
  o - element to be removed from this collection, if present. true if the collection contained the specifiedelement.




removeFirst
public E removeFirst()(Code)
Removes and returns the first element from this list. the first element from this list.
throws:
  java.util.NoSuchElementException - if this list is empty.



removeLast
public E removeLast()(Code)
Removes and returns the last element from this list. the last element from this list.
throws:
  java.util.NoSuchElementException - if this list is empty.



removeListDataListener
public void removeListDataListener(ListDataListener l)(Code)
Removes a listener from the list that's notified each time a change to the data model occurs.
Parameters:
  l - the ListDataListener to be removed



removeRange
protected void removeRange(int fromIndex, int toIndex)(Code)
Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive. Shifts any succeeding elements to the left (reduces their index). This call shortens the list by (toIndex - fromIndex) elements. (If toIndex==fromIndex, this operation has no effect.)
Parameters:
  fromIndex - index of first element to be removed.
Parameters:
  toIndex - index after last element to be removed.



set
public E set(int index, E element)(Code)
Replaces the element at the specified position in this list with the specified element.
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:
  IndexOutOfBoundsException - if index out of range(index < 0 || index >= size()).



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