public SmallPrefixedNameSet(boolean nsAware, PrefixedName[] names) { mNsAware = nsAware; int len = names.length; if (len == 0) { // sanity check throw new IllegalStateException("Trying to construct empty PrefixedNameSet"); } mStrings = new String[nsAware ? (len+len) : len]; for (int out = 0, in = 0; in < len; ++in) { PrefixedName nk = names[in]; if (nsAware) { mStrings[out++] = nk.getPrefix(); } mStrings[out++] = nk.getLocalName(); } }
/** * @return True if the set contains specified name; false if not. */ public boolean contains(PrefixedName name) { int len = mStrings.length; String ln = name.getLocalName(); String[] strs = mStrings; if (mNsAware) { String prefix = name.getPrefix(); if (strs[1] == ln && strs[0] == prefix) { return true; } for (int i = 2; i < len; i += 2) { if (strs[i+1] == ln && strs[i] == prefix) { return true; } } } else { if (strs[0] == ln) { return true; } for (int i = 1; i < len; ++i) { if (strs[i] == ln) { return true; } } } return false; }
prefix = ""; } else { // non-default, use the local name prefix = attrName.getLocalName();
int defIx = mContext.addDefaultAttribute(an.getLocalName(), uri, prefix, def); if (defIx < 0) {
public SmallPrefixedNameSet(boolean nsAware, PrefixedName[] names) { mNsAware = nsAware; int len = names.length; if (len == 0) { // sanity check throw new IllegalStateException("Trying to construct empty PrefixedNameSet"); } mStrings = new String[nsAware ? (len+len) : len]; for (int out = 0, in = 0; in < len; ++in) { PrefixedName nk = names[in]; if (nsAware) { mStrings[out++] = nk.getPrefix(); } mStrings[out++] = nk.getLocalName(); } }
public SmallPrefixedNameSet(boolean nsAware, PrefixedName[] names) { mNsAware = nsAware; int len = names.length; if (len == 0) { // sanity check throw new IllegalStateException("Trying to construct empty PrefixedNameSet"); } mStrings = new String[nsAware ? (len+len) : len]; for (int out = 0, in = 0; in < len; ++in) { PrefixedName nk = names[in]; if (nsAware) { mStrings[out++] = nk.getPrefix(); } mStrings[out++] = nk.getLocalName(); } }
public SmallPrefixedNameSet(boolean nsAware, PrefixedName[] names) { mNsAware = nsAware; int len = names.length; if (len == 0) { // sanity check throw new IllegalStateException("Trying to construct empty PrefixedNameSet"); } mStrings = new String[nsAware ? (len+len) : len]; for (int out = 0, in = 0; in < len; ++in) { PrefixedName nk = names[in]; if (nsAware) { mStrings[out++] = nk.getPrefix(); } mStrings[out++] = nk.getLocalName(); } }
public SmallPrefixedNameSet(boolean nsAware, PrefixedName[] names) { mNsAware = nsAware; int len = names.length; if (len == 0) { // sanity check throw new IllegalStateException("Trying to construct empty PrefixedNameSet"); } mStrings = new String[nsAware ? (len+len) : len]; for (int out = 0, in = 0; in < len; ++in) { PrefixedName nk = names[in]; if (nsAware) { mStrings[out++] = nk.getPrefix(); } mStrings[out++] = nk.getLocalName(); } }
String ln = name.getLocalName(); String[] strs = mStrings;
String ln = name.getLocalName(); String[] strs = mStrings;
String ln = name.getLocalName(); String[] strs = mStrings;
/** * @return True if the set contains specified name; false if not. */ public boolean contains(PrefixedName name) { int len = mStrings.length; String ln = name.getLocalName(); String[] strs = mStrings; if (mNsAware) { String prefix = name.getPrefix(); if (strs[1] == ln && strs[0] == prefix) { return true; } for (int i = 2; i < len; i += 2) { if (strs[i+1] == ln && strs[i] == prefix) { return true; } } } else { if (strs[0] == ln) { return true; } for (int i = 1; i < len; ++i) { if (strs[i] == ln) { return true; } } } return false; }
prefix = ""; } else { // non-default, use the local name prefix = attrName.getLocalName();
prefix = ""; } else { // non-default, use the local name prefix = attrName.getLocalName();
prefix = ""; } else { // non-default, use the local name prefix = attrName.getLocalName();
prefix = ""; } else { // non-default, use the local name prefix = attrName.getLocalName();
int defIx = mContext.addDefaultAttribute(an.getLocalName(), uri, prefix, def); if (defIx < 0) {
int defIx = mContext.addDefaultAttribute(an.getLocalName(), uri, prefix, def); if (defIx < 0) {
int defIx = mContext.addDefaultAttribute(an.getLocalName(), uri, prefix, def); if (defIx < 0) {
int defIx = mContext.addDefaultAttribute(an.getLocalName(), uri, prefix, def); if (defIx < 0) {