public class FlexiMinXML extends AbsFlexiMinXML
attributes, children, name
Constructor and Description |
---|
FlexiMinXML(@NonNull java.lang.String name)
Constructs an element with a given name but no attributes or
children.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
static @NonNull FlexiMinXML |
deepCopy(@NonNull MinXML element) |
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). |
static MinXML |
fromString(java.lang.String input) |
java.lang.String |
getAttribute(java.lang.String key)
Gets the attribute value associated with a given key.
|
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.
|
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) |
static @NonNull FlexiMinXML |
shallowCopy(@NonNull MinXML element)
Creates a copy of the top-level node of the given element.
|
int |
size() |
int |
sizeAttributes()
Returns the number of attributes of the element.
|
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.
|
asMap, getName, quickGetAttributes, setName, toList
add, add, addAll, addAll, asMapEntries, asMapKeys, clearAttributes, deepCopy, equals, get, getAttribute, getAttributes, hashCode, hasName, listIterator, listIterator, prettyPrint, prettyPrint, print, print, putAllAttributes, putAttribute, remove, remove, removeAll, retainAll, set, shallowCopy, subList, toArray, toArray, toString
public FlexiMinXML(@NonNull java.lang.String name)
name
- the name of the elementpublic static MinXML fromString(java.lang.String input)
public static @NonNull FlexiMinXML shallowCopy(@NonNull MinXML element)
element
- the element to copypublic static @NonNull FlexiMinXML deepCopy(@NonNull MinXML element)
public void trimToSize()
MinXML
IllegalStateException
.trimToSize
in interface MinXML
trimToSize
in class AbsMinXML
public java.lang.String getAttribute(java.lang.String key)
MinXML
getAttribute
in interface MinXML
getAttribute
in class AbsMinXML
key
- the attribute key being looked uppublic boolean hasAttribute()
MinXML
hasAttribute
in interface MinXML
hasAttribute
in class AbsMinXML
public boolean hasAttribute(java.lang.String key)
MinXML
hasAttribute
in interface MinXML
hasAttribute
in class AbsMinXML
key
- the attribute keypublic boolean hasAttribute(java.lang.String key, java.lang.String value)
MinXML
hasAttribute
in interface MinXML
hasAttribute
in class AbsMinXML
key
- attribute being checkedvalue
- value being checkedpublic boolean hasntAttribute()
MinXML
hasntAttribute
in interface MinXML
hasntAttribute
in class AbsMinXML
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 int sizeAttributes()
MinXML
RuntimeException
must
be raised.sizeAttributes
in interface MinXML
sizeAttributes
in class AbsMinXML
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 void clear()
public boolean contains(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<MinXML>
containsAll
in interface java.util.List<MinXML>
containsAll
in class AbsMinXML
public int indexOf(java.lang.Object o)
public boolean isEmpty()
public java.util.Iterator<MinXML> iterator()
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<MinXML>
lastIndexOf
in class AbsMinXML
public int size()