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


java.util.AbstractSet
   org.geotools.util.WeakHashSet

All known Subclasses:   org.geotools.util.CanonicalSet,
WeakHashSet
public class WeakHashSet extends AbstractSet (Code)
A set of objects hold by weak references. An entry in a WeakHashSet will automatically be removed when it is no longer in ordinary use. More precisely, the presence of an entry will not prevent the entry from being discarded by the garbage collector, that is, made finalizable, finalized, and then reclaimed. When an entry has been discarded it is effectively removed from the set, so this class behaves somewhat differently than other Set implementations.

If you would like to use WeakHashSet as inside a factory to prevent creating duplicate immutable objects, please look at the CanonicalSet subclass.

The WeakHashSet class is thread-safe.
since:
   2.0
version:
   $Id: WeakHashSet.java 27862 2007-11-12 19:51:19Z desruisseaux $
author:
   Martin Desruisseaux
See Also:   WeakHashMap



Field Summary
final static  intADD
     The "add" operation.
final static  intGET
     The "get" operation.
final static  intINTERN
     The "intern" operation.
final static  intREMOVE
     The "remove" operation.

Constructor Summary
public  WeakHashSet()
     Constructs a WeakHashSet .

Method Summary
public synchronized  booleanadd(Object obj)
     Adds the specified element to this set if it is not already present. If this set already contains the specified element, the call leaves this set unchanged and returns false .
Parameters:
  obj - Element to be added to this set.
public synchronized  Objectcanonicalize(Object object)
     Returns an object equals to object if such an object already exist in this WeakHashSet .
public synchronized  voidcanonicalize(Object[] objects)
     Iteratively call WeakHashSet.canonicalize(Object) for an array of objects.
public synchronized  voidclear()
     Removes all of the elements from this set.
public  booleancontains(Object obj)
     Returns true if this set contains the specified element.
Parameters:
  obj - Object to be checked for containment in this set.
public synchronized  Objectget(Object obj)
     Returns an object equals to the specified object, if present.
final  Objectintern(Object obj, int operation)
     Returns an object equals to obj if such an object already exist in this WeakHashSet .
public  Iteratoriterator()
     Returns an iterator over the elements contained in this collection.
public synchronized  booleanremove(Object obj)
     Removes a single instance of the specified element from this set, if it is present
Parameters:
  obj - element to be removed from this set, if present.
public synchronized  intsize()
     Returns the count of element in this set.
public synchronized  Object[]toArray()
     Returns a view of this set as an array.

Field Detail
ADD
final static int ADD(Code)
The "add" operation.



GET
final static int GET(Code)
The "get" operation.



INTERN
final static int INTERN(Code)
The "intern" operation.



REMOVE
final static int REMOVE(Code)
The "remove" operation.




Constructor Detail
WeakHashSet
public WeakHashSet()(Code)
Constructs a WeakHashSet .




Method Detail
add
public synchronized boolean add(Object obj)(Code)
Adds the specified element to this set if it is not already present. If this set already contains the specified element, the call leaves this set unchanged and returns false .
Parameters:
  obj - Element to be added to this set. true if this set did not alreadycontain the specified element.



canonicalize
public synchronized Object canonicalize(Object object)(Code)
Returns an object equals to object if such an object already exist in this WeakHashSet . Otherwise, adds object to this WeakHashSet . This method is equivalents to the following code:
    if (object != null) {
        Object current = get(object);
        if (current != null) {
            return current;
        } else {
            add(object);
        }
    }
    return object;
 
CanonicalSet



canonicalize
public synchronized void canonicalize(Object[] objects)(Code)
Iteratively call WeakHashSet.canonicalize(Object) for an array of objects. This method is equivalents to the following code:
    for (int i=0; i
CanonicalSet



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



contains
public boolean contains(Object obj)(Code)
Returns true if this set contains the specified element.
Parameters:
  obj - Object to be checked for containment in this set. true if this set contains the specified element.



get
public synchronized Object get(Object obj)(Code)
Returns an object equals to the specified object, if present. If this set doesn't contains any object equals to obj , then this method returns null . CanonicalSet



intern
final Object intern(Object obj, int operation)(Code)
Returns an object equals to obj if such an object already exist in this WeakHashSet . Otherwise, add obj to this WeakHashSet . This method is equivalents to the following code:
    if (object!=null) {
        final Object current = get(object);
        if (current != null) {
            return current;
        } else {
            add(object);
        }
    }
    return object;
 



iterator
public Iterator iterator()(Code)
Returns an iterator over the elements contained in this collection. No element from this set will be garbage collected as long as a reference to the iterator is hold.



remove
public synchronized boolean remove(Object obj)(Code)
Removes a single instance of the specified element from this set, if it is present
Parameters:
  obj - element to be removed from this set, if present. true if the set contained the specified element.



size
public synchronized int size()(Code)
Returns the count of element in this set.



toArray
public synchronized Object[] toArray()(Code)
Returns a view of this set as an array. Elements will be in an arbitrary order. Note that this array contains strong reference. Consequently, no object reclamation will occurs as long as a reference to this array is hold.



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.