@hydra-cg/heracles.ts > LinksCollection
Provides a collection of ILink that can be filtered with relevant criteria.
class:
↳ ResourceFilterableCollection<ILink>
↳ LinksCollection
⊕ new LinksCollection(links?: Iterable
<ILink>): LinksCollection
Overrides ResourceFilterableCollection.constructor
Defined in DataModel/Collections/LinksCollection.ts:14
Initializes a new instance of the LinksCollection class with initial collections of links to filter.
Parameters:
Name | Type |
---|---|
Optional links |
Iterable <ILink> |
Returns: LinksCollection
<Static>
empty● empty: LinksCollection = new LinksCollection()
Defined in DataModel/Collections/LinksCollection.ts:14
Defines an empty links collection.
constant: {LinksCollection}
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
<ILink>
Inherited from FilterableCollection.[@iterator](/Heracles.ts/classes/filterablecollection.html#_iterator)
Defined in DataModel/Collections/FilterableCollection.ts:111
inheritdoc:
Returns: Iterator
<ILink>
▸ 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
<ILink>): LinksCollection
Overrides ResourceFilterableCollection.createInstance
Defined in DataModel/Collections/LinksCollection.ts:47
Parameters:
Name | Type |
---|---|
items | Iterable <ILink> |
Returns: LinksCollection
▸ first(): ILink
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: ILink
▸ last(): ILink
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: ILink
<Protected>
narrowFiltersWith▸ narrowFiltersWith<TValue
>(predicate: string
, matchEvaluator: function
): FilterableCollection<ILink>
▸ narrowFiltersWith(predicate: string
, value: string
| RegExp
): FilterableCollection<ILink>
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<ILink>
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<ILink>
▸ nonBlank(): ResourceFilterableCollection<ILink>
Inherited from ResourceFilterableCollection.nonBlank
Defined in DataModel/Collections/ResourceFilterableCollection.ts:50
Obtains a collection of resources being non blank nodes;
Returns: ResourceFilterableCollection<ILink>
▸ ofIri(iri: string
): ResourceFilterableCollection<ILink>
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<ILink>
▸ ofType(iri: string
): ResourceFilterableCollection<ILink>
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<ILink>
▸ toArray(): ILink[]
Inherited from FilterableCollection.toArray
Defined in DataModel/Collections/FilterableCollection.ts:101
Flattens this collection to a standard array.
Returns: ILink[]
▸ where(matchEvaluator: function
): FilterableCollection<ILink>
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<ILink>
▸ withRelationOf(iri: string
): LinksCollection
Defined in DataModel/Collections/LinksCollection.ts:30
Obtains a collection of links of a given relation type.
Parameters:
Name | Type | Description |
---|---|---|
iri | string |
Expected relation type. |
Returns: LinksCollection
▸ withTemplate(): LinksCollection
Defined in DataModel/Collections/LinksCollection.ts:43
Obtains a collection of operations being an Hydra TemplatedLink.
Returns: LinksCollection