|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ivmaidns.util.GComparator net.sf.ivmaidns.dns.DNSRecAltCmp
public final class DNSRecAltCmp
Class for DNS record comparator/metrics (alternative).
This final
comparator class overrides the default
semantics of GComparator
class for the case when
both of the objects being compared are instances of
DNSRecord
class. This class also implements
Metricable
interface to offer records metrics (which
is the level of a resource record name plus one). Instead of
canonical ordering for records (which is defined in RFC2535 and
may be performed through GComparator
instance), this
comparator offers an alternative records ordering (more
convenient for the end users). The alternative ordering differs
from the canonical one in just one thing: records rData is
compared not as a sequence of bytes but as a sequence of its
decoded fields (each field is compared according to its type).
DNSRecord
,
Serialized FormField Summary | |
---|---|
static GComparator |
INSTANCE
An instance of this comparator. |
Constructor Summary | |
---|---|
DNSRecAltCmp()
Constructs a new comparator. |
Method Summary | |
---|---|
int |
evaluate(java.lang.Object obj)
The body of the metrics. |
boolean |
greater(java.lang.Object objA,
java.lang.Object objB)
The body of 'Greater-Than' comparator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final GComparator INSTANCE
INSTANCE
of the superclass).
greater(java.lang.Object, java.lang.Object)
Constructor Detail |
---|
public DNSRecAltCmp()
public
only to allow custom
dynamic instantiation of this class. In other cases,
INSTANCE
should be used.
INSTANCE
Method Detail |
---|
public boolean greater(java.lang.Object objA, java.lang.Object objB)
DNSRecord
class then (objA compareTo(objB, true) > 0)
is
returned, else greater(objA, objB)
of the superclass
is returned.
greater
in class GComparator
objA
- the first compared argument (may be null
).objB
- the second compared argument (may be null
).
true
if and only if objA is greater than
objB.INSTANCE
,
evaluate(java.lang.Object)
public int evaluate(java.lang.Object obj)
DNSRecord
class then
(obj getLevel() + 1)
is returned, else this method
always returns 0
.
evaluate
in interface Metricable
obj
- the object (may be null
) to evaluate.
INSTANCE
,
greater(java.lang.Object, java.lang.Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |