public abstract class AbsMinXML extends java.lang.Object implements MinXML
| Constructor and Description |
|---|
AbsMinXML() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
@NonNull MinXML element) |
boolean |
add(@NonNull MinXML e) |
boolean |
addAll(java.util.Collection<? extends MinXML> c) |
boolean |
addAll(int index,
java.util.Collection<? extends MinXML> c) |
abstract java.util.Map<java.lang.String,java.lang.String> |
asMap()
Returns a
Map that represents the attributes of an element
that shares updates with the original element. |
java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> |
asMapEntries()
Returns an iterator over the attributes of an element that shares
updates with the original element.
|
java.lang.Iterable<java.lang.String> |
asMapKeys()
Returns an iterator over the keys of an element that shares
updates with the original element.
|
void |
clear() |
void |
clearAttributes()
Removes all the attributes of the element.
|
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
@NonNull MinXML |
deepCopy()
deepCopy makes a copy of the topmost node and all the children.
|
java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> |
entries()
Returns a iterator over the attributes of an element, as if the
attributes were implemented as a
Map, which shares updates
with the original element (when updates are allowed). |
boolean |
equals(java.lang.Object o) |
@NonNull MinXML |
get(int index) |
java.lang.String |
getAttribute(java.lang.String key)
Gets the attribute value associated with a given key.
|
java.lang.String |
getAttribute(java.lang.String key,
java.lang.String default_value)
Gets the attribute value associated with a given key.
|
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Returns a
Map representing the attributes of an element that
does not share updates with the original element. |
abstract @NonNull java.lang.String |
getName()
Returns the name of a MinXML element.
|
boolean |
hasAttribute()
Returns true if the element has any attributes, otherwise false.
|
boolean |
hasAttribute(java.lang.String key)
Returns true if the element has an attribute with the given key.
|
boolean |
hasAttribute(java.lang.String key,
java.lang.String value)
Returns true if the element has an attribute with the given key
whose value is equal to the given value.
|
int |
hashCode() |
boolean |
hasName(java.lang.String name)
Returns true if the name of the element is the same as
given string.
|
boolean |
hasntAttribute()
Returns true if the element has no attributes, otherwise false.
|
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty() |
boolean |
isntEmpty()
Returns true if the element has no children.
|
java.util.Iterator<MinXML> |
iterator() |
java.lang.Iterable<java.lang.String> |
keys()
Returns a iterator for the set of keys of the attributes of an element, as if the
attributes were implemented as a
Map, which shares updates
with the original element (when updates are allowed). |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<MinXML> |
listIterator() |
java.util.ListIterator<MinXML> |
listIterator(int index) |
void |
prettyPrint(java.io.PrintWriter pw)
Renders the element using the supplied
PrintWriter such that each start and
end tag are on their own line and the children indented. |
void |
prettyPrint(java.io.Writer w)
Renders the element using the supplied
Writer such that each start and
end tag are on their own line and the children indented. |
void |
print(java.io.PrintWriter pw)
Renders the element using the supplied
PrintWriter. |
void |
print(java.io.Writer w)
Renders the element to the supplied
Writer. |
void |
putAllAttributes(java.util.Map<java.lang.String,java.lang.String> map) |
void |
putAttribute(java.lang.String key,
java.lang.String value)
Puts an attribute key=value into the element.
|
abstract java.util.Map<java.lang.String,java.lang.String> |
quickGetAttributes()
This method will return a map representing the attributes of the
element that is safe to use until the first update of the original element.
|
@NonNull MinXML |
remove(int index) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
@NonNull MinXML |
set(int index,
@NonNull MinXML element) |
abstract void |
setName(@NonNull java.lang.String name)
Changes the name of the element to the given string.
|
@NonNull MinXML |
shallowCopy()
shallowCopy makes a copy of the topmost node but shares the children.
|
int |
size() |
int |
sizeAttributes()
Returns the number of attributes of the element.
|
java.util.List<MinXML> |
subList(int fromIndex,
int toIndex) |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
abstract java.util.List<MinXML> |
toList() |
java.lang.String |
toString() |
void |
trimToSize()
This method signals that there will be no further updates to an element, at least for a while,
and the implementation should consider this a good opportunity to compact the space used
by this element and all child elements, including any shared elements.
|
public abstract @NonNull java.lang.String getName()
MinXMLpublic abstract void setName(@NonNull java.lang.String name)
throws java.lang.UnsupportedOperationException
MinXMLpublic abstract java.util.Map<java.lang.String,java.lang.String> asMap()
MinXMLMap that represents the attributes of an element
that shares updates with the original element.public abstract java.util.Map<java.lang.String,java.lang.String> quickGetAttributes()
public abstract java.util.List<MinXML> toList()
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
MinXMLMap representing the attributes of an element that
does not share updates with the original element. If you want updates
to be shared use asMap.getAttributes in interface MinXMLpublic void trimToSize()
MinXMLIllegalStateException.trimToSize in interface MinXMLpublic void add(int index,
@NonNull MinXML element)
add in interface java.util.List<MinXML>public boolean add(@NonNull MinXML e)
public boolean addAll(java.util.Collection<? extends MinXML> c)
public boolean addAll(int index,
java.util.Collection<? extends MinXML> c)
addAll in interface java.util.List<MinXML>public void clear()
public boolean contains(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> c)
public boolean equals(java.lang.Object o)
public int hashCode()
public int indexOf(java.lang.Object o)
indexOf in interface java.util.List<MinXML>public boolean isEmpty()
public java.util.Iterator<MinXML> iterator()
public int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.List<MinXML>public java.util.ListIterator<MinXML> listIterator()
listIterator in interface java.util.List<MinXML>public java.util.ListIterator<MinXML> listIterator(int index)
listIterator in interface java.util.List<MinXML>public @NonNull MinXML remove(int index)
remove in interface java.util.List<MinXML>public boolean remove(java.lang.Object o)
public boolean removeAll(java.util.Collection<?> c)
public boolean retainAll(java.util.Collection<?> c)
public @NonNull MinXML set(int index, @NonNull MinXML element)
set in interface java.util.List<MinXML>public int size()
public java.util.List<MinXML> subList(int fromIndex, int toIndex)
subList in interface java.util.List<MinXML>public java.lang.Object[] toArray()
public <T> T[] toArray(T[] a)
public boolean hasName(java.lang.String name)
MinXMLpublic java.lang.String getAttribute(java.lang.String key)
MinXMLgetAttribute in interface MinXMLkey - the attribute key being looked uppublic java.lang.String getAttribute(java.lang.String key,
java.lang.String default_value)
MinXMLgetAttribute in interface MinXMLkey - the attribute key being looked updefault_value - the value to be returned if there is no matching attributepublic boolean hasAttribute()
MinXMLhasAttribute in interface MinXMLpublic boolean hasAttribute(java.lang.String key)
MinXMLhasAttribute in interface MinXMLkey - the attribute keypublic boolean hasAttribute(java.lang.String key,
java.lang.String value)
MinXMLhasAttribute in interface MinXMLkey - attribute being checkedvalue - value being checkedpublic boolean hasntAttribute()
MinXMLhasntAttribute in interface MinXMLpublic int sizeAttributes()
MinXMLRuntimeException must
be raised.sizeAttributes in interface MinXMLpublic java.lang.Iterable<java.lang.String> keys()
MinXMLMap, which shares updates
with the original element (when updates are allowed). If you want
updates to be shared use asMapKeys.public java.lang.Iterable<java.lang.String> asMapKeys()
MinXMLpublic java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> entries()
MinXMLMap, which shares updates
with the original element (when updates are allowed). If you want
updates to be shared use asMapEntries.public java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> asMapEntries()
MinXMLasMapEntries in interface MinXMLpublic void putAttribute(java.lang.String key,
java.lang.String value)
throws java.lang.UnsupportedOperationException
MinXMLUnsupportedOperationException.putAttribute in interface MinXMLkey - the attribute keyvalue - the attribute valuejava.lang.UnsupportedOperationException - if the implementing class cannot support this methodpublic void putAllAttributes(java.util.Map<java.lang.String,java.lang.String> map)
throws java.lang.UnsupportedOperationException
putAllAttributes in interface MinXMLjava.lang.UnsupportedOperationExceptionpublic void clearAttributes()
throws java.lang.UnsupportedOperationException
MinXMLUnsupportedOperationException.clearAttributes in interface MinXMLjava.lang.UnsupportedOperationException - if the implementing class cannot support this methodpublic boolean isntEmpty()
MinXMLpublic void print(java.io.Writer w)
MinXMLWriter.public void prettyPrint(java.io.Writer w)
MinXMLWriter such that each start and
end tag are on their own line and the children indented. The output always finishes
with a newline.prettyPrint in interface MinXMLw - the Writer to use.public void print(java.io.PrintWriter pw)
MinXMLPrintWriter. The rendering will
not contain any newlines. This is the same as the string generated by toString().public void prettyPrint(java.io.PrintWriter pw)
MinXMLPrintWriter such that each start and
end tag are on their own line and the children indented. The output always finishes
with a newline.prettyPrint in interface MinXMLpw - the PrintWriter to use.public java.lang.String toString()
toString in class java.lang.Objectpublic @NonNull MinXML shallowCopy()
MinXMLUnsupportedOperationExceptionshallowCopy in interface MinXMLpublic @NonNull MinXML deepCopy()
MinXMLUnsupportedOperationException