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()
MinXML
public abstract void setName(@NonNull java.lang.String name) throws java.lang.UnsupportedOperationException
MinXML
public abstract java.util.Map<java.lang.String,java.lang.String> asMap()
MinXML
Map
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()
MinXML
Map
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 MinXML
public void trimToSize()
MinXML
IllegalStateException
.trimToSize
in interface MinXML
public 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)
MinXML
public java.lang.String getAttribute(java.lang.String key)
MinXML
getAttribute
in interface MinXML
key
- the attribute key being looked uppublic java.lang.String getAttribute(java.lang.String key, java.lang.String default_value)
MinXML
getAttribute
in interface MinXML
key
- the attribute key being looked updefault_value
- the value to be returned if there is no matching attributepublic boolean hasAttribute()
MinXML
hasAttribute
in interface MinXML
public boolean hasAttribute(java.lang.String key)
MinXML
hasAttribute
in interface MinXML
key
- the attribute keypublic boolean hasAttribute(java.lang.String key, java.lang.String value)
MinXML
hasAttribute
in interface MinXML
key
- attribute being checkedvalue
- value being checkedpublic boolean hasntAttribute()
MinXML
hasntAttribute
in interface MinXML
public int sizeAttributes()
MinXML
RuntimeException
must
be raised.sizeAttributes
in interface MinXML
public java.lang.Iterable<java.lang.String> keys()
MinXML
Map
, 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()
MinXML
public java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> entries()
MinXML
Map
, 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()
MinXML
asMapEntries
in interface MinXML
public void putAttribute(java.lang.String key, java.lang.String value) throws java.lang.UnsupportedOperationException
MinXML
UnsupportedOperationException
.putAttribute
in interface MinXML
key
- 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 MinXML
java.lang.UnsupportedOperationException
public void clearAttributes() throws java.lang.UnsupportedOperationException
MinXML
UnsupportedOperationException
.clearAttributes
in interface MinXML
java.lang.UnsupportedOperationException
- if the implementing class cannot support this methodpublic boolean isntEmpty()
MinXML
public void print(java.io.Writer w)
MinXML
Writer
.public void prettyPrint(java.io.Writer w)
MinXML
Writer
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 MinXML
w
- the Writer
to use.public void print(java.io.PrintWriter pw)
MinXML
PrintWriter
. The rendering will
not contain any newlines. This is the same as the string generated by toString().public void prettyPrint(java.io.PrintWriter pw)
MinXML
PrintWriter
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 MinXML
pw
- the PrintWriter
to use.public java.lang.String toString()
toString
in class java.lang.Object
public @NonNull MinXML shallowCopy()
MinXML
UnsupportedOperationException
shallowCopy
in interface MinXML
public @NonNull MinXML deepCopy()
MinXML
UnsupportedOperationException