Java Doc for IdentifiedObjectSet.java in  » GIS » GeoTools-2.4.1 » org » geotools » referencing » factory » 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.geotools.referencing.factory 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.util.AbstractSet
   org.geotools.referencing.factory.IdentifiedObjectSet

All known Subclasses:   org.geotools.referencing.factory.epsg.CoordinateOperationSet,
IdentifiedObjectSet
public class IdentifiedObjectSet extends AbstractSet implements Serializable(Code)
A lazy set of . This set creates IdentifiedObject s from authority codes only when first needed. This class is typically used as the set returned by implementations of the CoordinateOperationAuthorityFactory.createFromCoordinateReferenceSystemCodescreateFromCoordinateReferenceSystemCodes method. Deferred creation in this case may have great performance impact since a set may contains about 40 entries (e.g. transformations from "ED50" (EPSG:4230) to "WGS 84" (EPSG:4326)) while some users only want to look for the first entry (e.g. the default org.geotools.referencing.operation.AuthorityBackedFactory implementation).

Exception handling

If the underlying factory failed to creates an object because of an unsupported operation method ( NoSuchIdentifierException ), the exception is logged with the Level.FINE FINE level (because this is a recoverable failure) and the iteration continue. If the operation creation failed for any other kind of reason ( FactoryException ), then the exception is rethrown as an unchecked BackingStoreException . This default behavior can be changed if a subclass overrides the IdentifiedObjectSet.isRecoverableFailure isRecoverableFailure method.

Serialization

Serialization of this class forces the immediate creation of all not yet created. The serialized set is disconnected from the .

Thread safety

This class is not thread-safe.
since:
   2.2
version:
   $Id: IdentifiedObjectSet.java 23635 2007-01-01 20:58:15Z desruisseaux $
author:
   Martin Desruisseaux


Field Summary
final protected  AuthorityFactoryfactory
     The factory to use for creating when first needed.

Constructor Summary
public  IdentifiedObjectSet(AuthorityFactory factory)
     Creates an initially empty set.

Method Summary
public  booleanadd(Object object)
     Ensures that this collection contains the specified object.
public  booleanaddAuthorityCode(String code)
     Ensures that this collection contains an object for the specified authority code. The will be created from the specified code only when first needed.
public  voidclear()
     Removes all of the elements from this collection.
public  booleancontains(Object object)
     Returns true if this collection contains the specified object.
protected  IdentifiedObjectcreateObject(String code)
     Creates an object for the specified authority code.
protected  StringgetAuthorityCode(IdentifiedObject object)
     Returns the code to uses as a key for the specified object.
public  String[]getAuthorityCodes()
     Returns the of all objects in this set. The returned array contains the codes in iteration order.
protected  booleanisRecoverableFailure(FactoryException exception)
     Returns true if the specified exception should be handled as a recoverable failure. This method is invoked during the iteration process if the factory failed to create some object.
public  Iteratoriterator()
     Returns an iterator over the objects in this set.
static  voidlog(FactoryException exception, String code)
     Log an message for the specified exception.
public  booleanremove(Object object)
     Removes a single instance of the specified element from this collection, if it is present.
public  booleanremoveAll(Collection collection)
     Removes from this collection all of its elements that are contained in the specified collection.
public  voidresolve(int n)
     Ensures that the n first objects in this set are created.
public  voidsetAuthorityCodes(String[] codes)
     Set the content of this set as an array of authority codes.
public  intsize()
     Returns the number of objects available in this set.
protected  ObjectwriteReplace()
     Returns a serializable copy of this set.

Field Detail
factory
final protected AuthorityFactory factory(Code)
The factory to use for creating when first needed.




Constructor Detail
IdentifiedObjectSet
public IdentifiedObjectSet(AuthorityFactory factory)(Code)
Creates an initially empty set. The s will be created when first needed using the specified factory.
Parameters:
  factory - The factory to use for deferred IdentifiedObjects creations.




Method Detail
add
public boolean add(Object object)(Code)
Ensures that this collection contains the specified object. This set do not allows multiple objects for the same . If this set already contains an object using the same than the specified one, then the old object is replaced by the new one even if the objects are not otherwise identical.



addAuthorityCode
public boolean addAuthorityCode(String code)(Code)
Ensures that this collection contains an object for the specified authority code. The will be created from the specified code only when first needed. This method returns true if this set changed as a result of this call.



clear
public void clear()(Code)
Removes all of the elements from this collection.



contains
public boolean contains(Object object)(Code)
Returns true if this collection contains the specified object.



createObject
protected IdentifiedObject createObject(String code) throws FactoryException(Code)
Creates an object for the specified authority code. This method is invoked during the iteration process if an object was not already created. The default implementation invokes . AuthorityFactory.createObject createObject (code). Subclasses may override this method if they want to invoke a more specific method.



getAuthorityCode
protected String getAuthorityCode(IdentifiedObject object)(Code)
Returns the code to uses as a key for the specified object. The default implementation returns the code of the first , if any, or the code of the otherwise. Subclasses may overrides this method if they want to use a different key for this set.



getAuthorityCodes
public String[] getAuthorityCodes()(Code)
Returns the of all objects in this set. The returned array contains the codes in iteration order. This method do not trig the of any new object.

This method is typically used together with IdentifiedObjectSet.setAuthorityCodes for altering the iteration order on the basis of authority codes.




isRecoverableFailure
protected boolean isRecoverableFailure(FactoryException exception)(Code)
Returns true if the specified exception should be handled as a recoverable failure. This method is invoked during the iteration process if the factory failed to create some object. If this method returns true for the given exception, then the exception will be logged in the with the Level.FINE FINE level. If this method returns false , then the exception will be retrown as a BackingStoreException . The default implementation returns true only for NoSuchIdentifierException (not to be confused with NoSuchAuthorityCodeException ).



iterator
public Iterator iterator()(Code)
Returns an iterator over the objects in this set. If the iteration encounter any kind of FactoryException other than NoSuchIdentifierException , then the exception will be rethrown as an unchecked BackingStoreException .



log
static void log(FactoryException exception, String code)(Code)
Log an message for the specified exception.



remove
public boolean remove(Object object)(Code)
Removes a single instance of the specified element from this collection, if it is present.



removeAll
public boolean removeAll(Collection collection)(Code)
Removes from this collection all of its elements that are contained in the specified collection.



resolve
public void resolve(int n) throws FactoryException(Code)
Ensures that the n first objects in this set are created. This method is typically invoked after some calls to IdentifiedObjectSet.addAuthorityCode in order to make sure that the is really capable to create at least one object. FactoryException (except the ones accepted as ) are thrown as if they were never wrapped into BackingStoreException .
Parameters:
  n - The number of object to resolve. If this number is equals or greater than the, then the creation of all objects is garanteesuccessful.
throws:
  FactoryException - if an failed.



setAuthorityCodes
public void setAuthorityCodes(String[] codes)(Code)
Set the content of this set as an array of authority codes. For any code in the given list, this method will preserve the corresponding if it was already created. Other objects will be only when first needed, as usual in this IdentifiedObjectSet implementation.

This method is typically used together with IdentifiedObjectSet.getAuthorityCodes for altering the iteration order on the basis of authority codes. If the specified codes array contains the same elements than IdentifiedObjectSet.getAuthorityCodes in a different order, then this method just set the new ordering.
See Also:   IdentifiedObjectSet.addAuthorityCode




size
public int size()(Code)
Returns the number of objects available in this set. Note that this number may decrease during the iteration process if the creation of some failed.



writeReplace
protected Object writeReplace() throws ObjectStreamException(Code)
Returns a serializable copy of this set. This method is invoked automatically during serialization. The serialised set of identified objects is disconnected from the .



Methods inherited from java.util.AbstractSet
public boolean equals(Object o)(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean removeAll(Collection c)(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.