Java Doc for ConcurrentReferenceHashMap.java in  » Database-ORM » openjpa » org » apache » openjpa » lib » util » concurrent » 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 » Database ORM » openjpa » org.apache.openjpa.lib.util.concurrent 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.AbstractMap
      org.apache.openjpa.lib.util.concurrent.ConcurrentReferenceHashMap

ConcurrentReferenceHashMap
public class ConcurrentReferenceHashMap extends AbstractMap implements ConcurrentMap,ReferenceMap,SizedMap,Cloneable(Code)
This class implements a HashMap which has limited synchronization and reference keys or values(but not both). In particular mutators are generally synchronized while accessors are generally not. Additionally the Iterators returned by this class are not "fail-fast", but instead try to continue to iterate over the data structure after changes have been made. Finally purging of the reference queue is only done inside mutators. Null keys are not supported if keys use references. Null values are not supported if values use references. This class is based heavily on the WeakHashMap class in the Java collections package.


Field Summary
final static  double[]RANDOMS
     Cache of random numbers used in "random" methods, since generating them is expensive.

Constructor Summary
public  ConcurrentReferenceHashMap(int keyType, int valueType, int initialCapacity, float loadFactor)
     Constructs a new, empty HashMap with the specified initial capacity and the specified load factor.
public  ConcurrentReferenceHashMap(int keyType, int valueType, int initialCapacity)
     Constructs a new, empty HashMap with the specified initial capacity and default load factor.
public  ConcurrentReferenceHashMap(int keyType, int valueType)
     Constructs a new, empty HashMap with a default capacity and load factor.
public  ConcurrentReferenceHashMap(int keyType, int valueType, Map t)
     Constructs a new HashMap with the same mappings as the given Map.

Method Summary
 intcapacity()
    
public synchronized  voidclear()
     Removes all mappings from this HashMap.
public synchronized  Objectclone()
     Returns a shallow copy of this HashMap.
public  booleancontainsKey(Object key)
     Returns true if this HashMap contains a mapping for the specified key.
public  booleancontainsValue(Object value)
     Returns true if this HashMap maps one or more keys to the specified value.
public  SetentrySet()
     Returns a Collection view of the mappings contained in this HashMap. Each element in the returned collection is a Map.Entry.
protected  booleaneq(Object x, Object y)
     Compare two objects.
public  Objectget(Object key)
     Returns the value to which this HashMap maps the specified key.
public  intgetMaxSize()
    
protected  inthc(Object o)
     Obtain the hashcode of an object.
public  booleanisEmpty()
     Returns true if this Map contains no key-value mappings.
public  booleanisFull()
    
public  voidkeyExpired(Object value)
    
public  SetkeySet()
     Returns a Set view of the keys contained in this HashMap.
 floatloadFactor()
    
public  voidoverflowRemoved(Object key, Object value)
    
public  Objectput(Object key, Object value)
     Associates the specified value with the specified key in this HashMap. If the HashMap previously contained a mapping for this key, the old value is replaced.
Parameters:
  key - key with which the specified value is to be associated.
Parameters:
  value - value to be associated with the specified key.
public  voidputAll(Map t)
     Copies all of the mappings from the specified Map to this HashMap These mappings will replace any mappings that this HashMap had for any of the keys currently in the specified Map.
public  IteratorrandomEntryIterator()
    
public  Objectremove(Object key)
     Removes the mapping for this key from this HashMap if present.
Parameters:
  key - key whose mapping is to be removed from the Map.
public  voidremoveExpired()
    
public  Map.EntryremoveRandom()
    
public  voidsetMaxSize(int maxSize)
    
public  intsize()
     Returns the number of key-value mappings in this Map.
public  voidvalueExpired(Object key)
    
public  Collectionvalues()
     Returns a Collection view of the values contained in this HashMap. The Collection is backed by the HashMap, so changes to the HashMap are reflected in the Collection, and vice-versa.

Field Detail
RANDOMS
final static double[] RANDOMS(Code)
Cache of random numbers used in "random" methods, since generating them is expensive. We hope each map changes enough between cycling through this list that the overall effect is random enough.




Constructor Detail
ConcurrentReferenceHashMap
public ConcurrentReferenceHashMap(int keyType, int valueType, int initialCapacity, float loadFactor)(Code)
Constructs a new, empty HashMap with the specified initial capacity and the specified load factor.
Parameters:
  keyType - the reference type of map keys
Parameters:
  valueType - the reference type of map values
Parameters:
  initialCapacity - the initial capacity of the HashMap.
Parameters:
  loadFactor - a number between 0.0 and 1.0.
throws:
  IllegalArgumentException - if neither keys nor values use hardreferences, if the initial capacity is less than or equal to zero, or ifthe load factor is less than or equal to zero



ConcurrentReferenceHashMap
public ConcurrentReferenceHashMap(int keyType, int valueType, int initialCapacity)(Code)
Constructs a new, empty HashMap with the specified initial capacity and default load factor.
Parameters:
  keyType - the reference type of map keys
Parameters:
  valueType - the reference type of map values
Parameters:
  initialCapacity - the initial capacity of the HashMap.



ConcurrentReferenceHashMap
public ConcurrentReferenceHashMap(int keyType, int valueType)(Code)
Constructs a new, empty HashMap with a default capacity and load factor.
Parameters:
  keyType - the reference type of map keys
Parameters:
  valueType - the reference type of map values



ConcurrentReferenceHashMap
public ConcurrentReferenceHashMap(int keyType, int valueType, Map t)(Code)
Constructs a new HashMap with the same mappings as the given Map. The HashMap is created with a capacity of thrice the number of entries in the given Map or 11 (whichever is greater), and a default load factor.
Parameters:
  keyType - the reference type of map keys
Parameters:
  valueType - the reference type of map values




Method Detail
capacity
int capacity()(Code)



clear
public synchronized void clear()(Code)
Removes all mappings from this HashMap.



clone
public synchronized Object clone()(Code)
Returns a shallow copy of this HashMap. The keys and values themselves are not cloned.



containsKey
public boolean containsKey(Object key)(Code)
Returns true if this HashMap contains a mapping for the specified key.
Parameters:
  key - key whose presence in this Map is to be tested.



containsValue
public boolean containsValue(Object value)(Code)
Returns true if this HashMap maps one or more keys to the specified value.
Parameters:
  value - value whose presence in this Map is to be tested.



entrySet
public Set entrySet()(Code)
Returns a Collection view of the mappings contained in this HashMap. Each element in the returned collection is a Map.Entry. The Collection is backed by the HashMap, so changes to the HashMap are reflected in the Collection, and vice-versa. The Collection supports element removal, which removes the corresponding mapping from the HashMap, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.
See Also:   Map.Entry



eq
protected boolean eq(Object x, Object y)(Code)
Compare two objects. These might be keys, values, or Entry instances. This implementation uses a normal null-safe object equality algorithm.
since:
   1.0.0



get
public Object get(Object key)(Code)
Returns the value to which this HashMap maps the specified key. Returns null if the HashMap contains no mapping for this key.
Parameters:
  key - key whose associated value is to be returned.



getMaxSize
public int getMaxSize()(Code)



hc
protected int hc(Object o)(Code)
Obtain the hashcode of an object. The object might be a key, a value, or an Entry. This implementation just delegates to Object.hashCode
since:
   1.0.0



isEmpty
public boolean isEmpty()(Code)
Returns true if this Map contains no key-value mappings. This result is a snapshot, and may not reflect unprocessed entries that will be removed before next attempted access because they are no longer referenced.



isFull
public boolean isFull()(Code)



keyExpired
public void keyExpired(Object value)(Code)



keySet
public Set keySet()(Code)
Returns a Set view of the keys contained in this HashMap. The Set is backed by the HashMap, so changes to the HashMap are reflected in the Set, and vice-versa. The Set supports element removal, which removes the corresponding mapping from the HashMap, via the Iterator.remove, Set.remove, removeAll retainAll, and clear operations. It does not support the add or addAll operations.



loadFactor
float loadFactor()(Code)



overflowRemoved
public void overflowRemoved(Object key, Object value)(Code)



put
public Object put(Object key, Object value)(Code)
Associates the specified value with the specified key in this HashMap. If the HashMap previously contained a mapping for this key, the old value is replaced.
Parameters:
  key - key with which the specified value is to be associated.
Parameters:
  value - value to be associated with the specified key. previous value associated with specified key, or null if therewas no mapping for key. A null return can also indicate thatthe HashMap previously associated null with the specified key.



putAll
public void putAll(Map t)(Code)
Copies all of the mappings from the specified Map to this HashMap These mappings will replace any mappings that this HashMap had for any of the keys currently in the specified Map.
Parameters:
  t - Mappings to be stored in this Map.



randomEntryIterator
public Iterator randomEntryIterator()(Code)



remove
public Object remove(Object key)(Code)
Removes the mapping for this key from this HashMap if present.
Parameters:
  key - key whose mapping is to be removed from the Map. previous value associated with specified key, or null if therewas no mapping for key. A null return can also indicate thatthe HashMap previously associated null with the specified key.



removeExpired
public void removeExpired()(Code)



removeRandom
public Map.Entry removeRandom()(Code)



setMaxSize
public void setMaxSize(int maxSize)(Code)



size
public int size()(Code)
Returns the number of key-value mappings in this Map. This result is a snapshot, and may not reflect unprocessed entries that will be removed before next attempted access because they are no longer referenced.



valueExpired
public void valueExpired(Object key)(Code)



values
public Collection values()(Code)
Returns a Collection view of the values contained in this HashMap. The Collection is backed by the HashMap, so changes to the HashMap are reflected in the Collection, and vice-versa. The Collection supports element removal, which removes the corresponding mapping from the HashMap, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.



Methods inherited from java.util.AbstractMap
public void clear()(Code)(Java Doc)
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean containsKey(Object key)(Code)(Java Doc)
public boolean containsValue(Object value)(Code)(Java Doc)
abstract public Set<Entry<K, V>> entrySet()(Code)(Java Doc)
public boolean equals(Object o)(Code)(Java Doc)
public V get(Object key)(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean isEmpty()(Code)(Java Doc)
public Set<K> keySet()(Code)(Java Doc)
public V put(K key, V value)(Code)(Java Doc)
public void putAll(Map<? extends K, ? extends V> m)(Code)(Java Doc)
public V remove(Object key)(Code)(Java Doc)
public int size()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public Collection<V> values()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(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.