com.esri.arcgis.carto
Class FeatureCache

java.lang.Object
  extended by com.esri.arcgis.carto.FeatureCache
All Implemented Interfaces:
IFeatureCache, IFeatureCache2, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class FeatureCache
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IFeatureCache, IFeatureCache2

A cache of features in memory for a particular spatial extent.

Remarks

The FeatureCache object is used for organizing small collections of features for operation which require quick access to them. The feature cache is intended for small numbers of features, roughly 10, and is not intended to be a large data store due to its usage of memory.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
FeatureCache()
          Constructs a FeatureCache using ArcGIS Engine.
FeatureCache(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
FeatureCache theFeatureCache = (FeatureCache) obj;
 
Method Summary
 void addFeatures(IFeatureClass fclass)
          Fills the cache with features from the featureclass.
 void addFeatures(IFeatureClass fclass, IEnvelope clip)
          Fills the cache with features from the featureclass.
 void addLayers(IEnumLayer layers, IEnvelope clip)
          Fills the cache with the features from the specified layers.
 boolean contains(IPoint point)
          Returns true if the point is contained in the cache.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 int getCount()
          The number of features in the cache.
 IFeature getFeature(int index)
          The nth feature.
 int hashCode()
          the hashcode for this object
 void initialize(IPoint point, double size)
          Initializes the cache with a given size and location.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

FeatureCache

public FeatureCache()
             throws IOException,
                    UnknownHostException
Constructs a FeatureCache using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

FeatureCache

public FeatureCache(Object obj)
             throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
FeatureCache theFeatureCache = (FeatureCache) obj;

Construct a FeatureCache using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to FeatureCache.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

initialize

public void initialize(IPoint point,
                       double size)
                throws IOException,
                       AutomationException
Initializes the cache with a given size and location.

Remarks

This method initializes the cache using an envelope created from the point by expanding it in height and width according to the specified size value. Size should be in the same units as the point.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
initialize in interface IFeatureCache
Specified by:
initialize in interface IFeatureCache2
Parameters:
point - A reference to a com.esri.arcgis.geometry.IPoint (in)
size - The size (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addFeatures

public void addFeatures(IFeatureClass fclass)
                 throws IOException,
                        AutomationException
Fills the cache with features from the featureclass. All previously loaded features in the cache are removed.

Remarks

Adds the features in the specified features class that fit within the envelope the cache was initialized with to the cache.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
addFeatures in interface IFeatureCache
Parameters:
fclass - A reference to a com.esri.arcgis.geodatabase.IFeatureClass (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

contains

public boolean contains(IPoint point)
                 throws IOException,
                        AutomationException
Returns true if the point is contained in the cache.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
contains in interface IFeatureCache
Specified by:
contains in interface IFeatureCache2
Parameters:
point - A reference to a com.esri.arcgis.geometry.IPoint (in)
Returns:
The contains
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCount

public int getCount()
             throws IOException,
                    AutomationException
The number of features in the cache.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getCount in interface IFeatureCache
Specified by:
getCount in interface IFeatureCache2
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFeature

public IFeature getFeature(int index)
                    throws IOException,
                           AutomationException
The nth feature.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getFeature in interface IFeatureCache
Specified by:
getFeature in interface IFeatureCache2
Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeature
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addFeatures

public void addFeatures(IFeatureClass fclass,
                        IEnvelope clip)
                 throws IOException,
                        AutomationException
Fills the cache with features from the featureclass. Clip envelope may be null.

Remarks

Adds the features in the specified features class to the cache. Only features that fit within the intersection of the clip envelope and the cache's internal envelope (specified during initialization) will be added.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
addFeatures in interface IFeatureCache2
Parameters:
fclass - A reference to a com.esri.arcgis.geodatabase.IFeatureClass (in)
clip - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addLayers

public void addLayers(IEnumLayer layers,
                      IEnvelope clip)
               throws IOException,
                      AutomationException
Fills the cache with the features from the specified layers. Clip envelope may be null.

Remarks

Adds the features in the specified layers to the cache. Only features that fit within the intersection of the clip envelope and the cache's internal envelope (specified during initialization) will be added.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
addLayers in interface IFeatureCache2
Parameters:
layers - A reference to a com.esri.arcgis.carto.IEnumLayer (in)
clip - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.