Heracles.ts

@hydra-cg/heracles.ts > ResourceFilterableCollection

Class: ResourceFilterableCollection

Provides a collection of IResource that can be filtered with relevant criteria.

class:

Type parameters

T : IResource

Hierarchy

FilterableCollection<T>

↳ ResourceFilterableCollection

OperationsCollection

LinksCollection

MappingsCollection

IHypermediaContainer

HypermediaContainer

Index

Constructors

Accessors

Methods


Constructors

constructor

new ResourceFilterableCollection(resources?: Iterable<T>): ResourceFilterableCollection

Overrides FilterableCollection.constructor

Defined in DataModel/Collections/ResourceFilterableCollection.ts:8

Initializes a new instance of the {@link ResourceFilterableCollection} class with initial collections of resources to filter.

Parameters:

Name Type
Optional resources Iterable<T>

Returns: ResourceFilterableCollection


Accessors

length

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


Methods

__@iterator

__@iterator(): Iterator<T>

Inherited from FilterableCollection.[@iterator](/Heracles.ts/classes/filterablecollection.html#_iterator)

Defined in DataModel/Collections/FilterableCollection.ts:111

inheritdoc:

Returns: Iterator<T>


any

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<T>): ResourceFilterableCollection<T>

Overrides FilterableCollection.createInstance

Defined in DataModel/Collections/ResourceFilterableCollection.ts:54

Parameters:

Name Type
items Iterable<T>

Returns: ResourceFilterableCollection<T>


first

first(): T

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: T


last

last(): T

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: T


<Protected> narrowFiltersWith

narrowFiltersWith<TValue>(predicate: string, matchEvaluator: function): FilterableCollection<T>

narrowFiltersWith(predicate: string, value: string | RegExp): FilterableCollection<T>

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:

TValue

Parameters:

Name Type Description
predicate string Predicate of the filter.
matchEvaluator function Match evaluator of the predicate to filter.

Returns: FilterableCollection<T>

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<T>


nonBlank

nonBlank(): ResourceFilterableCollection<T>

Defined in DataModel/Collections/ResourceFilterableCollection.ts:50

Obtains a collection of resources being non blank nodes;

Returns: ResourceFilterableCollection<T>


ofIri

ofIri(iri: string): ResourceFilterableCollection<T>

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<T>


ofType

ofType(iri: string): ResourceFilterableCollection<T>

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<T>


toArray

toArray(): T[]

Inherited from FilterableCollection.toArray

Defined in DataModel/Collections/FilterableCollection.ts:101

Flattens this collection to a standard array.

Returns: T[]


where

where(matchEvaluator: function): FilterableCollection<T>

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<T>