FileDocCategorySizeDatePackage
Pair.javaAPI DocphoneME MR2 API (J2ME)2955Wed May 02 18:00:34 BST 2007com.sun.ukit.jaxp

Pair

public class Pair extends Object
A name with value pair. This class keeps name with value pair with additional information and supports pair chaining.

Fields Summary
public String
name
The pair name.
public String
value
The pair value.
public char[]
chars
The characters of name.
public char
id
The pair identifier.
public Pair
list
The list of associated pairs.
public Pair
next
The next pair in a chain.
Constructors Summary
Methods Summary
public booleaneqname(char[] qname)
Compares two qualified names.

param
qname A qualified name.
return
true if qualified names are equal.

		char len = (char)chars.length;
		if (len == qname.length) {
			for (char i = 0; i < len; i += 1) {
				if (chars[i] != qname[i])
					return false;
			}
			return true;
		}
		return false;
	
public booleaneqpref(char[] qname)
Compares two qualified name prefixes.

param
qname A qualified name.
return
true if prefixes are equal.

		if (chars[0] == qname[0]) {
			char len = chars[0];
			for (char i = 1; i < len; i += 1) {
				if (chars[i] != qname[i])
					return false;
			}
			return true;
		}
		return false;
	
public java.lang.Stringlocal()
Creates a local name string from qualified name.

return
The local name string.

		if (chars[0] != 0) {
			return new String(chars, chars[0] + 1, chars.length - chars[0] - 1);
		}
		return new String(chars, 1, chars.length - 1);
	
public java.lang.Stringpref()
Creates a prefix string from qualified name.

return
The prefix string.

		if (chars[0] != 0) {
			return new String(chars, 1, chars[0] - 1);
		}
		return "";
	
public java.lang.Stringqname()
Creates a qualified name string from qualified name.

return
The qualified name string.

		return new String(chars, 1, chars.length - 1);