Class NumericNode
A Valued Node with a numeric value.
Inheritance
System.Object
NumericNode
Implements
System.IEquatable<BaseLiteralNode>
System.IComparable<BaseLiteralNode>
System.IEquatable<LiteralNode>
System.IComparable<LiteralNode>
System.IComparable<INode>
System.IComparable<IBlankNode>
System.IComparable<IGraphLiteralNode>
System.IComparable<ILiteralNode>
System.IComparable<IUriNode>
System.IComparable<IVariableNode>
System.IEquatable<INode>
System.IEquatable<IBlankNode>
System.IEquatable<IGraphLiteralNode>
System.IEquatable<ILiteralNode>
System.IEquatable<IUriNode>
System.IEquatable<IVariableNode>
System.Runtime.Serialization.ISerializable
System.Xml.Serialization.IXmlSerializable
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: VDS.RDF.Nodes
Assembly: dotNetRDF.dll
Syntax
public abstract class NumericNode : LiteralNode, ILiteralNode, IEquatable<BaseLiteralNode>, IComparable<BaseLiteralNode>, IEquatable<LiteralNode>, IComparable<LiteralNode>, IValuedNode, INode, IComparable<INode>, IComparable<IBlankNode>, IComparable<IGraphLiteralNode>, IComparable<ILiteralNode>, IComparable<IUriNode>, IComparable<IVariableNode>, IEquatable<INode>, IEquatable<IBlankNode>, IEquatable<IGraphLiteralNode>, IEquatable<ILiteralNode>, IEquatable<IUriNode>, IEquatable<IVariableNode>, ISerializable, IXmlSerializable
Constructors
| Improve this Doc View SourceNumericNode(IGraph, String, Uri, SparqlNumericType)
Creates a new numeric valued node.
Declaration
protected NumericNode(IGraph g, string value, Uri datatype, SparqlNumericType numType)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph the node belongs to. |
System.String | value | Lexical Value. |
System.Uri | datatype | Datatype URI. |
SparqlNumericType | numType | SPARQL Numeric Type. |
Properties
| Improve this Doc View SourceEffectiveType
Gets the URI of the datatype this valued node represents as a String.
Declaration
public string EffectiveType { get; }
Property Value
Type | Description |
---|---|
System.String |
NumericType
Gets the numeric type of the node.
Declaration
public SparqlNumericType NumericType { get; }
Property Value
Type | Description |
---|---|
SparqlNumericType |
Methods
| Improve this Doc View SourceAsBoolean()
Gets the boolean value.
Declaration
public bool AsBoolean()
Returns
Type | Description |
---|---|
System.Boolean |
AsDateTime()
Throws an error as numerics cannot be converted to date times.
Declaration
public DateTime AsDateTime()
Returns
Type | Description |
---|---|
System.DateTime |
AsDateTimeOffset()
Throws an error as numerics cannot be converted to date times.
Declaration
public DateTimeOffset AsDateTimeOffset()
Returns
Type | Description |
---|---|
System.DateTimeOffset |
AsDecimal()
Gets the decimal value.
Declaration
public abstract decimal AsDecimal()
Returns
Type | Description |
---|---|
System.Decimal |
AsDouble()
Gets the double value.
Declaration
public abstract double AsDouble()
Returns
Type | Description |
---|---|
System.Double |
AsFloat()
Gets the float value.
Declaration
public abstract float AsFloat()
Returns
Type | Description |
---|---|
System.Single |
AsInteger()
Gets the integer value.
Declaration
public abstract long AsInteger()
Returns
Type | Description |
---|---|
System.Int64 |
AsString()
Gets the string value of the node.
Declaration
public string AsString()
Returns
Type | Description |
---|---|
System.String |
AsTimeSpan()
Throws an error as numerics cannot be cast to a time span.
Declaration
public TimeSpan AsTimeSpan()
Returns
Type | Description |
---|---|
System.TimeSpan |
Implements
System.IEquatable<T>
System.IComparable<T>
System.IEquatable<T>
System.IComparable<T>
System.IComparable<T>
System.IComparable<T>
System.IComparable<T>
System.IComparable<T>
System.IComparable<T>
System.IComparable<T>
System.IEquatable<T>
System.IEquatable<T>
System.IEquatable<T>
System.IEquatable<T>
System.IEquatable<T>
System.IEquatable<T>
System.Runtime.Serialization.ISerializable
System.Xml.Serialization.IXmlSerializable