|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sofya.base.MethodSignature.NameComparator
public static class MethodSignature.NameComparator
A utility comparator which orders method signatures.
Method signatures are compared in the following manner:
Constructor Summary | |
---|---|
MethodSignature.NameComparator()
Constructs a comparator which will operate in strict accordance with the contract of the compare method. |
|
MethodSignature.NameComparator(int equalsRelation)
Constructs a comparator which returns the specified relation for equal objects. |
Method Summary | |
---|---|
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares two method signatures using the lexical alphabetical relation of the two signatures' full names. |
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 |
Constructor Detail |
---|
public MethodSignature.NameComparator()
compare
method.
public MethodSignature.NameComparator(int equalsRelation)
This is provided to allow TreeSet/Maps to be used as sorted
lists by treating multiple equivalent values/keys as distinct
from each other, since the java collections do not provide any
true sorted list (bag) implementation. Note that for both data
structures an iterator must be obtained to extract multiple
redundant values/keys, as the get
methods will
only return the first matching value/mapping. In the case of
a TreeMap, mappings must be removed after each value retrieval
using a redundant key or the first mapping encountered will be
retrieved every time.
equalsRelation
- Value specifying which ordering the
comparator should report for equal objects:
compare(java.lang.Object, java.lang.Object)
method to
violate its contract (specifically transitivity of equality),
and become inconsistent with equals.Method Detail |
---|
public int compare(java.lang.Object o1, java.lang.Object o2)
compare
in interface java.util.Comparator
o1
- Method signature for comparison.o2
- Method signature for comparison to o1
.
java.lang.ClassCastException
- If either arguments is an instance of
any class (including a subclass) other than
MethodSignature
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |