Package net.sourceforge.plantuml.style
package net.sourceforge.plantuml.style
Provides classes used to manage
Style.
- See Also:
-
ClassDescriptionAn immutable, sorted, duplicate-free collection of
StyleAtom, backed by a plain array instead of aTreeSet-- a candidate replacement for theSortedSet<StyleAtom>thatStyleQuerycurrently keeps asatoms(not yet wired in there: this class stands on its own, validated by its own unit tests, before any caller is switched over).Thedepth(n)/*side of a style declaration or query, encoded as alongbitmask instead of the ad-hoclevel/isStaredpair the legacynet.sourceforge.plantuml.style.StyleKeycarries -- levels are assumed to fit in0..63, which every real mindmap/wbs diagram does.One "tag" a style declaration or a query element can carry, put under a single total order so aStyleAtomTriecan index both families together instead of keeping a separate plain/legacy split: aSName(the common, fast path -- compared by ordinal) or a stereotype name (the rarer path -- compared lexicographically).A set-trie: every declaration is stored under the sorted path ofStyleAtomit requires, andStyleAtomTrie.findMatching(StyleQuery)walks it once to return every declaration whose required atom set is a subset of the query's -- the same test as the legacyelement.snames.containsAll(declaration.snames)(plus stereotypes), but sharing common prefixes across declarations instead of re-testing each one in turn, and with no separate plain/legacy storage to keep in sync.The fast, queryable counterpart of the oldStyleStorage: every loadedStyleis indexed by its query's tags in aStyleAtomTrie, soStyleIndex.findMatching(StyleQuery)only ever visits declarations that could possibly match a query, instead of the old linear scan over every style ever loaded checkingStyleSignatureBasic#matchAllone by one -- the actual fix for the slow style resolution (StyleBuilder.getMergedStyle(net.sourceforge.plantuml.style.StyleQuery),StyleBuilder.getMergedStyleSpecial(net.sourceforge.plantuml.style.StyleQuery, int)) this wholeparser2engine was built for.What aStyleAtomTrieis asked to resolve: the element's tags (itsSNameset plus any stereotypes, e.g.