Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools XML Security Java API Reference 10g Release 3 (10.1.3) B25383-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.xmlsec.util
Class DocOrderComparator

`java.lang.Object
oracle.security.xmlsec.util.DocOrderComparator`

All Implemented Interfaces:
  java.util.Comparator

public class DocOrderComparator
extends java.lang.Object
implements java.util.Comparator

Comparator for sorting nodes into document order as defined by XPath 1.0, and extended for attributes and namespaces by Canonical XML 1.0.

Since:
  2.0

Constructor Summary
`DocOrderComparator()` Creates a new `DocOrderComparator`.

Method Summary
`int` | `compare(java.lang.Object o1, java.lang.Object o2)` Compares the two given nodes' document order.
`static int` | `compareNodes(org.w3c.dom.Node n1, org.w3c.dom.Node n2)`
`boolean` | `equals(java.lang.Object obj)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DocOrderComparator

    public DocOrderComparator()

  Creates a new `DocOrderComparator`.

Method Detail

### compare

    public int compare(java.lang.Object o1,
                       java.lang.Object o2)

  Compares the two given nodes' document order.
  Specified by:
    `compare` in interface `java.util.Comparator`
  Parameters:
    `o1` - The first `Node` to compare.
    `o2` - The second `Node` to compare.
  Returns:
    `-1` if `o1` precedes `o2` in document order; returns `0` if they have the same document order; returns `1` if `o2` precedes `o1`.
  Throws:
    `java.lang.ClassCastException` - If either `o1` or `o2` is not an instance of `org.w3c.dom.Node`.
    `java.lang.IllegalArgumentException` - If the two nodes cannot legitimately be compared for document order (e.g., they are not in the same document).

### equals

    public boolean equals(java.lang.Object obj)

  Specified by:
    `equals` in interface `java.util.Comparator`

### compareNodes

    public static int compareNodes(org.w3c.dom.Node n1,
                                   org.w3c.dom.Node n2)
                            throws XPathException

  Throws:
    `XPathException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools XML Security Java API Reference 10g Release 3 (10.1.3) B25383-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005, 2006 , Oracle. All rights reserved.