Java Doc for BoundList.java in  » GIS » GeoTools-2.4.1 » org » apache » commons » events » observable » 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 » GIS » GeoTools 2.4.1 » org.apache.commons.events.observable 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.commons.events.observable.BoundCollection
   org.apache.commons.events.observable.BoundList

BoundList
public class BoundList extends BoundCollection implements List(Code)
Decorates a List interface with a bound property called "collection".

Each modifying method call made on this List is handled as a change to the "collection" property. This facility serves to notify subscribers of a change to the collection but does not allow users the option of vetoing the change. To gain the ability to veto the change, use a ConstrainedList decorater.

Registered listeners must implement the java.beans.PropertyChangeListener interface. Each change request causes a CollectionChangeEvent to be fired after the request has been executed. The CollectionChangeEvent provides an indication of the type of change, the element participating in the change, and whether or not the List was actually affected by the change request. As such, receiving a CollectionChangeEvent is merely an indication that a change was attempted, not that the List is actually different.


See Also:   BoundCollection
See Also:   CollectionChangeEvent
since:
   Commons Events 1.0
version:
   $Revision$ $Date$
author:
   Stephen Colebourne, Bryce Nordgren

Inner Class :protected class BoundListIterator extends AbstractListIteratorDecorator


Constructor Summary
protected  BoundList(List source, CollectionChangeEventFactory eventFactory)
     Constructor that wraps (not copies.)
Parameters:
  source - the List to decorate, must not be null
Parameters:
  eventFactory - the factory which instantiates CollectionChangeEvents.
protected  BoundList(List source)
    

Method Summary
public  voidadd(int index, Object object)
    

Inserts an object at the specified index (optional operation).

public  booleanaddAll(int index, Collection coll)
    

Inserts all of the elements in the specified collection into this list at the specified position (optional operation).

public static  BoundListdecorate(List source)
    
public static  BoundListdecorate(List source, CollectionChangeEventFactory eventFactory)
    
public  Objectget(int index)
    
public  intindexOf(Object object)
    
public  intlastIndexOf(Object object)
    
public  ListIteratorlistIterator()
    
public  ListIteratorlistIterator(int index)
    
public  Objectremove(int index)
    

Removes the element at the specified position in this list (optional operation).

public  Objectset(int index, Object object)
    

Replaces the element at the specified position in this list with the specified element (optional operation).

public  ListsubList(int fromIndex, int toIndex)
    

Returns a view of the portion of this list between fromIndex, inclusive, and toIndex, exclusive.



Constructor Detail
BoundList
protected BoundList(List source, CollectionChangeEventFactory eventFactory)(Code)
Constructor that wraps (not copies.)
Parameters:
  source - the List to decorate, must not be null
Parameters:
  eventFactory - the factory which instantiates CollectionChangeEvents.
throws:
  IllegalArgumentException - if the collection is null
throws:
  UnsupportedOperationException - if the eventFactoryhas already been used with another collection decorator.



BoundList
protected BoundList(List source)(Code)
Constructor that wraps (not copies.)
Parameters:
  source - the List to decorate, must not be null
throws:
  IllegalArgumentException - if the collection is null




Method Detail
add
public void add(int index, Object object)(Code)

Inserts an object at the specified index (optional operation). This method is assumed to succeed if no exceptions are thrown. It is important to note that it is impossible to document all cases where an exception is thrown, as this is totally determined by the implementation class of the decorated List. See the documentation for the decorated List for details.

This method will only fire a CollectionChangeEvent if the operation succeeds. Therefore, calling this method will always result in a CollectionChangeEvent or an exception from the decorated list. An exception prevents the CollectionChangeEvent from being fired.


Parameters:
  index - The index at which to insert the object.
Parameters:
  object - The object to insert in the list.
throws:
  IndexOutOfBoundsException - if the index does not represent a position in the List.
throws:
  UnsupportedOperationException - if the decorated list doesnot support this optional operation.



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

Inserts all of the elements in the specified collection into this list at the specified position (optional operation).

This method will only fire a CollectionChangeEvent if the decorated list completes the call normally. Therefore, calling this method will always result in a CollectionChangeEvent or an exception from the decorated list. An exception prevents the CollectionChangeEvent from being fired. Unlike the BoundList.add(int index,Object object) method, however, an event may be fired when the collection has not changed. It is therefore important to check the CollectionChangeEvent.isChanged() flag.


Parameters:
  index - The index at which to insert the collection.
Parameters:
  coll - The collection of objects to insert in the list.
throws:
  IndexOutOfBoundsException - if the index does not represent a position in the List.
throws:
  UnsupportedOperationException - if the decorated list doesnot support this optional operation.



decorate
public static BoundList decorate(List source)(Code)



decorate
public static BoundList decorate(List source, CollectionChangeEventFactory eventFactory)(Code)



get
public Object get(int index)(Code)



indexOf
public int indexOf(Object object)(Code)



lastIndexOf
public int lastIndexOf(Object object)(Code)



listIterator
public ListIterator listIterator()(Code)



listIterator
public ListIterator listIterator(int index)(Code)



remove
public Object remove(int index)(Code)

Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

This method will only fire a CollectionChangeEvent if the operation succeeds. Therefore, calling this method will always result in a CollectionChangeEvent or an exception from the decorated list. An exception prevents the CollectionChangeEvent from being fired.


Parameters:
  index - The index of the element to remove. The object which was removed from the list.
throws:
  IndexOutOfBoundsException - if the index does not represent a position in the List.
throws:
  UnsupportedOperationException - if the decorated list doesnot support this optional operation.



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

Replaces the element at the specified position in this list with the specified element (optional operation).

This method will only fire a CollectionChangeEvent if the operation succeeds. Therefore, calling this method will always result in a CollectionChangeEvent or an exception from the decorated list. An exception prevents the CollectionChangeEvent from being fired.


Parameters:
  index - The index of the element to change.
Parameters:
  object - The new value to place at location index. The object formerly at location index.
throws:
  IndexOutOfBoundsException - if the index does not represent a position in the List.
throws:
  UnsupportedOperationException - if the decorated list doesnot support this optional operation.



subList
public List subList(int fromIndex, int toIndex)(Code)

Returns a view of the portion of this list between fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list.

Because changes in the subList are reflected in the list, this decorator implementation ensures that listeners registered with this list are notified of changes made through the sublist interface. Changes caused by the sub list view will create events which have the sub list as the source property. This is likely to be important as the view causing the change will impact the indicies of any indexed events. The indices are consistent with the List view specified as the source object.

Listeners may be added or removed from the main list before or after the sub list is created. Events will be fired to listeners registered at the time of the event, not at the time the sublist was created. Listeners may also be added separately to the sublist, if desired.


Parameters:
  fromIndex - first index included in the sublist view
Parameters:
  toIndex - first index not included in the sublist view. The sublist view backed by this list.



Fields inherited from org.apache.commons.events.observable.BoundCollection
final protected CollectionChangeEventFactory eventFactory(Code)(Java Doc)

Methods inherited from org.apache.commons.events.observable.BoundCollection
public boolean add(Object element)(Code)(Java Doc)
public boolean addAll(Collection element)(Code)(Java Doc)
public void addPropertyChangeListener(PropertyChangeListener l)(Code)(Java Doc)
public void clear()(Code)(Java Doc)
EventRepeater createEventRepeater()(Code)(Java Doc)
public static BoundCollection decorate(Collection coll)(Code)(Java Doc)
public static BoundCollection decorate(Collection coll, CollectionChangeEventFactory eventFactory)(Code)(Java Doc)
protected void firePropertyChange(PropertyChangeEvent evt)(Code)(Java Doc)
public Iterator iterator()(Code)(Java Doc)
public boolean remove(Object element)(Code)(Java Doc)
public boolean removeAll(Collection element)(Code)(Java Doc)
public void removePropertyChangeListener(PropertyChangeListener l)(Code)(Java Doc)
public boolean retainAll(Collection element)(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.