@hydra-cg/heracles.ts > OperationsCollection
Provides a collection of IOperation that can be filtered with relevant criteria.
class:
↳ ResourceFilterableCollection<IOperation>
↳ OperationsCollection
⊕ new OperationsCollection(operations?: Iterable<IOperation>): OperationsCollection
Overrides ResourceFilterableCollection.constructor
Defined in DataModel/Collections/OperationsCollection.ts:15
Initializes a new instance of the OperationsCollection class with initial collections of operations to filter.
Parameters:
| Name | Type |
|---|---|
Optional operations |
Iterable<IOperation> |
Returns: OperationsCollection
<Static> empty● empty: OperationsCollection = new OperationsCollection()
Defined in DataModel/Collections/OperationsCollection.ts:15
Defines an empty operations collection.
constant: {OperationsCollection}
get length(): number
Inherited from FilterableCollection.length
Defined in DataModel/Collections/FilterableCollection.ts:38
Gets the number of items in this collection.
readonly:
Returns: number
▸ __@iterator(): Iterator<IOperation>
Inherited from FilterableCollection.[@iterator](/Heracles.ts/classes/filterablecollection.html#_iterator)
Defined in DataModel/Collections/FilterableCollection.ts:111
inheritdoc:
Returns: Iterator<IOperation>
▸ any(): boolean
Inherited from FilterableCollection.any
Defined in DataModel/Collections/FilterableCollection.ts:52
Checks whether this collection has any items fitlered.
Returns: boolean
<Protected> createInstance▸ createInstance(items: Iterable<IOperation>): OperationsCollection
Overrides ResourceFilterableCollection.createInstance
Defined in DataModel/Collections/OperationsCollection.ts:48
Parameters:
| Name | Type |
|---|---|
| items | Iterable<IOperation> |
Returns: OperationsCollection
▸ expecting(iri: string): OperationsCollection
Defined in DataModel/Collections/OperationsCollection.ts:31
Obtains a collection of operations expecting a given type.
Parameters:
| Name | Type | Description |
|---|---|---|
| iri | string |
Expected type. |
Returns: OperationsCollection
▸ first(): IOperation
Inherited from FilterableCollection.first
Defined in DataModel/Collections/FilterableCollection.ts:60
Gets the first item of the collection or null if there are no items matching the criteria.
Returns: IOperation
▸ last(): IOperation
Inherited from FilterableCollection.last
Defined in DataModel/Collections/FilterableCollection.ts:69
Gets the last item of the collection or null if there are no items matching the criteria.
Returns: IOperation
<Protected> narrowFiltersWith▸ narrowFiltersWith<TValue>(predicate: string, matchEvaluator: function): FilterableCollection<IOperation>
▸ narrowFiltersWith(predicate: string, value: string | RegExp): FilterableCollection<IOperation>
Inherited from FilterableCollection.narrowFiltersWith
Defined in DataModel/Collections/FilterableCollection.ts:129
Creates a new instance of the FilterableCollection with filter made narrower with given predicate.
Type parameters:
Parameters:
| Name | Type | Description |
|---|---|---|
| predicate | string |
Predicate of the filter. |
| matchEvaluator | function |
Match evaluator of the predicate to filter. |
Returns: FilterableCollection<IOperation>
Inherited from FilterableCollection.narrowFiltersWith
Defined in DataModel/Collections/FilterableCollection.ts:140
Creates a new instance of the FilterableCollection with filter made narrower with given predicate.
Parameters:
| Name | Type | Description |
|---|---|---|
| predicate | string |
Predicate of the filter. |
| value | string | RegExp |
Either value or regular expression to match the value of the predicate to filter. |
Returns: FilterableCollection<IOperation>
▸ nonBlank(): ResourceFilterableCollection<IOperation>
Inherited from ResourceFilterableCollection.nonBlank
Defined in DataModel/Collections/ResourceFilterableCollection.ts:50
Obtains a collection of resources being non blank nodes;
Returns: ResourceFilterableCollection<IOperation>
▸ ofIri(iri: string): ResourceFilterableCollection<IOperation>
Inherited from ResourceFilterableCollection.ofIri
Defined in DataModel/Collections/ResourceFilterableCollection.ts:37
Obtains a collection of resources of a given Iri;
Parameters:
| Name | Type | Description |
|---|---|---|
| iri | string |
Iri of the resources. |
Returns: ResourceFilterableCollection<IOperation>
▸ ofType(iri: string): ResourceFilterableCollection<IOperation>
Inherited from ResourceFilterableCollection.ofType
Defined in DataModel/Collections/ResourceFilterableCollection.ts:23
Obtains a collection of resources of a given type;
Parameters:
| Name | Type | Description |
|---|---|---|
| iri | string |
Type of the resources. |
Returns: ResourceFilterableCollection<IOperation>
▸ toArray(): IOperation[]
Inherited from FilterableCollection.toArray
Defined in DataModel/Collections/FilterableCollection.ts:101
Flattens this collection to a standard array.
Returns: IOperation[]
▸ where(matchEvaluator: function): FilterableCollection<IOperation>
Inherited from FilterableCollection.where
Defined in DataModel/Collections/FilterableCollection.ts:83
Filters the collection with a generic match evaluator.
Parameters:
| Name | Type | Description |
|---|---|---|
| matchEvaluator | function |
Match evaluation delegate. |
Returns: FilterableCollection<IOperation>
▸ withTemplate(): OperationsCollection
Defined in DataModel/Collections/OperationsCollection.ts:44
Obtains a collection of operations being an hydra:IriTemplate.
Returns: OperationsCollection