Show / Hide Table of Contents

Class CachingUriFactory

The default implementation of IUriFactory which caches the URI instances it creates when InternUris is set to true.

Inheritance
object
CachingUriFactory
Implements
IUriFactory
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public class CachingUriFactory : IUriFactory

Constructors

| Edit this page View Source

CachingUriFactory()

Creates a new factory instance as a child of the root UriFactory as specified by Root.

Declaration
public CachingUriFactory()
| Edit this page View Source

CachingUriFactory(IUriFactory)

Creates a new factory instances as a child of the specified parent factory.

Declaration
public CachingUriFactory(IUriFactory parent)
Parameters
Type Name Description
IUriFactory parent

The parent factory instance. May be null.

Properties

| Edit this page View Source

InternUris

Get / set the flag that controls the caching of Uri instances constructed by this factory.

Declaration
public 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
public void Clear()
| Edit this page View Source

Create(string)

Creates a URI interning it if interning is enabled via the InternUris property.

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

Implements

IUriFactory

Extension Methods

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