Class UriFactory
A static helper class for interning URIs to reduce memory usage.
Inheritance
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public static class UriFactory
Fields
| Improve this Doc View SourceRoot
Get or set the root URI factory for this app domain.
Declaration
public static IUriFactory Root
Field Value
Type | Description |
---|---|
IUriFactory |
Remarks
Internally, the root URI factory is used as the default factory when no other factory is specified in constructors/method parameters.
Properties
| Improve this Doc View SourceInternUris
Get / set the flag that controls the caching of Uri instances constructed by this factory.
Declaration
public static bool InternUris { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
When InternUris is set to true, the factory will cache each constructed URI against the original string value used for construction and return a cached Uri where available in preference to calling the Uri constructor.
Methods
| Improve this Doc View SourceClear()
Clears all interned URIs.
Declaration
public static void Clear()
Create(string)
Creates a URI interning it if interning is enabled via the InternUris property.
Declaration
public static Uri Create(string uri)
Parameters
Type | Name | Description |
---|---|---|
string | uri | String URI. |
Returns
Type | Description |
---|---|
System.Uri |
Remarks
When URI interning is disabled this is equivalent to just invoking the constructor of the System.Uri class.