Class AttrCompare

  • All Implemented Interfaces:
    Serializable, Comparator<Attr>

    public class AttrCompare
    extends Object
    implements Comparator<Attr>, Serializable
    Compares two attributes based on the C14n specification.
    • Namespace nodes have a lesser document order position than attribute nodes.
    • An element's namespace nodes are sorted lexicographically by local name (the default namespace node, if one exists, has no local name and is therefore lexicographically least).
    • An element's attribute nodes are sorted lexicographically with namespace URI as the primary key and local name as the secondary key (an empty namespace URI is lexicographically least).
    See Also:
    Serialized Form
    • Constructor Detail

      • AttrCompare

        public AttrCompare()
    • Method Detail

      • compare

        public int compare​(Attr attr0,
                           Attr attr1)
        Compares two attributes based on the C14n specification.
        • Namespace nodes have a lesser document order position than attribute nodes.
        • An element's namespace nodes are sorted lexicographically by local name (the default namespace node, if one exists, has no local name and is therefore lexicographically least).
        • An element's attribute nodes are sorted lexicographically with namespace URI as the primary key and local name as the secondary key (an empty namespace URI is lexicographically least).
        Specified by:
        compare in interface Comparator<Attr>
        Parameters:
        attr0 -
        attr1 -
        Returns:
        returns a negative integer, zero, or a positive integer as obj0 is less than, equal to, or greater than obj1