TagRegistry
Index
Interfaces
TagFactory
Parameters
obj: T
object from group
tags: Collection<string>
changeable tags collection
Returns void
TagGroup
Type parameters
- T = any
readonlyname
addCommonObject
Appends object to group to use in iterator and filtering functions like TagGroup.getAllWhere, etc.
Parameters
obj: T
rest...tags: string[]
primary tags to be added for object
Returns void
addTagFactory
Tag factory determines additional tags, which should be added for specific object in group.
Parameters
factory: TagFactory<T>
Returns void
addTags
Fetches object tags and appends it to a present collection in fixed order: primary tags added via TagGroup.addTags, serialized tags from object
_tags
property, tags added from TagGroup.addTagFactory.Parameters
obj: T
tags: Collection<string>
collection tor which tags applies
Returns void
addTagsFor
Appends primary tags for object; regardless of whether object is in group or not, tags will be added.
Parameters
obj: T
rest...tags: string[]
primary tags to be added for object
Returns void
getAllWhere
Iterates over existing common objects added via TagGroup.addCommonObject and collects objects matched predicate to list.
Parameters
predicate: TagPredicate<T>
Returns List<T>
getAllWithTag
Fetches objects which has presented tag.
Parameters
tag: string
Returns List<T>
getAllWithTags
Fetches objects which have all of presented tags.
Parameters
tags: Collection<string>
Returns List<T>
getTags
Fetches object tags in fixed order: primary tags added via TagGroup.addTags, serialized tags from object
_tags
property, tags added from TagGroup.addTagFactory.Parameters
obj: T
Returns HashSet<string>
removeCommonObject
Removes object from group, so it no longer can be fetched via TagGroup.getAllWhere, etc.
Parameters
obj: T
Returns void
removeTagsFor
Removes primary tags from object.
Parameters
obj: T
rest...tags: string[]
primary tags to be removed from object
Returns void
TagPredicate
Parameters
obj: T
object from group
tags: Collection<string>
collection with all tags
Returns boolean
Functions
addCommonObject
Appends object to group to use in iterator and filtering functions like TagRegistry.getAllWith, etc.
Parameters
group: string
obj: any
tags: string[]
primary tags to be added for object
Returns void
addTagFactory
Tag factory determines additional tags, which should be added for specific object in group.
Parameters
group: string
factory: TagFactory<any>
Returns void
addTagFor
Appends primary tag for object in group.
Parameters
group: string
obj: any
tag: string
primary tag to be added for object
useExistingObject: boolean
do not append object to group
Returns void
addTagsFor
Appends primary tags for object in group; regardless of whether object is in group or not, tags will be added.
Parameters
group: string
obj: any
tags: string[]
primary tags to be added for object
useExistingObject: boolean
do not append object to group
Returns void
getAllWith
Iterates over existing common objects in group added via TagGroup.addCommonObject and collects objects matched predicate to list.
Parameters
group: string
predicate: TagPredicate<any>
Returns any[]
getAllWithTag
Fetches objects in group which has presented tag.
Parameters
group: string
tag: string
Returns any[]
getAllWithTags
Fetches objects in group which have all of presented tags.
Parameters
group: string
tags: string[]
Returns any[]
getOrCreateGroup
Gets or creates a new tag group to append tags for any objects.
Parameters
name: string
Returns TagGroup
getTagsFor
Fetches object tags in fixed order: primary tags added via TagRegistry.addTagsFor, serialized tags from object
_tags
property, tags added from TagRegistry.addTagFactory.Parameters
group: string
obj: any
Returns string[]
removeCommonObject
Removes object from group, so it no longer can be fetched via TagRegistry.getAllWith, etc.
Parameters
group: string
obj: any
Returns void
removeTagsFor
Removes primary tags from object in group.
Parameters
group: string
obj: any
tags: string[]
primary tags to be removed from object
Returns void
Tag system allows you to assign tags to objects and put them into groups for further object search.
2.0.4b38
Use constant to define group in global scope to reuse/export it:
Obtain tag group automatically via registry: