[]
        
(Showing Draft Content)

GC.Spread.Sheets.GanttSheet.Collection

Class: Collection<T>

Sheets.GanttSheet.Collection

Type parameters

Name
T

Table of contents

Constructors

Methods

Constructors

constructor

new Collection<T>()

Creates an instance of Collection.

classdesc A collection of objects.

Type parameters

Name
T

Methods

add

add(item): void

Adds the item into list.

Parameters

Name Type Description
item T The item to add.

Returns

void


all

all(): T[]

Get all item form collection.

Returns

T[]

A collection item list.


clear

clear(): void

Removes all items from list.

Returns

void


getIndexByItem

getIndexByItem(item): number

Get the item index from collection list.

Parameters

Name Type Description
item T The item of the collection.

Returns

number

The index of item in the collection list.


getItemAt

getItemAt(index): T

Get the item with the corresponding index

Parameters

Name Type Description
index number The collection list index.

Returns

T

The rule with the specified name.


getRule

getRule(name): null | T

Gets the item with the specified name.

Parameters

Name Type Description
name string A string value indicates the name of the rule.

Returns

null | T

The rule with the specified name.


insert

insert(item): void

Insert the item into list.

Parameters

Name Type Description
item T The item to insert.

Returns

void


length

length(): number

Get the collection list length.

Returns

number

The collection list length.


remove

remove(item): void

Removes the item from list.

Parameters

Name Type Description
item T The item to remove.

Returns

void


removeAt

removeAt(index): void

Delete the corresponding item from an index

Parameters

Name Type Description
index number The collection list index.

Returns

void


setItemAt

setItemAt(index, item): void

Set the item to index.

Parameters

Name Type Description
index number The index to insert.
item T The item.

Returns

void