C# 클래스 LSCollections.SkipList

Represents a collection of key-and-value pairs.
The SkipList class is an implementation of the IDictionary interface. It is based on the data structure created by William Pugh.
상속: IDictionary
파일 보기 프로젝트 열기: jeske/StepsDB-alpha 1 사용 예제들

공개 메소드들

메소드 설명
Add ( object key, object value ) : void

Adds an element with the provided key and value to the SkipList.

Clear ( ) : void

Removes all elements from the SkipList.

Contains ( object key ) : bool

Determines whether the SkipList contains an element with the specified key.

CopyTo ( Array array, int index ) : void

Copies the elements of the SkipList to an Array, starting at a particular Array index.

GetEnumerator ( ) : IDictionaryEnumerator

Returns an IDictionaryEnumerator for the SkipList.

Remove ( object key ) : void

Removes the element with the specified key from the SkipList.

SkipList ( ) : System

Initializes a new instance of the SkipList class that is empty and is sorted according to the IComparable interface implemented by each key added to the SkipList.

Each key must implement the IComparable interface to be capable of comparisons with every other key in the SortedList. The elements are sorted according to the IComparable implementation of each key added to the SkipList.

SkipList ( IComparer comparer ) : System

Initializes a new instance of the SkipList class that is empty and is sorted according to the specified IComparer interface.

The elements are sorted according to the specified IComparer implementation. If comparer is a null reference, the IComparable implementation of each key is used; therefore, each key must implement the IComparable interface to be capable of comparisons with every other key in the SkipList.

this ( object key ) : object

Gets or sets the element with the specified key. This is the indexer for the SkipList.

비공개 메소드들

메소드 설명
GetNewLevel ( ) : int

Returns a level value for a new SkipList node.

Initialize ( ) : void

Initializes the SkipList.

Insert ( object key, object val, Node update ) : void

Inserts a key/value pair into the SkipList.

Search ( object key ) : bool

Searches for the specified key.

Search ( object key, Node &curr ) : bool

Searches for the specified key.

Search ( object key, Node &curr, Node update ) : bool

Searches for the specified key.

SearchWithComparable ( object key, Node &curr, Node update ) : bool

Search for the specified key using the IComparable interface implemented by each key.

Assumes each key inserted into the SkipList implements the IComparable interface. If the specified key is in the SkipList, the curr parameter will reference the node with the key. If the specified key is not in the SkipList, the curr paramater will either hold the node with the first key value greater than the specified key or null indicating that the search reached the end of the SkipList.

SearchWithComparer ( object key, Node &curr, Node update ) : bool

Search for the specified key using a comparer.

System ( ) : IEnumerator

Returns an enumerator that can iterate through the SkipList.

메소드 상세

Add() 공개 메소드

Adds an element with the provided key and value to the SkipList.
public Add ( object key, object value ) : void
key object /// The Object to use as the key of the element to add. ///
value object /// The Object to use as the value of the element to add. ///
리턴 void

Clear() 공개 메소드

Removes all elements from the SkipList.
public Clear ( ) : void
리턴 void

Contains() 공개 메소드

Determines whether the SkipList contains an element with the specified key.
public Contains ( object key ) : bool
key object /// The key to locate in the SkipList. ///
리턴 bool

CopyTo() 공개 메소드

Copies the elements of the SkipList to an Array, starting at a particular Array index.
public CopyTo ( Array array, int index ) : void
array System.Array /// The one-dimensional Array that is the destination of the elements /// copied from SkipList. ///
index int /// The zero-based index in array at which copying begins. ///
리턴 void

GetEnumerator() 공개 메소드

Returns an IDictionaryEnumerator for the SkipList.
public GetEnumerator ( ) : IDictionaryEnumerator
리턴 IDictionaryEnumerator

Remove() 공개 메소드

Removes the element with the specified key from the SkipList.
public Remove ( object key ) : void
key object /// The key of the element to remove. ///
리턴 void

SkipList() 공개 메소드

Initializes a new instance of the SkipList class that is empty and is sorted according to the IComparable interface implemented by each key added to the SkipList.
Each key must implement the IComparable interface to be capable of comparisons with every other key in the SortedList. The elements are sorted according to the IComparable implementation of each key added to the SkipList.
public SkipList ( ) : System
리턴 System

SkipList() 공개 메소드

Initializes a new instance of the SkipList class that is empty and is sorted according to the specified IComparer interface.
The elements are sorted according to the specified IComparer implementation. If comparer is a null reference, the IComparable implementation of each key is used; therefore, each key must implement the IComparable interface to be capable of comparisons with every other key in the SkipList.
public SkipList ( IComparer comparer ) : System
comparer IComparer /// The IComparer implementation to use when comparing keys. ///
리턴 System

this() 공개 메소드

Gets or sets the element with the specified key. This is the indexer for the SkipList.
public this ( object key ) : object
key object
리턴 object