Class UriFactory
A static helper class for interning URIs to reduce memory usage.
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public static class UriFactory
Fields
| Edit this page 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
| Edit this page 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 |
---|---|
bool |
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
| Edit this page 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 |
---|---|
Uri |
Remarks
When URI interning is disabled this is equivalent to just invoking the constructor of the Uri class.