C# 클래스 Universe.BotManager.AStar.Heap

The Heap allows to maintain a list sorted as long as needed. If no IComparer interface has been provided at construction, then the list expects the Objects to implement IComparer. If the list is not sorted it behaves like an ordinary list. When sorted, the list's "Add" method will put new objects at the right place. As well the "Contains" and "IndexOf" methods will perform a binary search.
상속: IList, ICloneable
파일 보기 프로젝트 열기: Virtual-Universe/Virtual-Universe 1 사용 예제들

공개 메소드들

메소드 설명
Add ( object obj ) : int

IList implementation. Adds the object at the right place.

AddRange ( ICollection coll ) : void

The objects will be added at the right place.

Clear ( ) : void

IList implementation. Idem ArrayList

Clone ( ) : object

ICloneable implementation. Idem ArrayList

Contains ( object obj ) : bool

IList implementation. Search for a specified object in the list. If the list is sorted, a <see cref = "ArrayList.BinarySearch">BinarySearch</see> is performed using IComparer interface. Else the <see cref = "Equals">Object.Equals</see> implementation is used.

CopyTo ( Array array, int arrayIndex ) : void

IList.ICollection implementation. Idem ArrayList

Equals ( object obj ) : bool

Object.Equals() override.

GetEnumerator ( ) : IEnumerator

IList.IEnumerable implementation. Idem ArrayList

GetHashCode ( ) : int

Object.GetHashCode() override.

Heap ( ) : System

Default constructor. Since no IComparer is provided here, added objects must implement the IComparer interface.

Heap ( IComparer comparer ) : System

Constructor.

Heap ( IComparer comparer, int capacity ) : System

Constructor.

Heap ( int capacity ) : System

Constructor. Since no IComparer is provided, added objects must implement the IComparer interface.

IndexOf ( object obj ) : int

IList implementation. Returns the index of the specified object in the list. If the list is sorted, a <see cref = "ArrayList.BinarySearch">BinarySearch</see> is performed using IComparer interface. Else the <see cref = "Equals">Object.Equals</see> implementation of objects is used.

IndexOf ( object obj, Equality areEqual ) : int

Idem IndexOf(object), but with a specified equality function

IndexOf ( object obj, int start ) : int

Idem IndexOf(object), but starting at a specified position in the list

IndexOf ( object obj, int start, Equality areEqual ) : int

Idem IndexOf(object), but with a start index and a specified equality function

IndexOfMax ( ) : int

Returns the object of the list whose value is maximum

IndexOfMin ( ) : int

Returns the object of the list whose value is minimum

InitProperties ( IComparer comparer, int capacity ) : void
Insert ( int index, object obj ) : void

IList implementation. Cannot be used on a Heap.

InsertRange ( int index, ICollection coll ) : void

Cannot be called on a Heap.

LimitOccurrences ( object value, int numberToKeep ) : void

Limits the number of occurrences of a specified value. Same values are equals according to the Equals() method of objects in the list. The first occurrences encountered are kept.

Pop ( ) : object

Returns the topmost object on the list and removes it from the list

Push ( object obj ) : int

Pushes an object on list. It will be inserted at the right spot.

Remove ( object value ) : void

IList implementation. Idem ArrayList

RemoveAt ( int index ) : void

IList implementation. Idem ArrayList

RemoveDuplicates ( ) : void

Removes all duplicates in the list. Each value encountered will have only one representant

ToString ( ) : string

Object.ToString() override. Build a string to represent the list.

this ( int index ) : object

IList implementation. Gets object's value at a specified index. The set operation is impossible on a Heap.

비공개 메소드들

메소드 설명
ObjectIsCompliant ( object obj ) : bool

메소드 상세

Add() 공개 메소드

IList implementation. Adds the object at the right place.
The Heap is set to use object's IComparable interface, and the specified object does not implement this interface.
public Add ( object obj ) : int
obj object The object to add.
리턴 int

AddRange() 공개 메소드

The objects will be added at the right place.
The Heap is set to use object's IComparable interface, and the specified object does not implement this interface.
public AddRange ( ICollection coll ) : void
coll ICollection The object to add.
리턴 void

Clear() 공개 메소드

IList implementation. Idem ArrayList
public Clear ( ) : void
리턴 void

Clone() 공개 메소드

ICloneable implementation. Idem ArrayList
public Clone ( ) : object
리턴 object

Contains() 공개 메소드

IList implementation. Search for a specified object in the list. If the list is sorted, a <see cref = "ArrayList.BinarySearch">BinarySearch</see> is performed using IComparer interface. Else the <see cref = "Equals">Object.Equals</see> implementation is used.
public Contains ( object obj ) : bool
obj object The object to look for
리턴 bool

CopyTo() 공개 메소드

IList.ICollection implementation. Idem ArrayList
public CopyTo ( Array array, int arrayIndex ) : void
array System.Array
arrayIndex int
리턴 void

Equals() 공개 메소드

Object.Equals() override.
public Equals ( object obj ) : bool
obj object
리턴 bool

GetEnumerator() 공개 메소드

IList.IEnumerable implementation. Idem ArrayList
public GetEnumerator ( ) : IEnumerator
리턴 IEnumerator

GetHashCode() 공개 메소드

Object.GetHashCode() override.
public GetHashCode ( ) : int
리턴 int

Heap() 공개 메소드

Default constructor. Since no IComparer is provided here, added objects must implement the IComparer interface.
public Heap ( ) : System
리턴 System

Heap() 공개 메소드

Constructor.
public Heap ( IComparer comparer ) : System
comparer IComparer Will be used to compare added elements for sort and search operations.
리턴 System

Heap() 공개 메소드

Constructor.
public Heap ( IComparer comparer, int capacity ) : System
comparer IComparer Will be used to compare added elements for sort and search operations.
capacity int /// Capacity of the list (ArrayList.Capacity) ///
리턴 System

Heap() 공개 메소드

Constructor. Since no IComparer is provided, added objects must implement the IComparer interface.
public Heap ( int capacity ) : System
capacity int /// Capacity of the list (ArrayList.Capacity) ///
리턴 System

IndexOf() 공개 메소드

IList implementation. Returns the index of the specified object in the list. If the list is sorted, a <see cref = "ArrayList.BinarySearch">BinarySearch</see> is performed using IComparer interface. Else the <see cref = "Equals">Object.Equals</see> implementation of objects is used.
public IndexOf ( object obj ) : int
obj object The object to locate.
리턴 int

IndexOf() 공개 메소드

Idem IndexOf(object), but with a specified equality function
public IndexOf ( object obj, Equality areEqual ) : int
obj object The object to locate.
areEqual Equality Equality function to use for the search.
리턴 int

IndexOf() 공개 메소드

Idem IndexOf(object), but starting at a specified position in the list
public IndexOf ( object obj, int start ) : int
obj object The object to locate.
start int The index for start position.
리턴 int

IndexOf() 공개 메소드

Idem IndexOf(object), but with a start index and a specified equality function
public IndexOf ( object obj, int start, Equality areEqual ) : int
obj object The object to locate.
start int The index for start position.
areEqual Equality Equality function to use for the search.
리턴 int

IndexOfMax() 공개 메소드

Returns the object of the list whose value is maximum
public IndexOfMax ( ) : int
리턴 int

IndexOfMin() 공개 메소드

Returns the object of the list whose value is minimum
public IndexOfMin ( ) : int
리턴 int

InitProperties() 공개 메소드

public InitProperties ( IComparer comparer, int capacity ) : void
comparer IComparer
capacity int
리턴 void

Insert() 공개 메소드

IList implementation. Cannot be used on a Heap.
Insert method cannot be called on a Heap.
public Insert ( int index, object obj ) : void
index int The index before which the object must be added.
obj object The object to add.
리턴 void

InsertRange() 공개 메소드

Cannot be called on a Heap.
Insert cannot be called on a Heap.
public InsertRange ( int index, ICollection coll ) : void
index int The index before which the objects must be added.
coll ICollection The object to add.
리턴 void

LimitOccurrences() 공개 메소드

Limits the number of occurrences of a specified value. Same values are equals according to the Equals() method of objects in the list. The first occurrences encountered are kept.
public LimitOccurrences ( object value, int numberToKeep ) : void
value object Value whose occurrences number must be limited.
numberToKeep int Number of occurrences to keep
리턴 void

Pop() 공개 메소드

Returns the topmost object on the list and removes it from the list
public Pop ( ) : object
리턴 object

Push() 공개 메소드

Pushes an object on list. It will be inserted at the right spot.
public Push ( object obj ) : int
obj object Object to add to the list
리턴 int

Remove() 공개 메소드

IList implementation. Idem ArrayList
public Remove ( object value ) : void
value object The object whose value must be removed if found in the list.
리턴 void

RemoveAt() 공개 메소드

IList implementation. Idem ArrayList
public RemoveAt ( int index ) : void
index int Index of object to remove.
리턴 void

RemoveDuplicates() 공개 메소드

Removes all duplicates in the list. Each value encountered will have only one representant
public RemoveDuplicates ( ) : void
리턴 void

ToString() 공개 메소드

Object.ToString() override. Build a string to represent the list.
public ToString ( ) : string
리턴 string

this() 공개 메소드

IList implementation. Gets object's value at a specified index. The set operation is impossible on a Heap.
Index is less than zero or Index is greater than Count. [] operator cannot be used to set a value on a Heap.
public this ( int index ) : object
index int
리턴 object