Java Doc for StoredMap.java in  » JMX » je » com » sleepycat » collections » 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 » JMX » je » com.sleepycat.collections 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sleepycat.collections.StoredContainer
      com.sleepycat.collections.StoredMap

All known Subclasses:   com.sleepycat.collections.StoredSortedMap,
StoredMap
public class StoredMap extends StoredContainer implements Map(Code)
A Map view of a Database .

In addition to the standard Map methods, this class provides the following methods for stored maps only. Note that the use of these methods is not compatible with the standard Java collections interface.


author:
   Mark Hayes



Constructor Summary
public  StoredMap(Database database, EntryBinding keyBinding, EntryBinding valueBinding, boolean writeAllowed)
     Creates a map view of a Database .
public  StoredMap(Database database, EntryBinding keyBinding, EntryBinding valueBinding, PrimaryKeyAssigner keyAssigner)
     Creates a map view of a Database with a PrimaryKeyAssigner .
public  StoredMap(Database database, EntryBinding keyBinding, EntityBinding valueEntityBinding, boolean writeAllowed)
     Creates a map entity view of a Database .
public  StoredMap(Database database, EntryBinding keyBinding, EntityBinding valueEntityBinding, PrimaryKeyAssigner keyAssigner)
     Creates a map entity view of a Database with a PrimaryKeyAssigner .
 StoredMap(DataView view)
    

Method Summary
public  Objectappend(Object value)
     Appends a given value returning the newly assigned key.
public  booleancontainsKey(Object key)
     Returns true if this map contains the specified key.
public  booleancontainsValue(Object value)
     Returns true if this map contains the specified value.
public  Collectionduplicates(Object key)
     Returns a new collection containing the values mapped to the given key in this map.
public  MapduplicatesMap(Object secondaryKey, EntryBinding primaryKeyBinding)
     Returns a new map from primary key to value for the subset of records having a given secondary key (duplicates).
public  SetentrySet()
     Returns a set view of the mappings contained in this map.
public  booleanequals(Object other)
     Compares the specified object with this map for equality.
public  Objectget(Object key)
     Returns the value to which this map maps the specified key.
public  inthashCode()
    
 voidinitAfterClone()
     Override this method to initialize view-dependent fields.
public  SetkeySet()
     Returns a set view of the keys contained in this map.
public  Objectput(Object key, Object value)
     Associates the specified value with the specified key in this map (optional operation).
public  voidputAll(Map map)
     Copies all of the mappings from the specified map to this map (optional operation).
public  Objectremove(Object key)
     Removes the mapping for this key from this map if present (optional operation).
public  intsize()
    
public  StringtoString()
     Converts the map to a string representation for debugging.
public  Collectionvalues()
     Returns a collection view of the values contained in this map.


Constructor Detail
StoredMap
public StoredMap(Database database, EntryBinding keyBinding, EntryBinding valueBinding, boolean writeAllowed)(Code)
Creates a map view of a Database .
Parameters:
  database - is the Database underlying the new collection.
Parameters:
  keyBinding - is the binding used to translate between key buffersand key objects.
Parameters:
  valueBinding - is the binding used to translate between valuebuffers and value objects.
Parameters:
  writeAllowed - is true to create a read-write collection or falseto create a read-only collection.
throws:
  IllegalArgumentException - if formats are not consistentlydefined or a parameter is invalid.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



StoredMap
public StoredMap(Database database, EntryBinding keyBinding, EntryBinding valueBinding, PrimaryKeyAssigner keyAssigner)(Code)
Creates a map view of a Database with a PrimaryKeyAssigner . Writing is allowed for the created map.
Parameters:
  database - is the Database underlying the new collection.
Parameters:
  keyBinding - is the binding used to translate between key buffersand key objects.
Parameters:
  valueBinding - is the binding used to translate between valuebuffers and value objects.
Parameters:
  keyAssigner - is used by the StoredMap.append method to assignprimary keys.
throws:
  IllegalArgumentException - if formats are not consistentlydefined or a parameter is invalid.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



StoredMap
public StoredMap(Database database, EntryBinding keyBinding, EntityBinding valueEntityBinding, boolean writeAllowed)(Code)
Creates a map entity view of a Database .
Parameters:
  database - is the Database underlying the new collection.
Parameters:
  keyBinding - is the binding used to translate between key buffersand key objects.
Parameters:
  valueEntityBinding - is the binding used to translate betweenkey/value buffers and entity value objects.
Parameters:
  writeAllowed - is true to create a read-write collection or falseto create a read-only collection.
throws:
  IllegalArgumentException - if formats are not consistentlydefined or a parameter is invalid.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



StoredMap
public StoredMap(Database database, EntryBinding keyBinding, EntityBinding valueEntityBinding, PrimaryKeyAssigner keyAssigner)(Code)
Creates a map entity view of a Database with a PrimaryKeyAssigner . Writing is allowed for the created map.
Parameters:
  database - is the Database underlying the new collection.
Parameters:
  keyBinding - is the binding used to translate between key buffersand key objects.
Parameters:
  valueEntityBinding - is the binding used to translate betweenkey/value buffers and entity value objects.
Parameters:
  keyAssigner - is used by the StoredMap.append method to assignprimary keys.
throws:
  IllegalArgumentException - if formats are not consistentlydefined or a parameter is invalid.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



StoredMap
StoredMap(DataView view)(Code)




Method Detail
append
public Object append(Object value)(Code)
Appends a given value returning the newly assigned key. If a PrimaryKeyAssigner is associated with Store for this map, it will be used to assigned the returned key. Otherwise the Store must be a QUEUE or RECNO database and the next available record number is assigned as the key. This method does not exist in the standard Map interface.

Note that for the JE product, QUEUE and RECNO databases are not supported, and therefore a PrimaryKeyAssigner must be associated with the map in order to call this method.


Parameters:
  value - the value to be appended. the assigned key.
throws:
  UnsupportedOperationException - if the collection is indexed, orif the collection is read-only, or if the Store has no PrimaryKeyAssigner and is not a QUEUE or RECNO database.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



containsKey
public boolean containsKey(Object key)(Code)
Returns true if this map contains the specified key. This method conforms to the Map.containsKey interface.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



containsValue
public boolean containsValue(Object value)(Code)
Returns true if this map contains the specified value. When an entity binding is used, this method returns whether the map contains the primary key and value mapping of the entity. This method conforms to the Map.containsValue interface.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



duplicates
public Collection duplicates(Object key)(Code)
Returns a new collection containing the values mapped to the given key in this map. This collection's iterator() method is particularly useful for iterating over the duplicates for a given key, since this is not supported by the standard Map interface. This method does not exist in the standard Map interface.

If no mapping for the given key is present, an empty collection is returned. If duplicates are not allowed, at most a single value will be in the collection returned. If duplicates are allowed, the returned collection's add() method may be used to add values for the given key.


Parameters:
  key - is the key for which values are to be returned.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



duplicatesMap
public Map duplicatesMap(Object secondaryKey, EntryBinding primaryKeyBinding)(Code)
Returns a new map from primary key to value for the subset of records having a given secondary key (duplicates). This method does not exist in the standard Map interface.

If no mapping for the given key is present, an empty collection is returned. If duplicates are not allowed, at most a single value will be in the collection returned. If duplicates are allowed, the returned collection's add() method may be used to add values for the given key.


Parameters:
  secondaryKey - is the secondary key for which duplicates valueswill be represented by the returned map.
Parameters:
  primaryKeyBinding - is the binding used for keys in the returnedmap.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



entrySet
public Set entrySet()(Code)
Returns a set view of the mappings contained in this map. A java.util.SortedSet is returned if the map is ordered. The returned collection will be read-only if the map is read-only. This method conforms to the Map.entrySet interface.

Note that the return value is a StoredCollection and must be treated as such; for example, its iterators must be explicitly closed.

a StoredEntrySet or a StoredSortedEntrySet forthis map.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.
See Also:   StoredMap.isOrdered
See Also:   StoredMap.isWriteAllowed



equals
public boolean equals(Object other)(Code)
Compares the specified object with this map for equality. A value comparison is performed by this method and the stored values are compared rather than calling the equals() method of each element. This method conforms to the Map.equals interface.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



get
public Object get(Object key)(Code)
Returns the value to which this map maps the specified key. If duplicates are allowed, this method returns the first duplicate, in the order in which duplicates are configured, that maps to the specified key. This method conforms to the Map.get interface.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



hashCode
public int hashCode()(Code)



initAfterClone
void initAfterClone()(Code)
Override this method to initialize view-dependent fields.



keySet
public Set keySet()(Code)
Returns a set view of the keys contained in this map. A java.util.SortedSet is returned if the map is ordered. The returned collection will be read-only if the map is read-only. This method conforms to the Map.keySet interface.

Note that the return value is a StoredCollection and must be treated as such; for example, its iterators must be explicitly closed.

a StoredKeySet or a StoredSortedKeySet for thismap.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.
See Also:   StoredMap.isOrdered
See Also:   StoredMap.isWriteAllowed



put
public Object put(Object key, Object value)(Code)
Associates the specified value with the specified key in this map (optional operation). If duplicates are allowed and the specified key is already mapped to a value, this method appends the new duplicate after the existing duplicates. This method conforms to the Map.put interface.

The key parameter may be null if an entity binding is used and the key will be derived from the value (entity) parameter. If an entity binding is used and the key parameter is non-null, then the key parameter must be equal to the key derived from the value parameter.

the previous value associated with specified key, or null ifthere was no mapping for the key or if duplicates are allowed.
throws:
  UnsupportedOperationException - if the collection is indexed, orif the collection is read-only.
throws:
  IllegalArgumentException - if an entity value binding is used andthe primary key of the value given is different than the existing storedprimary key.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



putAll
public void putAll(Map map)(Code)
Copies all of the mappings from the specified map to this map (optional operation). When duplicates are allowed, the mappings in the specified map are effectively appended to the existing mappings in this map, that is no previously existing mappings in this map are replaced. This method conforms to the Map.putAll interface.
throws:
  UnsupportedOperationException - if the collection is read-only, orif the collection is indexed.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



remove
public Object remove(Object key)(Code)
Removes the mapping for this key from this map if present (optional operation). If duplicates are allowed, this method removes all duplicates for the given key. This method conforms to the Map.remove interface.
throws:
  UnsupportedOperationException - if the collection is read-only.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



size
public int size()(Code)



toString
public String toString()(Code)
Converts the map to a string representation for debugging. WARNING: All mappings will be converted to strings and returned and therefore the returned string may be very large. the string representation.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.



values
public Collection values()(Code)
Returns a collection view of the values contained in this map. A java.util.SortedSet is returned if the map is ordered and the value/entity binding can be used to derive the map's key from its value/entity object. The returned collection will be read-only if the map is read-only. This method conforms to the Map.values interface.

Note that the return value is a StoredCollection and must be treated as such; for example, its iterators must be explicitly closed.

a StoredValueSet or a StoredSortedValueSet forthis map.
throws:
  RuntimeExceptionWrapper - if a com.sleepycat.je.DatabaseException is thrown.
See Also:   StoredMap.isOrdered
See Also:   StoredMap.isWriteAllowed



Fields inherited from com.sleepycat.collections.StoredContainer
DataView view(Code)(Java Doc)

Methods inherited from com.sleepycat.collections.StoredContainer
final public boolean areDuplicatesAllowed()(Code)(Java Doc)
final public boolean areDuplicatesOrdered()(Code)(Java Doc)
final public boolean areKeysRenumbered()(Code)(Java Doc)
final boolean beginAutoCommit()(Code)(Java Doc)
public void clear()(Code)(Java Doc)
final void closeCursor(DataCursor cursor)(Code)(Java Doc)
final void commitAutoCommit(boolean doAutoCommit) throws DatabaseException(Code)(Java Doc)
final StoredContainer configuredClone(CursorConfig config)(Code)(Java Doc)
boolean containsKey(Object key)(Code)(Java Doc)
boolean containsValue(Object value)(Code)(Java Doc)
static RuntimeException convertException(Exception e)(Code)(Java Doc)
Object get(Object key)(Code)(Java Doc)
final public CursorConfig getCursorConfig()(Code)(Java Doc)
final RuntimeException handleException(Exception e, boolean doAutoCommit)(Code)(Java Doc)
void initAfterClone()(Code)(Java Doc)
final public boolean isDirtyRead()(Code)(Java Doc)
final public boolean isDirtyReadAllowed()(Code)(Java Doc)
public boolean isEmpty()(Code)(Java Doc)
final public boolean isOrdered()(Code)(Java Doc)
final public boolean isSecondary()(Code)(Java Doc)
final public boolean isTransactional()(Code)(Java Doc)
final public boolean isWriteAllowed()(Code)(Java Doc)
Object put(Object key, Object value)(Code)(Java Doc)
final boolean removeKey(Object key, Object[] oldVal)(Code)(Java Doc)
final boolean removeValue(Object value)(Code)(Java Doc)
abstract public int size()(Code)(Java Doc)
final Iterator storedOrExternalIterator(Collection coll)(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.