C# Class Azavea.Open.DAO.Memory.AbstractMemoryIndex

Base class that handles some of the key comparison common across index types.
Inheritance: IMemoryIndex
Datei anzeigen Open project: azavea/net-dao

Protected Properties

Property Type Description
_daLayer MemoryDaLayer
_property string

Public Methods

Method Description
GetCardinality ( DaoCriteria crit ) : int

Returns a number indicating how many breaks this index has for the properties used in the criteria. Roughly speaking, higher is better (though the number is an estimate, it is possible to have data that makes the index inefficient). If there are multiple indexes, the one that returns the highest number from this method will be used. An index should return 1 to indicate that it offers no value for this criteria.

GetPossibleMatches ( DaoCriteria crit ) : IList

Uses the index to return the smallest number of possible matches for this criteria.

Rebuild ( IEnumerable objects ) : void

This method rebuilds the index given a new list of data objects.

Protected Methods

Method Description
AbstractMemoryIndex ( MemoryDaLayer layer, string property ) : System

Base class that handles some of the key comparison common across index types.

GetExpressionsForIndex ( DaoCriteria crit ) : IList

This returns none if the crit is ORed, or if there are no expressions on this index's property.

GetMatchingKeys ( DaoCriteria crit, IEnumerable allKeys ) : IList

Gets the keys that match the expressions that are relevent to this index.

SplitObjectsByProperty ( IEnumerable objects ) : IList>.IDictionary

Splits a list of objects into a bunch of lists, one for each value of the index's property.

Method Details

AbstractMemoryIndex() protected method

Base class that handles some of the key comparison common across index types.
protected AbstractMemoryIndex ( MemoryDaLayer layer, string property ) : System
layer MemoryDaLayer The data access layer in use.
property string The property to index on.
return System

GetCardinality() public abstract method

Returns a number indicating how many breaks this index has for the properties used in the criteria. Roughly speaking, higher is better (though the number is an estimate, it is possible to have data that makes the index inefficient). If there are multiple indexes, the one that returns the highest number from this method will be used. An index should return 1 to indicate that it offers no value for this criteria.
public abstract GetCardinality ( DaoCriteria crit ) : int
crit Azavea.Open.DAO.Criteria.DaoCriteria The query being run.
return int

GetExpressionsForIndex() protected method

This returns none if the crit is ORed, or if there are no expressions on this index's property.
protected GetExpressionsForIndex ( DaoCriteria crit ) : IList
crit Azavea.Open.DAO.Criteria.DaoCriteria The query being run.
return IList

GetMatchingKeys() protected method

Gets the keys that match the expressions that are relevent to this index.
protected GetMatchingKeys ( DaoCriteria crit, IEnumerable allKeys ) : IList
crit Azavea.Open.DAO.Criteria.DaoCriteria The query being run.
allKeys IEnumerable All the key values in the index.
return IList

GetPossibleMatches() public abstract method

Uses the index to return the smallest number of possible matches for this criteria.
public abstract GetPossibleMatches ( DaoCriteria crit ) : IList
crit Azavea.Open.DAO.Criteria.DaoCriteria The query being run.
return IList

Rebuild() public abstract method

This method rebuilds the index given a new list of data objects.
public abstract Rebuild ( IEnumerable objects ) : void
objects IEnumerable All the objects in the data store.
return void

SplitObjectsByProperty() protected method

Splits a list of objects into a bunch of lists, one for each value of the index's property.
protected SplitObjectsByProperty ( IEnumerable objects ) : IList>.IDictionary
objects IEnumerable A list of potentially unordered objects.
return IList>.IDictionary

Property Details

_daLayer protected_oe property

Data access layer we're using, necessary for type coercion.
protected MemoryDaLayer,Azavea.Open.DAO.Memory _daLayer
return MemoryDaLayer

_property protected_oe property

The property that this index is on.
protected string _property
return string