org.geotools.caching.grid.spatialindex.store
Class MemoryStorage

java.lang.Object
  extended by org.geotools.caching.grid.spatialindex.store.MemoryStorage
All Implemented Interfaces:
Storage

public class MemoryStorage
extends java.lang.Object
implements Storage

A simple in-memory storage relying on LinkedHashMap.

Author:
crousson

Field Summary
 
Fields inherited from interface org.geotools.caching.spatialindex.Storage
STORAGE_TYPE_PROPERTY
 
Method Summary
 void addFeatureType(org.opengis.feature.type.FeatureType ft)
          Adds a feature type to the store.
 void clear()
          Clears all information from the store.
 void clearFeatureTypes()
          Removes all feature types associated with the store.
static Storage createInstance()
           
static Storage createInstance(java.util.Properties pset)
           
 void dispose()
          Disposes of the store.
 NodeIdentifier findUniqueInstance(NodeIdentifier id)
           
 void flush()
          Flushes the store writing everything to the store.
 Node get(NodeIdentifier id)
          Reads a node from the store given an node identifier
 ReferencedEnvelope getBounds()
          Gets the bounds of the cached data.
 java.util.Collection<org.opengis.feature.type.FeatureType> getFeatureTypes()
           
 java.util.Properties getPropertySet()
          Get properties about the given storage.
 void put(Node n)
          Adds a given node to the store.
 void remove(NodeIdentifier id)
          Removes a node from the store given a node identifier
 void setBounds(ReferencedEnvelope bounds)
          Sets the bounds of the data in the cache.
 void setParent(SpatialIndex index)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createInstance

public static Storage createInstance(java.util.Properties pset)

createInstance

public static Storage createInstance()

get

public Node get(NodeIdentifier id)
Description copied from interface: Storage
Reads a node from the store given an node identifier

Specified by:
get in interface Storage
Parameters:
id - identifier of the node to read
Returns:

put

public void put(Node n)
Description copied from interface: Storage
Adds a given node to the store.

Specified by:
put in interface Storage

remove

public void remove(NodeIdentifier id)
Description copied from interface: Storage
Removes a node from the store given a node identifier

Specified by:
remove in interface Storage
Parameters:
id - identifier of the node to remove

clear

public void clear()
Description copied from interface: Storage
Clears all information from the store.

Specified by:
clear in interface Storage

setParent

public void setParent(SpatialIndex index)

flush

public void flush()
Description copied from interface: Storage
Flushes the store writing everything to the store.

Currently this is really only used by the BufferedDiskStorage to write everything in the buffer to the store.

Specified by:
flush in interface Storage

dispose

public void dispose()
Description copied from interface: Storage
Disposes of the store.

Specified by:
dispose in interface Storage

getPropertySet

public java.util.Properties getPropertySet()
Description copied from interface: Storage
Get properties about the given storage. The actual properties returned depend on the type of storage.

Specified by:
getPropertySet in interface Storage
Returns:

findUniqueInstance

public NodeIdentifier findUniqueInstance(NodeIdentifier id)
Specified by:
findUniqueInstance in interface Storage

addFeatureType

public void addFeatureType(org.opengis.feature.type.FeatureType ft)
Description copied from interface: Storage
Adds a feature type to the store.

Specified by:
addFeatureType in interface Storage
Parameters:
ft - feature type to add

getFeatureTypes

public java.util.Collection<org.opengis.feature.type.FeatureType> getFeatureTypes()
Specified by:
getFeatureTypes in interface Storage

clearFeatureTypes

public void clearFeatureTypes()
Description copied from interface: Storage
Removes all feature types associated with the store.

Specified by:
clearFeatureTypes in interface Storage

getBounds

public ReferencedEnvelope getBounds()
Description copied from interface: Storage
Gets the bounds of the cached data.

Specified by:
getBounds in interface Storage
Returns:

setBounds

public void setBounds(ReferencedEnvelope bounds)
Description copied from interface: Storage
Sets the bounds of the data in the cache.

Specified by:
setBounds in interface Storage


Copyright © 1996-2010 Geotools. All Rights Reserved.