Heracles.ts

@hydra-cg/heracles.ts > TypesCollection

Class: TypesCollection

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

class:

Hierarchy

FilterableCollection<string>

↳ TypesCollection

Index

Constructors

Properties

Accessors

Methods


Constructors

constructor

new TypesCollection(types?: Iterable<string>): TypesCollection

Overrides FilterableCollection.constructor

Defined in DataModel/Collections/TypesCollection.ts:13

Initializes a new instance of the TypesCollection class with initial collections of types to filter.

Parameters:

Name Type
Optional types Iterable<string>

Returns: TypesCollection


Properties

<Static> empty

● empty: TypesCollection = new TypesCollection()

Defined in DataModel/Collections/TypesCollection.ts:13

Defines an empty types collection.

constant: {TypesCollection}


Accessors

isCollection

get isCollection(): boolean

Defined in DataModel/Collections/TypesCollection.ts:37

Gets a value indicating that resource owning this type’s collection has hydra:Collection type.

Returns: boolean


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

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

Defined in DataModel/Collections/FilterableCollection.ts:111

inheritdoc:

Returns: Iterator<string>


any

any(): boolean

Inherited from FilterableCollection.any

Defined in DataModel/Collections/FilterableCollection.ts:52

Checks whether this collection has any items fitlered.

Returns: boolean


contains

contains(type: string): boolean

Defined in DataModel/Collections/TypesCollection.ts:46

Checks whether this collection has a given type.

Parameters:

Name Type Description
type string Type to look for.

Returns: boolean


<Protected> createInstance

createInstance(items: Iterable<string>): TypesCollection

Overrides FilterableCollection.createInstance

Defined in DataModel/Collections/TypesCollection.ts:54

Parameters:

Name Type
items Iterable<string>

Returns: TypesCollection


except

except(type: string): TypesCollection

Defined in DataModel/Collections/TypesCollection.ts:50

Parameters:

Name Type
type string

Returns: TypesCollection


first

first(): string

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


last

last(): string

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


<Protected> narrowFiltersWith

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

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

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

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


toArray

toArray(): string[]

Inherited from FilterableCollection.toArray

Defined in DataModel/Collections/FilterableCollection.ts:101

Flattens this collection to a standard array.

Returns: string[]


where

where(matchEvaluator: function): FilterableCollection<string>

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