Class TreeTable
A tree table.
Implements
Inherited Members
Namespace: Syncfusion.Collections.BinaryTree
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class TreeTable : Disposable, ITreeTable, IList, ICollection, IEnumerable, IDisposable
Constructors
TreeTable(Boolean)
Initializes a new TreeTable.
Declaration
public TreeTable(bool sorted)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | sorted |
Properties
Comparer
Gets / sets the comparer used by sorted trees.
Declaration
public IComparer Comparer { get; set; }
Property Value
Type |
---|
System.Collections.IComparer |
IsFixedSize
Indicates whether the nodes can be added or removed.
Declaration
public bool IsFixedSize { get; }
Property Value
Type |
---|
System.Boolean |
IsInitializing
Indicates whether BeginInit was called.
Declaration
public bool IsInitializing { get; }
Property Value
Type |
---|
System.Boolean |
IsReadOnly
Indicates whether the tree is Read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type |
---|
System.Boolean |
IsSynchronized
Not supported.
Declaration
public bool IsSynchronized { get; }
Property Value
Type |
---|
System.Boolean |
Item[Int32]
Gets / sets an item at the specified index.
Declaration
public ITreeTableNode this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type |
---|
ITreeTableNode |
Reserved1
Declaration
public bool Reserved1 { get; set; }
Property Value
Type |
---|
System.Boolean |
Reserved2
Declaration
public bool Reserved2 { get; set; }
Property Value
Type |
---|
System.Boolean |
Reserved3
Declaration
public bool Reserved3 { get; set; }
Property Value
Type |
---|
System.Boolean |
Reserved4
Declaration
public bool Reserved4 { get; set; }
Property Value
Type |
---|
System.Boolean |
ReservedShort
Declaration
public int ReservedShort { get; set; }
Property Value
Type |
---|
System.Int32 |
Root
Gets / sets the root node.
Declaration
public ITreeTableNode Root { get; set; }
Property Value
Type |
---|
ITreeTableNode |
Sorted
Indicates whether tree is sorted.
Declaration
public bool Sorted { get; }
Property Value
Type |
---|
System.Boolean |
SyncRoot
Not implemented.
Declaration
public object SyncRoot { get; }
Property Value
Type |
---|
System.Object |
Tag
Gets / sets the tag that can be associated with this object.
Declaration
public object Tag { get; set; }
Property Value
Type |
---|
System.Object |
Methods
Add(ITreeTableNode)
Appends a node.
Declaration
public int Add(ITreeTableNode value)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableNode | value | Node value to append. |
Returns
Type |
---|
System.Int32 |
AddIfNotExists(Object, ITreeTableEntry)
Adds a node in a sorted tree only if no node with the same value has not been added yet.
Declaration
public ITreeTableEntry AddIfNotExists(object key, ITreeTableEntry value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | |
ITreeTableEntry | value | Node value to add. |
Returns
Type |
---|
ITreeTableEntry |
AddSorted(ITreeTableNode)
Adds a node into a sorted tree.
Declaration
public int AddSorted(ITreeTableNode value)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableNode | value | Node value to add. |
Returns
Type |
---|
System.Int32 |
BeginInit()
Optimizes insertion of many elements when tree is initialized for the first time.
Declaration
public virtual void BeginInit()
Clear()
Clears all nodes in the tree.
Declaration
public void Clear()
Contains(ITreeTableNode)
Indicates whether the node belongs to this tree.
Declaration
public bool Contains(ITreeTableNode value)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableNode | value | Node value to search for. |
Returns
Type | Description |
---|---|
System.Boolean | True if node belongs to this tree; false otherwise. |
CopyTo(ITreeTableNode[], Int32)
Copies the elements from this collection into an array.
Declaration
public void CopyTo(ITreeTableNode[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableNode[] | array | The destination array. |
System.Int32 | index | The starting index in the destination array. |
Dispose(Boolean)
Releases the unmanaged resources used by the Component and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Overrides
Remarks
See the documentation for the System.ComponentModel.Component class and its Dispose member.
EndInit()
Ends optimization of insertion of elements when tree is initialized for the first time.
Declaration
public virtual void EndInit()
FindHighestSmallerOrEqualKey(Object)
Finds the node in a sorted tree is just one entry ahead of the node with the specified key. It searches for the largest possible key that is smaller than the specified key.
Declaration
public ITreeTableEntry FindHighestSmallerOrEqualKey(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | The key to search. |
Returns
Type | Description |
---|---|
ITreeTableEntry | The node; NULL if not found. |
FindKey(Object)
Finds a node in a sorted tree that matches the specified key.
Declaration
public ITreeTableEntry FindKey(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | The key to search. |
Returns
Type | Description |
---|---|
ITreeTableEntry | The node; NULL if not found. |
GetCount()
Returns the number of leaves.
Declaration
public int GetCount()
Returns
Type |
---|
System.Int32 |
GetEnumerator()
Returns a TreeTableEnumerator.
Declaration
public TreeTableEnumerator GetEnumerator()
Returns
Type |
---|
TreeTableEnumerator |
GetNextEntry(ITreeTableEntry)
Optimized access to a subsequent entry.
Declaration
public ITreeTableEntry GetNextEntry(ITreeTableEntry current)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableEntry | current |
Returns
Type |
---|
ITreeTableEntry |
GetPreviousEntry(ITreeTableEntry)
Optimized access to the previous entry.
Declaration
public ITreeTableEntry GetPreviousEntry(ITreeTableEntry current)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableEntry | current |
Returns
Type |
---|
ITreeTableEntry |
IndexOf(ITreeTableNode)
Returns the position of a node.
Declaration
public int IndexOf(ITreeTableNode value)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableNode | value | Node value to look for. |
Returns
Type | Description |
---|---|
System.Int32 | Index of the node if found. |
IndexOfKey(Object)
Finds a node in a sorted tree.
Declaration
public int IndexOfKey(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key |
Returns
Type |
---|
System.Int32 |
Insert(Int32, ITreeTableNode)
Inserts a node at the specified index.
Declaration
public void Insert(int index, ITreeTableNode value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index value where the node is to be inserted. |
ITreeTableNode | value | Value of the node to insert. |
Remove(ITreeTableNode)
Removes the specified node.
Declaration
public void Remove(ITreeTableNode value)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableNode | value | Node value to look for and remove. |
RemoveAt(Int32)
Removes a node at the specified position.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
ResetCache()
Resets the cache.
Declaration
public void ResetCache()
Explicit Interface Implementations
ICollection.CopyTo(Array, Int32)
Copies the element from this collection into an array.
Declaration
void ICollection.CopyTo(Array array, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Array | array | The destination array. |
System.Int32 | index | The starting index in thedestination array. |
ICollection.Count
Returns the number of leaves.
Declaration
int ICollection.Count { get; }
Returns
Type |
---|
System.Int32 |
IEnumerable.GetEnumerator()
Returns an enumerator.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type |
---|
System.Collections.IEnumerator |
IList.Add(Object)
Adds the specified node to the tree.
Declaration
int IList.Add(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value |
Returns
Type |
---|
System.Int32 |
IList.Contains(Object)
Indicates whether the node belongs to this tree.
Declaration
bool IList.Contains(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value |
Returns
Type |
---|
System.Boolean |
IList.get_Item(Int32)
Declaration
object IList.get_Item(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type |
---|
System.Object |
IList.IndexOf(Object)
Returns the index of the specified node.
Declaration
int IList.IndexOf(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value |
Returns
Type |
---|
System.Int32 |
IList.Insert(Int32, Object)
Inserts a node at the specified index.
Declaration
void IList.Insert(int index, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
System.Object | value |
IList.Item[Int32]
Gets / sets the item with the specified index.
Declaration
object IList.this[] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index value of the item. |
Returns
Type |
---|
System.Object |
IList.Remove(Object)
Removes the node with the specified value.
Declaration
void IList.Remove(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value |
IList.set_Item(Int32, Object)
Declaration
void IList.set_Item(int index, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
System.Object | value |