Final Class: KeySetImpl

Oracle® JavaScript Extension Toolkit (JET)
17.1.0

G12196-01

Since:
  • 7.0.0
Module:
  • ojkeyset

QuickNav

Fields

Description

The KeySetImpl class contains a set of keys of items.


Usage

Signature:

final class KeySetImpl<K> extends KeySet<K> implements ImmutableKeySet<K>

Generic Parameters
ParameterDescription
KType of Key
Typescript Import Format
//To import this class, use the format below.
import {KeySetImpl} from "ojs/ojkeyset";

For additional information visit:


Final classes in JET

Classes in JET are generally final and do not support subclassing. At the moment, final is not enforced. However, this will likely change in an upcoming JET release.


Constructor

new KeySetImpl(keys)

Create a new immutable KeySet containing the keys of items. Use this KeySet when specifying individual keys to select or expand.
Parameters:
Name Type Argument Description
keys Set<K> | Array<K> <optional>
A set of keys to initialize this KeySet with.

Fields

(readonly) keys :{ all: true, keys?: never, deletedKeys: ImmutableKeySet.ImmutableSet<K>} | {all: false, keys: ImmutableKeySet.ImmutableSet<K>, deletedKeys?: never }

An object that contains set of keys that are included in this set.
Since:
  • 14.0.0

Methods

add(keys: Set<K>|Array<K>): KeySetImpl<K>

Returns a new KeySet based on this set with the specified keys included. When a key is added to this KeySet it implies the key will become expanded (when this is used for expansion) or selected (when this is used for selection). If none of the keys specified are being added, then it will be a no-op and this KeySet is returned.
Parameters:
Name Type Description
keys Set | Array a set of keys to add to this KeySet.
Returns:

a new KeySet with the specified keys included.

Type
KeySetImpl

addAll(): AllKeySetImpl<K>

Returns a new KeySet that represents a set with all keys. This will return a AllKeySetImpl instance.
Returns:

a new KeySet that represents a set with all keys.

Type
AllKeySetImpl

clear(): KeySetImpl<K>

Returns a new KeySet containing no keys. Specifically, invoking clear will collapse all keys ( when this is used for expansion) or clear selection (when this is used for selection). If this KeySet already contains no keys then it is a no-op and the current KeySet is returned.
Returns:

a new KeySet with no keys.

Type
KeySetImpl

delete(keys: Set<K>|Array<K>): KeySetImpl<K>

Returns a new KeySet based on this set with the specified keys excluded. When a key is removed from this KeySet it implies the key will become collapsed (when this is used for expansion) or de-selected (when this is used for selection). If none of the keys specified are being deleted, then this KeySet is returned.
Parameters:
Name Type Description
keys Set | Array a set of keys to remove from this KeySet.
Returns:

a new KeySet with the specified keys excluded.

Type
KeySetImpl

has(key) : {boolean}

Determines whether the specified key is in this set. Specifically, this returns true if the key is expanded (when this is used for expansion) or selected (when this is used for selection), and false otherwise.
Parameters:
Name Type Description
key K the key to check whether it is in this set.
Returns:

true if the specified key is in the set, false otherwise.

Type
boolean

isAddAll : {boolean}

Determines whether this is a set that represents all keys. Since this KeySet does not represent all keys, thie method will always return false.
Returns:

true if this is a set that reprsents all keys, false otherwise.

Type
boolean

values : {Set<K>}

Returns the keys in this KeySet in the order they are added. Specifically, this returns a set of keys that are expanded (when this is used for expansion) or selected (when this is used for selection).
Returns:

the keys in this KeySet in the order they are added.

Type
Set<K>