Java Doc for StoredCollection.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.StoredCollection

All known Subclasses:   com.sleepycat.collections.StoredEntrySet,  com.sleepycat.collections.StoredValueSet,  com.sleepycat.collections.StoredKeySet,  com.sleepycat.collections.StoredList,
StoredCollection
abstract public class StoredCollection extends StoredContainer implements Collection(Code)
A abstract base class for all stored collections. This class, and its base class StoredContainer , provide implementations of most methods in the Collection interface. Other methods, such as StoredCollection.add and StoredCollection.remove , are provided by concrete classes that extend this class.

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


author:
   Mark Hayes


Field Summary
final public static  intDEFAULT_ITERATOR_BLOCK_SIZE
     The default number of records read at one time by iterators.

Constructor Summary
 StoredCollection(DataView view)
    

Method Summary
final  booleanadd(Object key, Object value)
    
public  booleanaddAll(Collection coll)
     Adds all of the elements in the specified collection to this collection (optional operation).
 BlockIteratorblockIterator()
    
 voidcheckIterAddAllowed()
    
public  booleancontainsAll(Collection coll)
     Returns true if this collection contains all of the elements in the specified collection.
public  booleanequals(Object other)
     Compares the specified object with this collection for equality.
final  ObjectgetFirstOrLast(boolean doGetFirst)
    
 intgetIndexOffset()
    
public  intgetIteratorBlockSize()
     Returns the number of records read at one time by iterators returned by the StoredCollection.iterator method.
abstract  booleanhasValues()
    
public  inthashCode()
    
 booleaniterateDuplicates()
    
public  Iteratoriterator()
     Returns an iterator over the elements in this collection. The iterator will be read-only if the collection is read-only. This method conforms to the Collection.iterator interface.

The iterator returned by this method does not keep a database cursor open and therefore it does not need to be closed.

public  StoredIteratoriterator(boolean writeAllowed)
    
public  StoredIteratorjoin(StoredContainer[] indices, Object[] indexKeys, JoinConfig joinConfig)
     Returns an iterator representing an equality join of the indices and index key values specified. This method does not exist in the standard Collection interface.

Warning: The iterator returned must be explicitly closed using StoredIterator.close or StoredIterator.close(java.util.Iterator) to release the underlying database cursor resources.

The returned iterator supports only the two methods: hasNext() and next().

 ObjectmakeIteratorData(BaseIterator iterator, DataCursor cursor)
    
abstract  ObjectmakeIteratorData(BaseIterator iterator, DatabaseEntry keyEntry, DatabaseEntry priKeyEntry, DatabaseEntry valueEntry)
    
public  booleanremoveAll(Collection coll)
     Removes all this collection's elements that are also contained in the specified collection (optional operation).
public  booleanretainAll(Collection coll)
     Retains only the elements in this collection that are contained in the specified collection (optional operation).
public  voidsetIteratorBlockSize(int blockSize)
     Changes the number of records read at one time by iterators returned by the StoredCollection.iterator method.
public  intsize()
    
public  StoredIteratorstoredIterator()
     Returns an iterator over the elements in this collection.
public  StoredIteratorstoredIterator(boolean writeAllowed)
     Returns a read or read-write iterator over the elements in this collection. This method does not exist in the standard Collection interface.

If Iterater.set or Iterator.remove will be called and the underlying Database is transactional, then a transaction must be active when calling this method and must remain active while using the iterator.

Warning: The iterator returned must be explicitly closed using StoredIterator.close or StoredIterator.close(java.util.Iterator) to release the underlying database cursor resources.


Parameters:
  writeAllowed - is true to open a read-write iterator or false toopen a read-only iterator.
public  Object[]toArray()
     Returns an array of all the elements in this collection.
public  Object[]toArray(Object[] a)
     Returns an array of all the elements in this collection whose runtime type is that of the specified array.
public  ListtoList()
     Returns a copy of this collection as an ArrayList.
public  StringtoString()
     Converts the collection to a string representation for debugging.

Field Detail
DEFAULT_ITERATOR_BLOCK_SIZE
final public static int DEFAULT_ITERATOR_BLOCK_SIZE(Code)
The default number of records read at one time by iterators.
See Also:   StoredCollection.setIteratorBlockSize




Constructor Detail
StoredCollection
StoredCollection(DataView view)(Code)




Method Detail
add
final boolean add(Object key, Object value)(Code)



addAll
public boolean addAll(Collection coll)(Code)
Adds all of the elements in the specified collection to this collection (optional operation). This method calls the StoredCollection.add(Object) method of the concrete collection class, which may or may not be supported. This method conforms to the Collection.addAll interface.
throws:
  UnsupportedOperationException - if the collection is read-only, orif the collection is indexed, or if the add method is not supported bythe concrete collection.
throws:
  RuntimeExceptionWrapper - if a DatabaseException isthrown.



blockIterator
BlockIterator blockIterator()(Code)



checkIterAddAllowed
void checkIterAddAllowed() throws UnsupportedOperationException(Code)



containsAll
public boolean containsAll(Collection coll)(Code)
Returns true if this collection contains all of the elements in the specified collection. This method conforms to the Collection.containsAll interface.
throws:
  RuntimeExceptionWrapper - if a DatabaseException isthrown.



equals
public boolean equals(Object other)(Code)
Compares the specified object with this collection 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 Collection.equals interface.
throws:
  RuntimeExceptionWrapper - if a DatabaseException isthrown.



getFirstOrLast
final Object getFirstOrLast(boolean doGetFirst)(Code)



getIndexOffset
int getIndexOffset()(Code)



getIteratorBlockSize
public int getIteratorBlockSize()(Code)
Returns the number of records read at one time by iterators returned by the StoredCollection.iterator method. By default this value is StoredCollection.DEFAULT_ITERATOR_BLOCK_SIZE .



hasValues
abstract boolean hasValues()(Code)



hashCode
public int hashCode()(Code)



iterateDuplicates
boolean iterateDuplicates()(Code)



iterator
public Iterator iterator()(Code)
Returns an iterator over the elements in this collection. The iterator will be read-only if the collection is read-only. This method conforms to the Collection.iterator interface.

The iterator returned by this method does not keep a database cursor open and therefore it does not need to be closed. It reads blocks of records as needed, opening and closing a cursor to read each block of records. The number of records per block is 10 by default and can be changed with StoredCollection.setIteratorBlockSize .

Because this iterator does not keep a cursor open, if it is used without transactions, the iterator does not have cursor stability characteristics. In other words, the record at the current iterator position can be changed or deleted by another thread. To prevent this from happening, call this method within a transaction or use the StoredCollection.storedIterator() method instead.

a standard Iterator for this collection.
See Also:   StoredCollection.isWriteAllowed



iterator
public StoredIterator iterator(boolean writeAllowed)(Code)
StoredCollection.storedIterator()StoredCollection.storedIterator(boolean) iterator



join
public StoredIterator join(StoredContainer[] indices, Object[] indexKeys, JoinConfig joinConfig)(Code)
Returns an iterator representing an equality join of the indices and index key values specified. This method does not exist in the standard Collection interface.

Warning: The iterator returned must be explicitly closed using StoredIterator.close or StoredIterator.close(java.util.Iterator) to release the underlying database cursor resources.

The returned iterator supports only the two methods: hasNext() and next(). All other methods will throw UnsupportedOperationException.


Parameters:
  indices - is an array of indices with elements corresponding tothose in the indexKeys array.
Parameters:
  indexKeys - is an array of index key values identifying theelements to be selected.
Parameters:
  joinConfig - is the join configuration, or null to use thedefault configuration. an iterator over the elements in this collection that matchall specified index key values.
throws:
  IllegalArgumentException - if this collection is indexed or if agiven index does not have the same store as this collection.
throws:
  RuntimeExceptionWrapper - if a DatabaseException isthrown.



makeIteratorData
Object makeIteratorData(BaseIterator iterator, DataCursor cursor)(Code)



makeIteratorData
abstract Object makeIteratorData(BaseIterator iterator, DatabaseEntry keyEntry, DatabaseEntry priKeyEntry, DatabaseEntry valueEntry)(Code)



removeAll
public boolean removeAll(Collection coll)(Code)
Removes all this collection's elements that are also contained in the specified collection (optional operation). This method conforms to the Collection.removeAll interface.
throws:
  UnsupportedOperationException - if the collection is read-only.
throws:
  RuntimeExceptionWrapper - if a DatabaseException isthrown.



retainAll
public boolean retainAll(Collection coll)(Code)
Retains only the elements in this collection that are contained in the specified collection (optional operation). This method conforms to the Collection.removeAll interface.
throws:
  UnsupportedOperationException - if the collection is read-only.
throws:
  RuntimeExceptionWrapper - if a DatabaseException isthrown.



setIteratorBlockSize
public void setIteratorBlockSize(int blockSize)(Code)
Changes the number of records read at one time by iterators returned by the StoredCollection.iterator method. By default this value is StoredCollection.DEFAULT_ITERATOR_BLOCK_SIZE .
throws:
  IllegalArgumentException - if the blockSize is less than two.



size
public int size()(Code)



storedIterator
public StoredIterator storedIterator()(Code)
Returns an iterator over the elements in this collection. The iterator will be read-only if the collection is read-only. This method does not exist in the standard Collection interface.

If Iterater.set or Iterator.remove will be called and the underlying Database is transactional, then a transaction must be active when calling this method and must remain active while using the iterator.

Warning: The iterator returned must be explicitly closed using StoredIterator.close or StoredIterator.close(java.util.Iterator) to release the underlying database cursor resources.

a StoredIterator for this collection.
See Also:   StoredCollection.isWriteAllowed



storedIterator
public StoredIterator storedIterator(boolean writeAllowed)(Code)
Returns a read or read-write iterator over the elements in this collection. This method does not exist in the standard Collection interface.

If Iterater.set or Iterator.remove will be called and the underlying Database is transactional, then a transaction must be active when calling this method and must remain active while using the iterator.

Warning: The iterator returned must be explicitly closed using StoredIterator.close or StoredIterator.close(java.util.Iterator) to release the underlying database cursor resources.


Parameters:
  writeAllowed - is true to open a read-write iterator or false toopen a read-only iterator. If the collection is read-only the iteratorwill always be read-only. a StoredIterator for this collection.
throws:
  IllegalStateException - if writeAllowed is true but the collectionis read-only.
throws:
  RuntimeExceptionWrapper - if a DatabaseException isthrown.
See Also:   StoredCollection.isWriteAllowed



toArray
public Object[] toArray()(Code)
Returns an array of all the elements in this collection. This method conforms to the Collection.toArray interface.
throws:
  RuntimeExceptionWrapper - if a DatabaseException isthrown.



toArray
public Object[] toArray(Object[] a)(Code)
Returns an array of all the elements in this collection whose runtime type is that of the specified array. This method conforms to the Collection.toArray(Object[]) interface.
throws:
  RuntimeExceptionWrapper - if a DatabaseException isthrown.



toList
public List toList()(Code)
Returns a copy of this collection as an ArrayList. This is the same as StoredCollection.toArray() but returns a collection instead of an array. an ArrayList containing a copy of all elements in thiscollection.
throws:
  RuntimeExceptionWrapper - if a DatabaseException isthrown.



toString
public String toString()(Code)
Converts the collection to a string representation for debugging. WARNING: The returned string may be very large. the string representation.
throws:
  RuntimeExceptionWrapper - if a DatabaseException isthrown.



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.