Final Class: AllKeySetImpl

Oracle® JavaScript Extension Toolkit (JET)
11.1.0

F37999-01

Since:
  • 7.0.0
Module:
  • ojkeyset

QuickNav

Description

The AllKeySetImpl class is a KeySet that represents a set with all keys. This is used for example, to select or expand all items in a component.

Note AllKeySetImpl does not physically contains or have method to return all the keys. Rather, it provides an efficient way to let the component know that it should, for example, select or expand all items without actually having all the keys present in the set.

If the application do require access to the set of all the keys, it should get them directly from the associated DataProvider, or other efficient ways that are specific to the application.


Usage

Signature:

final class AllKeySetImpl<K>

Generic Parameters
ParameterDescription
KType of Key
Typescript Import Format
//To import this class, use the format below.
import {AllKeySetImpl} 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 AllKeySetImpl

Create a new immutable KeySet that represents a set with all keys. Use this KeySet to select or expand all keys.

Methods

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

Returns a new KeySet with the specified keys included in the set. 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 the keys specified have not been explicitly deleted from this KeySet before then this will be a no-op as this KeySet by default includes all keys.
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
AllKeySetImpl

addAll(): AllKeySetImpl<K>

Returns a new KeySet that represents a set with all keys. If this KeySet already is a set with all keys and no keys have been explicitly removed from this KeySet before, then this will be a no-op and it would just return itself. Invoking addAll will cause all keys to be expanded (when this is used for expansion) or selected (when this is used for selection).
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).
Returns:
a new KeySet with no keys.
Type
KeySetImpl

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

Returns a new KeySet based on this set with the specified keys deleted. In the case of AllKeySetImpl this represents the keys to exclude from all keys. 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 the keys specified are already deleted then it will be a no-op and 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
AllKeySetImpl

deletedValues : {Set<K>}

Returns a set of keys of the items that are excluded from this set. Specifically, this returns a set of keys that are collapsed (when this is used for expansion) or de-selected (when this is used for selection).
Returns:
the keys of the deleted items.
Type
Set<K>

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 this set, false otherwise.
Type
boolean

isAddAll : {boolean}

Determines whether this is a set that represents all keys. Since this KeySet represents all keys, this method will always return true.
Returns:
true if this is a set that reprsents all keys, false otherwise.
Type
boolean