Class ThreadSafeTripleCollection
Thread Safe decorator for triple collections.
Implements
System.Collections.Generic.IEnumerable<Triple>
System.Collections.IEnumerable
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRDF.dll
Syntax
public class ThreadSafeTripleCollection : WrapperTripleCollection, IEnumerable<Triple>, IEnumerable, IDisposable
Remarks
Depending on the platform this either uses System.Threading.ReaderWriterLockSlim to provide MRSW concurrency or it uses System.Threading.Monitor to provide exclusive access concurrency, either way usage is thread safe.
Constructors
| Improve this Doc View SourceThreadSafeTripleCollection()
Creates a new thread safe triple collection which wraps a new instance of the default unindexed TripleCollection.
Declaration
public ThreadSafeTripleCollection()
ThreadSafeTripleCollection(BaseTripleCollection)
Creates a new thread safe triple collection which wraps the provided triple collection.
Declaration
public ThreadSafeTripleCollection(BaseTripleCollection tripleCollection)
Parameters
Type | Name | Description |
---|---|---|
BaseTripleCollection | tripleCollection | Triple Collection. |
Properties
| Improve this Doc View SourceCount
Gets the Number of Triples in the Triple Collection.
Declaration
public override int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
| Improve this Doc View SourceItem[Triple]
Gets the original instance of a specific Triple from the Triple Collection.
Declaration
public override Triple this[Triple t] { get; }
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple. |
Property Value
Type | Description |
---|---|
Triple |
Overrides
| Improve this Doc View SourceObjectNodes
Gets all the Nodes which are Objects of Triples in the Triple Collectio.
Declaration
public override IEnumerable<INode> ObjectNodes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<INode> |
Overrides
| Improve this Doc View SourcePredicateNodes
Gets all the Nodes which are Predicates of Triples in the Triple Collection.
Declaration
public override IEnumerable<INode> PredicateNodes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<INode> |
Overrides
| Improve this Doc View SourceSubjectNodes
Gets all the Nodes which are Subjects of Triples in the Triple Collection.
Declaration
public override IEnumerable<INode> SubjectNodes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<INode> |
Overrides
Methods
| Improve this Doc View SourceAdd(Triple)
Adds a Triple to the Collection.
Declaration
protected override bool Add(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple to add. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceContains(Triple)
Determines whether a given Triple is in the Triple Collection.
Declaration
public override bool Contains(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | The Triple to test. |
Returns
Type | Description |
---|---|
System.Boolean | True if the Triple already exists in the Triple Collection. |
Overrides
| Improve this Doc View SourceDelete(Triple)
Deletes a Triple from the Collection.
Declaration
protected override bool Delete(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple to remove. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Remarks
Deleting something that doesn't exist has no effect and gives no error.
|
Improve this Doc
View Source
Dispose()
Disposes of a Triple Collection.
Declaration
public override void Dispose()
Overrides
| Improve this Doc View SourceEnterReadLock()
Enters the read lock.
Declaration
protected void EnterReadLock()
EnterWriteLock()
Enters the write lock.
Declaration
protected void EnterWriteLock()
ExitReadLock()
Exists the read lock.
Declaration
protected void ExitReadLock()
ExitWriteLock()
Exists the write lock.
Declaration
protected void ExitWriteLock()
GetEnumerator()
Gets the Enumerator for the Collection.
Declaration
public override IEnumerator<Triple> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<Triple> |
Overrides
| Improve this Doc View SourceWithObject(INode)
Gets all triples with the given Object.
Declaration
public override IEnumerable<Triple> WithObject(INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | obj | Object. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Triple> |
Overrides
| Improve this Doc View SourceWithPredicate(INode)
Gets all triples with the given predicate.
Declaration
public override IEnumerable<Triple> WithPredicate(INode pred)
Parameters
Type | Name | Description |
---|---|---|
INode | pred | Predicate. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Triple> |
Overrides
| Improve this Doc View SourceWithPredicateObject(INode, INode)
Gets all triples with the given predicate object.
Declaration
public override IEnumerable<Triple> WithPredicateObject(INode pred, INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | pred | Predicate. |
INode | obj | Object. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Triple> |
Overrides
| Improve this Doc View SourceWithSubject(INode)
Gets all the triples with the given subject.
Declaration
public override IEnumerable<Triple> WithSubject(INode subj)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Triple> |
Overrides
| Improve this Doc View SourceWithSubjectObject(INode, INode)
Gets all the triples with the given subject and object.
Declaration
public override IEnumerable<Triple> WithSubjectObject(INode subj, INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
INode | obj | Object. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Triple> |
Overrides
| Improve this Doc View SourceWithSubjectPredicate(INode, INode)
Gets all triples with the given subject and predicate.
Declaration
public override IEnumerable<Triple> WithSubjectPredicate(INode subj, INode pred)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
INode | pred | Predicate. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Triple> |
Overrides
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
System.IDisposable