C# 클래스 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.

파일 보기 프로젝트 열기: WolfgangSt/axiom

공개 프로퍼티들

프로퍼티 타입 설명
buckets System.Collections.Hashtable

보호된 프로퍼티들

프로퍼티 타입 설명
count int

공개 메소드들

메소드 설명
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.

메소드 상세

Clear() 공개 메소드

Clears this map of all contained objects.
public Clear ( ) : void
리턴 void

Clear() 공개 메소드

Clears the bucket with given key.
public Clear ( object key ) : void
key object
리턴 void

Count() 공개 메소드

Gets the count of objects mapped to the specified key.
public Count ( object key ) : int
key object
리턴 int

Find() 공개 메소드

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.
리턴 IEnumerator

FindBucket() 공개 메소드

public FindBucket ( object key ) : IList
key object
리턴 IList

FindFirst() 공개 메소드

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.
리턴 object

GetBucketEnumerator() 공개 메소드

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
리턴 IEnumerator

Insert() 공개 메소드

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

Map() 공개 메소드

Default constructor.
public Map ( ) : System
리턴 System

프로퍼티 상세

buckets 공개적으로 프로퍼티

A list of buckets.
public Hashtable,System.Collections buckets
리턴 System.Collections.Hashtable

count 보호되어 있는 프로퍼티

Number of total items currently in this map.
protected int count
리턴 int