API / geotoolkit / util / Collection / Collection
util.Collection.Collection
Collection represents a group of objects, known as its elements
| Name | Type |
|---|---|
T | any |
↳
Collection
Constructors
Methods
Constructors
• new Collection<T>()
| Name | Type |
|---|---|
T | any |
EventDispatcher.constructor
Methods
▸ add(items): void
Add item(s)
| Name | Type | Description |
|---|---|---|
items | T | T[] | item(s) to add |
void
▸ clear(): void
Clear All
void
▸ dispose(): void
Dispose.
void
▸ get(index): T
Return item by index
| Name | Type | Description |
|---|---|---|
index | number | index of the item in collection |
T
▸ getClassName(): string
string
▸ getCount(): number
Return number of items int eh collection
number
▸ getIterator(): Iterator<T>
Get Iterator
Iterator<T>
▸ hasEventListener(type, callback?): boolean
Check if a list of event listeners for this type contains this listener
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
Optional callback | Function | to be called, if null, check if any callback is registered |
boolean
EventDispatcher.hasEventListener
▸ indexOf(item): number
Return index of item ( index of the specified child or -1 if node is not found)
| Name | Type | Description |
|---|---|---|
item | T | item to check index |
number
▸ insert(index, item): void
insert item at index
| Name | Type | Description |
|---|---|---|
index | number | index |
item | T | item to insert |
void
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ notify<E>(type, source, args?): Collection<T>
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | Collection<any> | of the event |
Optional args | EventMap<T>[E] | arguments of the event |
Collection<T>
this
▸ off<E>(type?, callback?): Collection<T>
Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
Optional type | E | type of the event |
Optional callback | (eventType: E, sender: Collection<T>, args: EventMap<T>[E]) => void | function to be called |
Collection<T>
this
▸ on<E>(type, callback): Collection<T>
Attach listener on event that will be called whenever the specified event is delivered to the target
If the callback function is already in the list of event listeners for this target, the function is not added a second time.
If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of event or property |
callback | (eventType: E, sender: Collection<T>, args: EventMap<T>[E]) => void | to be called |
Collection<T>
this
▸ remove(item): void
Remove
| Name | Type | Description |
|---|---|---|
item | T | item |
void
▸ removeAtIndex(index): void
Remove At index
| Name | Type | Description |
|---|---|---|
index | number | index of item |
void
▸ setSilent(bool): Collection<T>
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
Collection<T>
this
▸ Static getClassName(): string
string