Methods Summary |
---|
public void | addAttribute(java.lang.String raw, java.lang.String type, java.lang.String value)Adds an attribute.
addAttribute(null, null, raw, type, value);
|
public void | addAttribute(java.lang.String uri, java.lang.String local, java.lang.String raw, java.lang.String type, java.lang.String value)Adds an attribute.
ListNode node = new ListNode(uri, local, raw, type, value);
if (length == 0) {
head = node;
}
else {
tail.next = node;
}
tail = node;
length++;
|
public int | getIndex(java.lang.String raw)Returns the index of the specified attribute.
ListNode place = head;
int index = 0;
while (place != null) {
if (place.raw.equals(raw)) {
return index;
}
index++;
place = place.next;
}
return -1;
|
public int | getIndex(java.lang.String uri, java.lang.String local)Returns the index of the specified attribute.
ListNode place = head;
int index = 0;
while (place != null) {
if (place.uri.equals(uri) && place.local.equals(local)) {
return index;
}
index++;
place = place.next;
}
return -1;
|
public int | getLength()Returns the number of attributes.
return length;
|
public sax.helpers.AttributesImpl$ListNode | getListNode(java.lang.String uri, java.lang.String local)Returns the first node with the specified uri and local.
if (uri != null && local != null) {
ListNode place = head;
while (place != null) {
if (place.uri != null && place.local != null &&
place.uri.equals(uri) && place.local.equals(local)) {
return place;
}
place = place.next;
}
}
return null;
|
private sax.helpers.AttributesImpl$ListNode | getListNode(java.lang.String raw)Returns the first node with the specified raw name.
if (raw != null) {
for (ListNode place = head; place != null; place = place.next) {
if (place.raw != null && place.raw.equals(raw)) {
return place;
}
}
}
return null;
|
private sax.helpers.AttributesImpl$ListNode | getListNodeAt(int i)Returns the node at the specified index.
for (ListNode place = head; place != null; place = place.next) {
if (--i == -1) {
return place;
}
}
return null;
|
public java.lang.String | getLocalName(int index)Returns the attribute local name by index.
ListNode node = getListNodeAt(index);
return node != null ? node.local : null;
|
public java.lang.String | getQName(int index)Returns the attribute raw name by index.
ListNode node = getListNodeAt(index);
return node != null ? node.raw : null;
|
public java.lang.String | getType(int index)Returns the attribute type by index.
ListNode node = getListNodeAt(index);
return (node != null) ? node.type : null;
|
public java.lang.String | getType(java.lang.String uri, java.lang.String local)Returns the attribute type by uri and local.
ListNode node = getListNode(uri, local);
return (node != null) ? node.type : null;
|
public java.lang.String | getType(java.lang.String raw)Returns the attribute type by raw name.
ListNode node = getListNode(raw);
return (node != null) ? node.type : null;
|
public java.lang.String | getURI(int index)Returns the attribute URI by index.
ListNode node = getListNodeAt(index);
return node != null ? node.uri : null;
|
public java.lang.String | getValue(int index)Returns the attribute value by index.
ListNode node = getListNodeAt(index);
return (node != null) ? node.value : null;
|
public java.lang.String | getValue(java.lang.String uri, java.lang.String local)Returns the attribute value by uri and local.
ListNode node = getListNode(uri, local);
return (node != null) ? node.value : null;
|
public java.lang.String | getValue(java.lang.String raw)Returns the attribute value by raw name.
ListNode node = getListNode(raw);
return (node != null) ? node.value : null;
|
public void | insertAttributeAt(int index, java.lang.String raw, java.lang.String type, java.lang.String value)Inserts an attribute.
insertAttributeAt(index, null, null, raw, type, value);
|
public void | insertAttributeAt(int index, java.lang.String uri, java.lang.String local, java.lang.String raw, java.lang.String type, java.lang.String value)Inserts an attribute.
// if list is empty, add attribute
if (length == 0 || index >= length) {
addAttribute(uri, local, raw, type, value);
return;
}
// insert at beginning of list
ListNode node = new ListNode(uri, local, raw, type, value);
if (index < 1) {
node.next = head;
head = node;
}
else {
ListNode prev = getListNodeAt(index - 1);
node.next = prev.next;
prev.next = node;
}
length++;
|
public void | removeAttribute(java.lang.String raw)Removes the specified attribute.
removeAttributeAt(getIndex(raw));
|
public void | removeAttribute(java.lang.String uri, java.lang.String local)Removes the specified attribute.
removeAttributeAt(getIndex(uri, local));
|
public void | removeAttributeAt(int index)Removes an attribute.
if (length == 0) {
return;
}
if (index == 0) {
head = head.next;
if (head == null) {
tail = null;
}
length--;
}
else {
ListNode prev = getListNodeAt(index - 1);
ListNode node = getListNodeAt(index);
if (node != null) {
prev.next = node.next;
if (node == tail) {
tail = prev;
}
length--;
}
}
|
public java.lang.String | toString()Returns a string representation of this object.
StringBuffer str = new StringBuffer();
str.append('[");
str.append("len=");
str.append(length);
str.append(", {");
for (ListNode place = head; place != null; place = place.next) {
str.append(place.toString());
if (place.next != null) {
str.append(", ");
}
}
str.append("}]");
return str.toString();
|