ViewTokenList
Token list. Allows handling (adding, removing, retrieving) a set of tokens (for example class names).
Properties
isEmpty : booleanreadonlymodule:engine/view/tokenlist~ViewTokenList#isEmptyReturns true if token list has no tokens set.
size : numberreadonlymodule:engine/view/tokenlist~ViewTokenList#sizeNumber of tokens.
_set : Set<string>privatemodule:engine/view/tokenlist~ViewTokenList#_setThe set of tokens.
Methods
clear() → voidmodule:engine/view/tokenlist~ViewTokenList#clearhas( name ) → booleanmodule:engine/view/tokenlist~ViewTokenList#hasisSimilar( other ) → booleanmodule:engine/view/tokenlist~ViewTokenList#isSimilarkeys() → Array<string>module:engine/view/tokenlist~ViewTokenList#keysremove( tokens ) → voidmodule:engine/view/tokenlist~ViewTokenList#removeset( tokens ) → voidmodule:engine/view/tokenlist~ViewTokenList#setsetTo( value ) → thismodule:engine/view/tokenlist~ViewTokenList#setTotoString() → stringmodule:engine/view/tokenlist~ViewTokenList#toString_canMergeFrom() → booleaninternalmodule:engine/view/tokenlist~ViewTokenList#_canMergeFromUsed by
_canMergeAttributesFromto verify if the given attribute can be merged without conflicts into the attribute.This method is indirectly used by the
ViewDowncastWriterwhile downcasting anViewAttributeElementto merge it with otherAttributeElement.Returns
boolean
_clone() → thisinternalmodule:engine/view/tokenlist~ViewTokenList#_clone_getConsumables( [ name ] ) → Array<string>internalmodule:engine/view/tokenlist~ViewTokenList#_getConsumablesReturns a list of consumables for the attribute.
Could be filtered by the given token name.
Parameters
[ name ] : string
Returns
Array<string>
_getTokensMatch( tokenPattern ) → undefined | Array<string>internalmodule:engine/view/tokenlist~ViewTokenList#_getTokensMatchUsed by the Matcher to collect matching attribute tokens.
Parameters
tokenPattern : string | true | RegExpThe matched token name pattern.
Returns
undefined | Array<string>An array of matching tokens.
_isMatching( other ) → booleaninternalmodule:engine/view/tokenlist~ViewTokenList#_isMatchingUsed by
_canSubtractAttributesOfto verify if the given attribute can be fully subtracted from the attribute.This method is indirectly used by the
ViewDowncastWriterwhile down-casting anViewAttributeElementto unwrap the ViewAttributeElement.Parameters
other : ViewTokenList
Returns
boolean
_mergeFrom( other ) → voidinternalmodule:engine/view/tokenlist~ViewTokenList#_mergeFromUsed by
_mergeAttributesFromto merge a given attribute into the attribute.This method is indirectly used by the
ViewDowncastWriterwhile down-casting anViewAttributeElementto merge it with other ViewAttributeElement.Parameters
other : ViewTokenList
Returns
void