Package org.mozilla.javascript
Class ScriptableObject.KeyComparator
java.lang.Object
org.mozilla.javascript.ScriptableObject.KeyComparator
- All Implemented Interfaces:
Serializable
,Comparator<Object>
- Enclosing class:
ScriptableObject
public static final class ScriptableObject.KeyComparator
extends Object
implements Comparator<Object>, Serializable
This comparator sorts property fields in spec-compliant order. Numeric ids first, in numeric
order, followed by string ids, in insertion order. Since this class already keeps string keys
in insertion-time order, we treat all as equal. The "Arrays.sort" method will then not change
their order, but simply move all the numeric properties to the front, since this method is
defined to be stable.
- See Also:
-
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
KeyComparator
public KeyComparator()
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<Object>
-