TreeNode 1.5.2
A library to manipulate phylogenetic trees
Loading...
Searching...
No Matches
PhyloTree.AttributeDictionary Class Reference

Represents the attributes of a node. Attributes Name, Length and Support are always included. See the respective properties for default values. More...

Inheritance diagram for PhyloTree.AttributeDictionary:

Public Member Functions

void Add (string name, object value)
 Adds an attribute with the specified name and value to the AttributeDictionary. Throws an exception if the AttributeDictionary already contains an attribute with the same name . More...
 
void Add (KeyValuePair< string, object > item)
 Adds an attribute with the specified name and value to the AttributeDictionary. Throws an exception if the AttributeDictionary already contains an attribute with the same name. More...
 
void Clear ()
 Removes all attributes from the dictionary, except the "Name", "Length" and "Support" attributes. More...
 
bool Contains (KeyValuePair< string, object > item)
 Determines whether the AttributeDictionary contains the specified item . More...
 
bool ContainsKey (string name)
 Determines whether the AttributeDictionary contains an attribute with the specified name name . More...
 
void CopyTo (KeyValuePair< string, object >[] array, int arrayIndex)
 Copies the elements of the AttributeDictionary to an array, starting at a specific array index. More...
 
IEnumerator< KeyValuePair< string, object > > GetEnumerator ()
 Returns an enumerator that iterates through the AttributeDictionary. More...
 
bool Remove (string name)
 Removes the attribute with the specified name from the AttributeDictionary. Attributes "Name", "Length" and "Support" cannot be removed. More...
 
bool Remove (KeyValuePair< string, object > item)
 Removes the attribute with the specified name from the AttributeDictionary. Attributes "Name", "Length" and "Support" cannot be removed. More...
 
bool TryGetValue (string name, out object value)
 Gets the value of the attribute with the specified name . Getting the value of attributes "Name", "Length" and "Support" does not require a dictionary lookup. More...
 
 AttributeDictionary ()
 Constructs an AttributeDictionary containing only the "Name", "Length" and "Support" attributes. More...
 

Properties

string Name [get, set]
 The name of this node (e.g. the species name for leaf nodes). Default is "". Getting the value of this property does not require a dictionary lookup. More...
 
double Length [get, set]
 The length of the branch leading to this node. This is double.NaN for branches whose length is not specified (e.g. the root node). Getting the value of this property does not require a dictionary lookup. More...
 
double Support [get, set]
 The support value of this node. This is double.NaN for branches whose support is not specified. The interpretation of the support value depends on how the tree was built. Getting the value of this property does not require a dictionary lookup. More...
 
object this[string name] [get, set]
 Gets or sets the value of the attribute with the specified name . Getting the value of attributes "Name", "Length" and "Support" does not require a dictionary lookup. More...
 
ICollection< string > Keys [get]
 Gets a collection containing the names of the attributes in the AttributeDictionary. More...
 
ICollection< object > Values [get]
 Gets a collection containing the values of the attributes in the AttributeDictionary. More...
 
int Count [get]
 Gets the number of attributes contained in the AttributeDictionary. More...
 
bool IsReadOnly [get]
 Determine whether the AttributeDictionary is read-only. This is always false in the current implementation. More...
 

Detailed Description

Represents the attributes of a node. Attributes Name, Length and Support are always included. See the respective properties for default values.

Definition at line 13 of file AttributeDictionary.cs.

Constructor & Destructor Documentation

◆ AttributeDictionary()

PhyloTree.AttributeDictionary.AttributeDictionary ( )

Constructs an AttributeDictionary containing only the "Name", "Length" and "Support" attributes.

Definition at line 294 of file AttributeDictionary.cs.

Member Function Documentation

◆ Add() [1/2]

void PhyloTree.AttributeDictionary.Add ( KeyValuePair< string, object >  item)

Adds an attribute with the specified name and value to the AttributeDictionary. Throws an exception if the AttributeDictionary already contains an attribute with the same name.

Parameters
itemThe item to be added to the dictionary.

Definition at line 153 of file AttributeDictionary.cs.

◆ Add() [2/2]

void PhyloTree.AttributeDictionary.Add ( string  name,
object  value 
)

Adds an attribute with the specified name and value to the AttributeDictionary. Throws an exception if the AttributeDictionary already contains an attribute with the same name .

Parameters
nameThe name of the attribute.
valueThe value of the attribute.

Definition at line 144 of file AttributeDictionary.cs.

◆ Clear()

void PhyloTree.AttributeDictionary.Clear ( )

Removes all attributes from the dictionary, except the "Name", "Length" and "Support" attributes.

Definition at line 161 of file AttributeDictionary.cs.

◆ Contains()

bool PhyloTree.AttributeDictionary.Contains ( KeyValuePair< string, object >  item)

Determines whether the AttributeDictionary contains the specified item .

Parameters
itemThe item to locate in the AttributeDictionary
Returns
true if the AttributeDictionary contains the specified item , false otherwise.

Definition at line 179 of file AttributeDictionary.cs.

◆ ContainsKey()

bool PhyloTree.AttributeDictionary.ContainsKey ( string  name)

Determines whether the AttributeDictionary contains an attribute with the specified name name .

Parameters
nameThe name of the attribute to locate.
Returns
true if the AttributeDictionary contains an attribute with the specified name , false otherwise.

Definition at line 189 of file AttributeDictionary.cs.

◆ CopyTo()

void PhyloTree.AttributeDictionary.CopyTo ( KeyValuePair< string, object >[]  array,
int  arrayIndex 
)

Copies the elements of the AttributeDictionary to an array, starting at a specific array index.

Parameters
arrayThe array to which the elements will be copied.
arrayIndexThe index at which to start copying.

Definition at line 199 of file AttributeDictionary.cs.

◆ GetEnumerator()

IEnumerator< KeyValuePair< string, object > > PhyloTree.AttributeDictionary.GetEnumerator ( )

Returns an enumerator that iterates through the AttributeDictionary.

Returns
An enumerator that iterates through the AttributeDictionary.

Definition at line 214 of file AttributeDictionary.cs.

◆ Remove() [1/2]

bool PhyloTree.AttributeDictionary.Remove ( KeyValuePair< string, object >  item)

Removes the attribute with the specified name from the AttributeDictionary. Attributes "Name", "Length" and "Support" cannot be removed.

Parameters
itemThe attribute to remove (only the name will be used).
Returns
A bool indicating whether the attribute was succesfully removed.

Definition at line 241 of file AttributeDictionary.cs.

◆ Remove() [2/2]

bool PhyloTree.AttributeDictionary.Remove ( string  name)

Removes the attribute with the specified name from the AttributeDictionary. Attributes "Name", "Length" and "Support" cannot be removed.

Parameters
nameThe name of the attribute to remove.
Returns
A bool indicating whether the attribute was succesfully removed.

Definition at line 224 of file AttributeDictionary.cs.

◆ TryGetValue()

bool PhyloTree.AttributeDictionary.TryGetValue ( string  name,
out object  value 
)

Gets the value of the attribute with the specified name . Getting the value of attributes "Name", "Length" and "Support" does not require a dictionary lookup.

Parameters
nameThe name of the attribute to get.
valueWhen this method returns, contains the value of the attribute with the specified name , if this is found in the AttributeDictionary, or null otherwise.
Returns
A bool indicating whether an attribute with the specified name was found in the AttributeDictionary.

Definition at line 259 of file AttributeDictionary.cs.

Property Documentation

◆ Count

int PhyloTree.AttributeDictionary.Count
get

Gets the number of attributes contained in the AttributeDictionary.

Definition at line 132 of file AttributeDictionary.cs.

◆ IsReadOnly

bool PhyloTree.AttributeDictionary.IsReadOnly
get

Determine whether the AttributeDictionary is read-only. This is always false in the current implementation.

Definition at line 137 of file AttributeDictionary.cs.

◆ Keys

ICollection<string> PhyloTree.AttributeDictionary.Keys
get

Gets a collection containing the names of the attributes in the AttributeDictionary.

Definition at line 122 of file AttributeDictionary.cs.

◆ Length

double PhyloTree.AttributeDictionary.Length
getset

The length of the branch leading to this node. This is double.NaN for branches whose length is not specified (e.g. the root node). Getting the value of this property does not require a dictionary lookup.

Definition at line 40 of file AttributeDictionary.cs.

◆ Name

string PhyloTree.AttributeDictionary.Name
getset

The name of this node (e.g. the species name for leaf nodes). Default is "". Getting the value of this property does not require a dictionary lookup.

Definition at line 22 of file AttributeDictionary.cs.

◆ Support

double PhyloTree.AttributeDictionary.Support
getset

The support value of this node. This is double.NaN for branches whose support is not specified. The interpretation of the support value depends on how the tree was built. Getting the value of this property does not require a dictionary lookup.

Definition at line 58 of file AttributeDictionary.cs.

◆ this[string name]

object PhyloTree.AttributeDictionary.this[string name]
getset

Gets or sets the value of the attribute with the specified name . Getting the value of attributes "Name", "Length" and "Support" does not require a dictionary lookup.

Parameters
nameThe name of the attribute to get/set.
Returns
The value of the attribute, boxed into an object.

Definition at line 76 of file AttributeDictionary.cs.

◆ Values

ICollection<object> PhyloTree.AttributeDictionary.Values
get

Gets a collection containing the values of the attributes in the AttributeDictionary.

Definition at line 127 of file AttributeDictionary.cs.


The documentation for this class was generated from the following file: