![]() |
Satsuma
a delicious .NET graph library
|
Represents a standard GraphML property (attribute), which may assign primitive values to objects. More...
Public Member Functions | |
void | Clear () |
Clears all values (including the default value) stored by the property. More... | |
override XElement | GetKeyElement () |
Returns a <key> element for the property. More... | |
override void | ReadData (XElement x, object key) |
Parses an XML value definition. More... | |
StandardProperty () | |
bool | TryGetValue (object key, out T result) |
Tries to get the property value for a given object. More... | |
override XElement | WriteData (object key) |
Writes an XML value definition. More... | |
Protected Member Functions | |
virtual void | LoadFromKeyElement (XElement xKey) |
Loads the declaration of the property from the given <key> element (including the default value). More... | |
override T | ReadValue (XElement x) |
Parses an XML value definition. More... | |
override XElement | WriteValue (T value) |
Writes an XML value definition. More... | |
Static Protected Member Functions | |
static string | DomainToGraphML (PropertyDomain domain) |
Converts the domain to a GraphML string representation. More... | |
static PropertyDomain | ParseDomain (string s) |
Parses the string representation of a GraphML domain. More... | |
Properties | |
T | DefaultValue [get, set] |
The default value of the property. Undefined if HasDefaultValue is false . More... | |
PropertyDomain | Domain [get, set] |
The domain of the property, i.e. the kind of objects the property applies to. More... | |
bool | HasDefaultValue [get, set] |
true if DefaultValue should be taken into account as the default value for this property. More... | |
string | Id [get, set] |
The unique identifier of the property in the GraphML file. More... | |
string | Name [get, set] |
The name of the property. More... | |
Dictionary< object, T > | Values [get, set] |
The values of the property for the individual objects. More... | |
Represents a standard GraphML property (attribute), which may assign primitive values to objects.
Example (assigning string values to nodes):
T | Must be one of the types corresponding to the values of StandardType. |
Definition at line 252 of file IO.GraphML.cs.
Satsuma.IO.GraphML.StandardProperty< T >.StandardProperty | ( | ) |
Definition at line 259 of file IO.GraphML.cs.
|
inherited |
Clears all values (including the default value) stored by the property.
Implements Satsuma.IClearable.
Definition at line 158 of file IO.GraphML.cs.
|
staticprotectedinherited |
Converts the domain to a GraphML string representation.
Definition at line 70 of file IO.GraphML.cs.
|
virtual |
Returns a <key>
element for the property.
This element declares the property in a GraphML file.
Reimplemented from Satsuma.IO.GraphML.GraphMLProperty.
Definition at line 313 of file IO.GraphML.cs.
|
protectedvirtualinherited |
Loads the declaration of the property from the given <key>
element (including the default value).
Definition at line 95 of file IO.GraphML.cs.
|
staticprotectedinherited |
Parses the string representation of a GraphML domain.
Possible input values: "node", "edge", "graph", "all".
Definition at line 83 of file IO.GraphML.cs.
|
virtualinherited |
Parses an XML value definition.
x | A <data> or <default> element, which stores either the default value or the value taken on a node, arc or graph. If null, the data for key is erased. |
key | A Node, Arc or IGraph, for which the loaded value will be stored. If null, the default value is loaded/erased. |
Implements Satsuma.IO.GraphML.GraphMLProperty.
Definition at line 181 of file IO.GraphML.cs.
|
protectedvirtual |
Parses an XML value definition.
x | A non-null <data> or <default> element compatible with the property. |
Implements Satsuma.IO.GraphML.DictionaryProperty< T >.
Definition at line 320 of file IO.GraphML.cs.
|
inherited |
Tries to get the property value for a given object.
First, key is looked up in Values. If not found, DefaultValue is used, unless HasDefaultValue is false
.
key | A Node, Arc or IGraph. |
result | The property value assigned to the key is returned here, or default(T) if none found. |
true
if key was found as a key in Values, or HasDefaultValue is true
. Definition at line 169 of file IO.GraphML.cs.
|
virtualinherited |
Writes an XML value definition.
key | A Node, Arc or IGraph, whose value will be returned as an XML representation. If null, the default value is used. |
Implements Satsuma.IO.GraphML.GraphMLProperty.
Definition at line 201 of file IO.GraphML.cs.
|
protectedvirtual |
Writes an XML value definition.
Implements Satsuma.IO.GraphML.DictionaryProperty< T >.
Definition at line 325 of file IO.GraphML.cs.
|
getsetinherited |
The default value of the property. Undefined if HasDefaultValue is false
.
Definition at line 145 of file IO.GraphML.cs.
|
getsetinherited |
The domain of the property, i.e. the kind of objects the property applies to.
Definition at line 58 of file IO.GraphML.cs.
|
getsetinherited |
true
if DefaultValue should be taken into account as the default value for this property.
Definition at line 143 of file IO.GraphML.cs.
|
getsetinherited |
The unique identifier of the property in the GraphML file.
This field is for internal use. When saving, it is ignored and replaced by an auto-generated identifier.
Definition at line 62 of file IO.GraphML.cs.
|
getsetinherited |
The name of the property.
Can be either null or a nonempty string. It is advisable but not necessary to keep names unique.
Definition at line 56 of file IO.GraphML.cs.
|
getsetinherited |