Show / Hide Table of Contents

Interface IUriFactory

Defines the interface for a factory class that creates URIs and optionally interns them to reduce memory usage from repeated creation of URIs with the same string value.

Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public interface IUriFactory

Properties

| Edit this page View Source

InternUris

Controls whether URI instances are interned by this instance.

Declaration
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 Source

Clear()

Clears all interned URIs.

Declaration
void Clear()
| Edit this page View Source

Create(string)

Create a Uri instance, interning it if InternUris is set to true.

Declaration
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.

| Edit this page View Source

Create(Uri, string)

Create a Uri instance, interning it if InternUris is set to true.

Declaration
Uri Create(Uri baseUri, string relativeUri)
Parameters
Type Name Description
Uri baseUri

The base URI to resolve relativeUri against.

string relativeUri

String URI.

Returns
Type Description
Uri
Remarks

When URI interning is disabled this is equivalent to just invoking the constructor of the Uri class.

| Edit this page View Source

TryGetUri(string, out Uri)

Return the interned URI instance if available.

Declaration
bool TryGetUri(string uri, out Uri value)
Parameters
Type Name Description
string uri

The string URI to return an interned URI instance for.

Uri value

Receives the interned Uri instance if it is available, null otherwise.

Returns
Type Description
bool

True if an interned Uri instance was found in this factory or its parent, false otherwise.

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Properties
    • InternUris
  • Methods
    • Clear()
    • Create(string)
    • Create(Uri, string)
    • TryGetUri(string, out Uri)
  • Extension Methods
Back to top Generated by DocFX