com.ctc.wstx.dtd
Class SmallNameKeySet
java.lang.Object
com.ctc.wstx.dtd.NameKeySet
com.ctc.wstx.dtd.SmallNameKeySet
public final class SmallNameKeySet
- extends NameKeySet
NameKeySet implementation suitable for storing small set of NameKey
values (generally 8 or less). Uses linear search, and is thus the
most compact presentation for a set
Notes about usage:
- All Strings contained in
NameKey
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SmallNameKeySet
public SmallNameKeySet(boolean nsAware,
NameKey[] names)
hasMultiple
public boolean hasMultiple()
- Specified by:
hasMultiple
in class NameKeySet
- Returns:
- True if set contains more than one entry; false if not
(empty or has one)
contains
public boolean contains(NameKey name)
- Specified by:
contains
in class NameKeySet
- Returns:
- True if the set contains specified name; false if not.
appendNames
public void appendNames(java.lang.StringBuffer sb,
java.lang.String sep)
- Specified by:
appendNames
in class NameKeySet