StoredCollections (Oracle Corporation - Berkeley DB Java API)
Keywords: com.sleepycat.collections.StoredCollections class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 4.5.20
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sleepycat.collections
Class StoredCollections

    java.lang.Object
      com.sleepycat.collections.StoredCollections

    public class StoredCollections

extends Object

Static methods operating on collections and maps.

This class consists exclusively of static methods that operate on or return stored collections and maps, jointly called containers. It contains methods for changing certain properties of a container. Because container properties are immutable, these methods always return a new container instance. This allows stored container instances to be used safely by multiple threads. Creating the new container instance is not expensive and creates only two new objects.

When a container is created with a particular property, all containers and iterators derived from that container will inherit the property. For example, if a read-uncommitted Map is created then calls to its subMap(), values(), entrySet(), and keySet() methods will create read-uncommitted containers also.

Method names beginning with "configured" create a new container with a specified `CursorConfig` from a given stored container. This allows configuring a container for read-committed isolation, read-uncommitted isolation, or any other property supported by `CursorConfig`. All operations performed with the resulting container will be performed with the specified cursor configuration.

Method Summary
`static Collection` | `configuredCollection(Collection storedCollection, CursorConfig config)` Creates a configured collection from a given stored collection.
`static List` | `configuredList(List storedList, CursorConfig config)` Creates a configured list from a given stored list.
`static Map` | `configuredMap(Map storedMap, CursorConfig config)` Creates a configured map from a given stored map.
`static Set` | `configuredSet(Set storedSet, CursorConfig config)` Creates a configured set from a given stored set.
`static SortedMap` | `configuredSortedMap(SortedMap storedSortedMap, CursorConfig config)` Creates a configured sorted map from a given stored sorted map.
`static SortedSet` | `configuredSortedSet(SortedSet storedSortedSet, CursorConfig config)` Creates a configured sorted set from a given stored sorted set.
`static Collection` | `dirtyReadCollection(Collection storedCollection)` Deprecated. This method has been replaced by `configuredCollection(java.util.Collection, com.sleepycat.db.CursorConfig)` in order to conform to ANSI database isolation terminology. To obtain a dirty-read collection, pass `CursorConfig.READ_UNCOMMITTED`
`static List` | `dirtyReadList(List storedList)` Deprecated. This method has been replaced by `configuredList(java.util.List, com.sleepycat.db.CursorConfig)` in order to conform to ANSI database isolation terminology. To obtain a dirty-read list, pass `CursorConfig.READ_UNCOMMITTED`
`static Map` | `dirtyReadMap(Map storedMap)` Deprecated. This method has been replaced by `configuredMap(java.util.Map, com.sleepycat.db.CursorConfig)` in order to conform to ANSI database isolation terminology. To obtain a dirty-read map, pass `CursorConfig.READ_UNCOMMITTED`
`static Set` | `dirtyReadSet(Set storedSet)` Deprecated. This method has been replaced by `configuredSet(java.util.Set, com.sleepycat.db.CursorConfig)` in order to conform to ANSI database isolation terminology. To obtain a dirty-read set, pass `CursorConfig.READ_UNCOMMITTED`
`static SortedMap` | `dirtyReadSortedMap(SortedMap storedSortedMap)` Deprecated. This method has been replaced by `configuredSortedMap(java.util.SortedMap, com.sleepycat.db.CursorConfig)` in order to conform to ANSI database isolation terminology. To obtain a dirty-read map, pass `CursorConfig.READ_UNCOMMITTED`
`static SortedSet` | `dirtyReadSortedSet(SortedSet storedSortedSet)` Deprecated. This method has been replaced by `configuredSortedSet(java.util.SortedSet, com.sleepycat.db.CursorConfig)` in order to conform to ANSI database isolation terminology. To obtain a dirty-read set, pass `CursorConfig.READ_UNCOMMITTED`
`static Iterator` | `iterator(Iterator iter)` Clones an iterator preserving its current position.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### configuredCollection

    public static Collection configuredCollection(Collection storedCollection,
                                                  CursorConfig config)

  Creates a configured collection from a given stored collection.

  Parameters:
    `storedCollection` - the base collection.
    `config` - is the cursor configuration to be used for all operations performed via the new collection instance; null may be specified to use the default configuration.
  Returns:
    the configured collection.
  Throws:
    `ClassCastException` - if the given container is not a StoredContainer.

### configuredList

    public static List configuredList(List storedList,
                                      CursorConfig config)

  Creates a configured list from a given stored list.

  Note that this method may not be called in the JE product, since the StoredList class is not supported.

  Parameters:
    `storedList` - the base list.
    `config` - is the cursor configuration to be used for all operations performed via the new list instance; null may be specified to use the default configuration.
  Returns:
    the configured list.
  Throws:
    `ClassCastException` - if the given container is not a StoredContainer.

### configuredMap

    public static Map configuredMap(Map storedMap,
                                    CursorConfig config)

  Creates a configured map from a given stored map.

  Parameters:
    `storedMap` - the base map.
    `config` - is the cursor configuration to be used for all operations performed via the new map instance; null may be specified to use the default configuration.
  Returns:
    the configured map.
  Throws:
    `ClassCastException` - if the given container is not a StoredContainer.

### configuredSet

    public static Set configuredSet(Set storedSet,
                                    CursorConfig config)

  Creates a configured set from a given stored set.

  Parameters:
    `storedSet` - the base set.
    `config` - is the cursor configuration to be used for all operations performed via the new set instance; null may be specified to use the default configuration.
  Returns:
    the configured set.
  Throws:
    `ClassCastException` - if the given container is not a StoredContainer.

### configuredSortedMap

    public static SortedMap configuredSortedMap(SortedMap storedSortedMap,
                                                CursorConfig config)

  Creates a configured sorted map from a given stored sorted map.

  Parameters:
    `storedSortedMap` - the base map.
    `config` - is the cursor configuration to be used for all operations performed via the new map instance; null may be specified to use the default configuration.
  Returns:
    the configured map.
  Throws:
    `ClassCastException` - if the given container is not a StoredContainer.

### configuredSortedSet

    public static SortedSet configuredSortedSet(SortedSet storedSortedSet,
                                                CursorConfig config)

  Creates a configured sorted set from a given stored sorted set.

  Parameters:
    `storedSortedSet` - the base set.
    `config` - is the cursor configuration to be used for all operations performed via the new set instance; null may be specified to use the default configuration.
  Returns:
    the configured set.
  Throws:
    `ClassCastException` - if the given container is not a StoredContainer.

### dirtyReadCollection

    public static Collection dirtyReadCollection(Collection storedCollection)

  Deprecated. This method has been replaced by `configuredCollection(java.util.Collection, com.sleepycat.db.CursorConfig)` in order to conform to ANSI database isolation terminology. To obtain a dirty-read collection, pass `CursorConfig.READ_UNCOMMITTED`

### dirtyReadList

    public static List dirtyReadList(List storedList)

  Deprecated. This method has been replaced by `configuredList(java.util.List, com.sleepycat.db.CursorConfig)` in order to conform to ANSI database isolation terminology. To obtain a dirty-read list, pass `CursorConfig.READ_UNCOMMITTED`

### dirtyReadMap

    public static Map dirtyReadMap(Map storedMap)

  Deprecated. This method has been replaced by `configuredMap(java.util.Map, com.sleepycat.db.CursorConfig)` in order to conform to ANSI database isolation terminology. To obtain a dirty-read map, pass `CursorConfig.READ_UNCOMMITTED`

### dirtyReadSet

    public static Set dirtyReadSet(Set storedSet)

  Deprecated. This method has been replaced by `configuredSet(java.util.Set, com.sleepycat.db.CursorConfig)` in order to conform to ANSI database isolation terminology. To obtain a dirty-read set, pass `CursorConfig.READ_UNCOMMITTED`

### dirtyReadSortedMap

    public static SortedMap dirtyReadSortedMap(SortedMap storedSortedMap)

  Deprecated. This method has been replaced by `configuredSortedMap(java.util.SortedMap, com.sleepycat.db.CursorConfig)` in order to conform to ANSI database isolation terminology. To obtain a dirty-read map, pass `CursorConfig.READ_UNCOMMITTED`

### dirtyReadSortedSet

    public static SortedSet dirtyReadSortedSet(SortedSet storedSortedSet)

  Deprecated. This method has been replaced by `configuredSortedSet(java.util.SortedSet, com.sleepycat.db.CursorConfig)` in order to conform to ANSI database isolation terminology. To obtain a dirty-read set, pass `CursorConfig.READ_UNCOMMITTED`

### iterator

    public static Iterator iterator(Iterator iter)

  Clones an iterator preserving its current position.

  Parameters:
    `iter` - an iterator to clone.
  Returns:
    a new `Iterator` having the same position as the given iterator.
  Throws:
    `ClassCastException` - if the given iterator was not obtained via a `StoredCollection` method.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 4.5.20
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright(c) 1996-2006 Oracle Corporation - All rights reserved.