Class TypeByUsageComparator
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.writer.util.TypeByUsageComparator
-
- All Implemented Interfaces:
Comparator<Type>
public final class TypeByUsageComparator extends Object implements Comparator<Type>
A Type comparator based on the 'is-used' relationship.- Given two types T1 and T2, T1 will be considered 'less-than' T2 if T1 is used by T2 transitively.
- Type T1 is considered to be 'used' by type T2 if any field of T2 is of type T1 or T1 is used by any T2 field type TF.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeByUsageComparator
INSTANCE
-
Constructor Summary
Constructors Constructor Description TypeByUsageComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Type t1, Type t2)
-
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
-
-
-
-
Field Detail
-
INSTANCE
public static final TypeByUsageComparator INSTANCE
-
-
Method Detail
-
compare
public int compare(Type t1, Type t2)
- Specified by:
compare
in interfaceComparator<Type>
-
-