Table of Contents

Class OrderedTree

Namespace
System.util.collections
Assembly
iTextSharp.LGPLv2.Core.dll
public class OrderedTree
Inheritance
OrderedTree
Inherited Members

Constructors

OrderedTree()

public OrderedTree()

Properties

Count

public virtual int Count { get; }

Property Value

int

this[IComparable]

public object this[IComparable key] { get; set; }

Parameters

key IComparable

Property Value

object

Keys

Keys if(ascending is true, the keys will be returned in ascending order, else the keys will be returned in descending order.

public virtual OrderedTreeEnumerator Keys { get; }

Property Value

OrderedTreeEnumerator

Values

Values Provided for .NET compatibility.

public virtual OrderedTreeEnumerator Values { get; }

Property Value

OrderedTreeEnumerator

Methods

Add(IComparable, object)

Add args: ByVal key As IComparable, ByVal data As Object key is object that implements IComparable interface performance tip: change to use int type (such as the hashcode)

public virtual void Add(IComparable key, object data)

Parameters

key IComparable
data object

Clear()

Clear Empties or clears the tree

public virtual void Clear()

ContainsKey(IComparable)

public virtual bool ContainsKey(IComparable key)

Parameters

key IComparable

Returns

bool

Elements()

Elements Returns an enumeration of the data objects. if(ascending is true, the objects will be returned in ascending order, else the objects will be returned in descending order.

public virtual OrderedTreeEnumerator Elements()

Returns

OrderedTreeEnumerator

Elements(bool)

public virtual OrderedTreeEnumerator Elements(bool ascending)

Parameters

ascending bool

Returns

OrderedTreeEnumerator

GetData(IComparable)

GetData Gets the data object associated with the specified key

public virtual object GetData(IComparable key)

Parameters

key IComparable

Returns

object

GetEnumerator()

GetEnumerator return an enumerator that returns the tree nodes in order

public virtual OrderedTreeEnumerator GetEnumerator()

Returns

OrderedTreeEnumerator

GetMaxKey()

GetMaxKey Returns the maximum key value

public virtual IComparable GetMaxKey()

Returns

IComparable

GetMaxValue()

GetMaxValue Returns the object having the maximum key

public virtual object GetMaxValue()

Returns

object

GetMinKey()

GetMinKey Returns the minimum key value

public virtual IComparable GetMinKey()

Returns

IComparable

GetMinValue()

GetMinValue Returns the object having the minimum key value

public virtual object GetMinValue()

Returns

object

IsEmpty()

IsEmpty Is the tree empty?

public virtual bool IsEmpty()

Returns

bool

KeyElements(bool)

public virtual OrderedTreeEnumerator KeyElements(bool ascending)

Parameters

ascending bool

Returns

OrderedTreeEnumerator

Remove(IComparable)

Remove removes the key and data object (delete)

public virtual void Remove(IComparable key)

Parameters

key IComparable

RemoveMax()

RemoveMax removes the node with the maximum key

public virtual void RemoveMax()

RemoveMin()

RemoveMin removes the node with the minimum key

public virtual void RemoveMin()

RotateLeft(OrderedTreeNode)

RotateLeft Rebalance the tree by rotating the nodes to the left

public virtual void RotateLeft(OrderedTreeNode x)

Parameters

x OrderedTreeNode

RotateRight(OrderedTreeNode)

RotateRight Rebalance the tree by rotating the nodes to the right

public virtual void RotateRight(OrderedTreeNode x)

Parameters

x OrderedTreeNode