Package net.sf.saxon.om
Enum Class EmptyAttributeMap
- All Implemented Interfaces:
Serializable,Comparable<EmptyAttributeMap>,Constable,Iterable<AttributeInfo>,AttributeMap
An implementation of AttributeMap representing an empty AttributeMap
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionapply(Function<AttributeInfo, AttributeInfo> mapper) Apply a function to every attribute in an attribute map, returning a new attribute mapasList()Get the contents of the AttributeMap as a list ofAttributeInfoobjects.get(NamespaceUri uri, String local) Get the attribute with a given name, if it existsGet the attribute with a given name, if it existsgetByFingerprint(int fingerprint, NamePool namePool) static EmptyAttributeMapGet the value of a no-namespace attribute with a given local name, if it existsgetValue(NamespaceUri uri, String local) Get the value of the attribute with a given name, if it existsitemAt(int index) Get the AttributeInfo with a given index.iterator()put(AttributeInfo att) Replace or add an attribute, to create a new AttributeMapRemove an existing attribute, to create a new AttributeMapintsize()Return the number of attributes in the map.static EmptyAttributeMapReturns the enum constant of this class with the specified name.static EmptyAttributeMap[]values()Returns an array containing the constants of this enum class, in the order they are declared.voidverify()Verify the consistency of the attribute map.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getInstance
-
size
public int size()Description copied from interface:AttributeMapReturn the number of attributes in the map.- Specified by:
sizein interfaceAttributeMap- Returns:
- The number of attributes in the map.
-
get
Description copied from interface:AttributeMapGet the attribute with a given name, if it exists- Specified by:
getin interfaceAttributeMap- Parameters:
name- the name of the required attribute- Returns:
- the required attribute if it exists
-
get
Description copied from interface:AttributeMapGet the attribute with a given name, if it exists- Specified by:
getin interfaceAttributeMap- Parameters:
uri- the namespace part of the name of the required attributelocal- the local part of the name of the required attribute- Returns:
- the required attribute if it exists
-
getByFingerprint
- Specified by:
getByFingerprintin interfaceAttributeMap
-
getValue
Description copied from interface:AttributeMapGet the value of the attribute with a given name, if it exists- Specified by:
getValuein interfaceAttributeMap- Parameters:
uri- the namespace URI part of the name of the required attributelocal- the local part of the name of the required attribute- Returns:
- the value of the required attribute if it exists, or null otherwise
-
getValue
Description copied from interface:AttributeMapGet the value of a no-namespace attribute with a given local name, if it exists- Specified by:
getValuein interfaceAttributeMap- Parameters:
local- the local part of the name of the required attribute; the attribute must be in no namespace- Returns:
- the value of the required attribute if it exists, or null otherwise
-
put
Description copied from interface:AttributeMapReplace or add an attribute, to create a new AttributeMap- Specified by:
putin interfaceAttributeMap- Parameters:
att- the attribute to be added or replaced- Returns:
- the new AttributeMap
-
remove
Description copied from interface:AttributeMapRemove an existing attribute, to create a new AttributeMap- Specified by:
removein interfaceAttributeMap- Parameters:
name- the name of the attribute to be removed (if it exists)- Returns:
- a new attribute map in which the specified attribute is omitted. If the attribute map contains no attribute with the given name, the input attribute map (or one equivalent to it) is returned unchanged
-
verify
public void verify()Description copied from interface:AttributeMapVerify the consistency of the attribute map. This performs an implementation-defined set of checks that might include checking for duplicates, checking that names are well-formed, checking for inappropriate use of the xml and xmlns namespaces, and checking the constraint that attributes in a namespace have a prefix, and vice versa. The default implementation does nothing.- Specified by:
verifyin interfaceAttributeMap
-
iterator
- Specified by:
iteratorin interfaceIterable<AttributeInfo>
-
apply
Description copied from interface:AttributeMapApply a function to every attribute in an attribute map, returning a new attribute map- Specified by:
applyin interfaceAttributeMap- Parameters:
mapper- the mapping function to be applied to each attribute in the attribute map- Returns:
- the attribute containing the attributes after the mapping function has been applied
-
asList
Description copied from interface:AttributeMapGet the contents of the AttributeMap as a list ofAttributeInfoobjects.The order of the returned list must be consistent with document order, with the order of the attribute axis, and with position-based retrieval of individual
AttributeInfoobjects; multiple calls are not required to return the same list, but they must be consistent in their ordering.Modifying the returned list has no effect on the AttributeMap
- Specified by:
asListin interfaceAttributeMap- Returns:
- a list of attributes in the AttributeMap
-
itemAt
Description copied from interface:AttributeMapGet the AttributeInfo with a given index.- Specified by:
itemAtin interfaceAttributeMap- Parameters:
index- the index position, zero-based. The order of index positions of attributes in an attribute map reflects document order.- Returns:
- the AttributeInfo at the given position. In an immutable tree the result will always
be equivalent to calling
asList().get(index). However, if the tree has been modified, then the index values of the attributes may not be contiguous.
-