C# Class Axiom.SceneManagers.Bsp.Collections.Map

Map class, a little different from the Axiom.Collections.Map class
A map allows multiple values per key, unlike the Hashtable which only allows unique keys and only a single value per key. Multiple values assigned to the same key are placed in a "bucket", which in this case is an ArrayList.

An example of values in a map would look like this: Key Value "a" "Alan" "a" "Adam" "b" "Brien" "c" "Chris" "c" "Carl" etc

Currently, enumeration is the only way to iterate through the values, which is more pratical in terms of how the Map works internally anyway. Intial testing showed that inserting and iterating through 100,000 items, the Inserts took ~260ms and a full enumeration of them all (with unboxing of the value type stored in the map) took between 16-30ms.

Afficher le fichier Open project: WolfgangSt/axiom

Méthodes publiques

Свойство Type Description
buckets System.Collections.Hashtable

Protected Properties

Свойство Type Description
count int

Méthodes publiques

Méthode Description
Clear ( ) : void

Clears this map of all contained objects.

Clear ( object key ) : void

Clears the bucket with given key.

Count ( object key ) : int

Gets the count of objects mapped to the specified key.

Find ( object key ) : IEnumerator

Given a key, Find will return an IEnumerator that allows you to iterate over all items in the bucket associated with the key.

FindBucket ( object key ) : IList
FindFirst ( object key ) : object

Given a key, FindFirst will return the first item in the bucket associated with the key.

GetBucketEnumerator ( ) : IEnumerator

Gets an appropriate enumerator for the map, customized to go through each key in the map and return a Pair of the key and an ArrayList of the values associated with it.

Insert ( object key, object val ) : void

Inserts a value into a bucket that is specified by the key.

Map ( ) : System

Default constructor.

Method Details

Clear() public méthode

Clears this map of all contained objects.
public Clear ( ) : void
Résultat void

Clear() public méthode

Clears the bucket with given key.
public Clear ( object key ) : void
key object
Résultat void

Count() public méthode

Gets the count of objects mapped to the specified key.
public Count ( object key ) : int
key object
Résultat int

Find() public méthode

Given a key, Find will return an IEnumerator that allows you to iterate over all items in the bucket associated with the key.
public Find ( object key ) : IEnumerator
key object Key for look for.
Résultat IEnumerator

FindBucket() public méthode

public FindBucket ( object key ) : IList
key object
Résultat IList

FindFirst() public méthode

Given a key, FindFirst will return the first item in the bucket associated with the key.
public FindFirst ( object key ) : object
key object Key to look for.
Résultat object

GetBucketEnumerator() public méthode

Gets an appropriate enumerator for the map, customized to go through each key in the map and return a Pair of the key and an ArrayList of the values associated with it.
public GetBucketEnumerator ( ) : IEnumerator
Résultat IEnumerator

Insert() public méthode

Inserts a value into a bucket that is specified by the key.
public Insert ( object key, object val ) : void
key object
val object
Résultat void

Map() public méthode

Default constructor.
public Map ( ) : System
Résultat System

Property Details

buckets public_oe property

A list of buckets.
public Hashtable,System.Collections buckets
Résultat System.Collections.Hashtable

count protected_oe property

Number of total items currently in this map.
protected int count
Résultat int