Package com.ctc.wstx.dtd
Class SmallPrefixedNameSet
- java.lang.Object
-
- com.ctc.wstx.dtd.PrefixedNameSet
-
- com.ctc.wstx.dtd.SmallPrefixedNameSet
-
public final class SmallPrefixedNameSet extends PrefixedNameSet
PrefixedNameSet implementation suitable for storing small set of PrefixedName values (generally 8 or less). Uses linear search, and is thus the most compact presentation for a setNotes about usage:
- All Strings contained in
PrefixedName
instances are assumed interned, so that equality comparison can be done (both for values stored and keys used) - It is assumed that sets are never empty, ie. always contain at least one entry.
- It is assumed that caller has ensured that there are no duplicates in the set -- this data structure does no further validation.
- All Strings contained in
-
-
Constructor Summary
Constructors Constructor Description SmallPrefixedNameSet(boolean nsAware, PrefixedName[] names)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendNames(StringBuilder sb, String sep)
boolean
contains(PrefixedName name)
boolean
hasMultiple()
-
Methods inherited from class com.ctc.wstx.dtd.PrefixedNameSet
toString, toString
-
-
-
-
Constructor Detail
-
SmallPrefixedNameSet
public SmallPrefixedNameSet(boolean nsAware, PrefixedName[] names)
-
-
Method Detail
-
hasMultiple
public boolean hasMultiple()
- Specified by:
hasMultiple
in classPrefixedNameSet
- Returns:
- True if set contains more than one entry; false if not (empty or has one)
-
contains
public boolean contains(PrefixedName name)
- Specified by:
contains
in classPrefixedNameSet
- Returns:
- True if the set contains specified name; false if not.
-
appendNames
public void appendNames(StringBuilder sb, String sep)
- Specified by:
appendNames
in classPrefixedNameSet
-
-