Class Comparator<T>
Listener for https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Comparator.html. Extends https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeListener.htm, implements IComparator<T>
public class Comparator<T> : Comparator, IDynamicMetaObjectProvider, IJVMBridgeCore, IDisposable, IJVMBridgeBaseStatic, IComparator<T>, IJVMBridgeBase, IJVMBridgeDefinition
Type Parameters
T
- Inheritance
-
JVMBridgeBaseJVMBridgeBase<JVMBridgeListener>JVMBridgeListenerComparator<T>
- Implements
-
IJVMBridgeCoreIJVMBridgeBaseStaticIComparator<T>IJVMBridgeBaseIJVMBridgeDefinition
- Inherited Members
-
JVMBridgeListener.Dispose()JVMBridgeListener.AutoInitJVMBridgeListener.IsBridgeStaticJVMBridgeListener.IsBridgeCloseableJVMBridgeListener.IsBridgeListenerJVMBridgeBase<JVMBridgeListener>.IsAssignableFrom(IJavaType)JVMBridgeBase<JVMBridgeListener>.IsAssignableFrom<T>()JVMBridgeBase<JVMBridgeListener>.Execute<T>(params T[])JVMBridgeBase<JVMBridgeListener>.DynBridgeClazzJVMBridgeBase<JVMBridgeListener>.BridgeClazzJVMBridgeBase.RuntimeClassNameOf<T>()JVMBridgeBase.ClassNameOf<T>()JVMBridgeBase.ClassOf<T>()JVMBridgeBase.WrapsDirect<TNewClass>(IJavaObject)JVMBridgeBase.Wraps<TNewClass>(IJavaObject)JVMBridgeBase.Wraps<TNewClass, TReturn>(IJavaObject)JVMBridgeBase.Wraps<TNewClass, TReturn, TConverter>(IJavaObject)JVMBridgeBase.MonitorEnter()JVMBridgeBase.MonitorExit()JVMBridgeBase.IsInstanceOf(IJavaType)JVMBridgeBase.IsInstanceOf<T>()JVMBridgeBase.RuntimeIsInstanceOf<T>()JVMBridgeBase.CastTo<TNewClass>()JVMBridgeBase.CastDirect<TNewClass>()JVMBridgeBase.ToString()JVMBridgeBase.GetHashCode()JVMBridgeBase.Notify()JVMBridgeBase.NotifyAll()JVMBridgeBase.Wait()JVMBridgeBase.IExecuteWithSignature<TNewClass, TReturn, TConverter>(string, string, params object[])JVMBridgeBase.DynBridgeInstanceJVMBridgeBase.BridgeInstanceJVMBridgeBase.IsBridgeInterfaceJVMBridgeBase.IsBridgeAbstract
- Extension Methods
Remarks
Remember to Dispose the object otherwise there is a resource leak, the object contains a reference to the the corresponding JVM object
Constructors
Comparator()
Ctor
public Comparator()
Properties
OnCompare
public Func<T, T, int> OnCompare { get; set; }
Property Value
OnEquals
public Func<object, bool> OnEquals { get; set; }
Property Value
Methods
Compare(T, T)
public virtual int Compare(T arg0, T arg1)
Parameters
arg0
TT
arg1
TT
Returns
ComparingDouble<SuperT>(ToDoubleFunction<SuperT>)
Accepts a function that extracts a double sort key from a type T, and returns a Comparator<T> that compares by that sort key.
public static Comparator<SuperT> ComparingDouble<SuperT>(ToDoubleFunction<SuperT> keyExtractor)
Parameters
keyExtractor
ToDoubleFunction<SuperT>
Returns
- Comparator<SuperT>
Type Parameters
SuperT
ComparingInt<SuperT>(ToIntFunction<SuperT>)
Accepts a function that extracts an int sort key from a type T, and returns a Comparator<T> that compares by that sort key.
public static Comparator<SuperT> ComparingInt<SuperT>(ToIntFunction<SuperT> keyExtractor)
Parameters
keyExtractor
ToIntFunction<SuperT>
Returns
- Comparator<SuperT>
Type Parameters
SuperT
ComparingLong<SuperT>(ToLongFunction<SuperT>)
Accepts a function that extracts a long sort key from a type T, and returns a Comparator<T> that compares by that sort key.
public static Comparator<SuperT> ComparingLong<SuperT>(ToLongFunction<SuperT> keyExtractor)
Parameters
keyExtractor
ToLongFunction<SuperT>
Returns
- Comparator<SuperT>
Type Parameters
SuperT
Comparing<SuperT, SuperU>(Function<SuperT, SuperU>)
Accepts a function that extracts a Comparable sort key from a type T, and returns a Comparator<T> that compares by that sort key.
public static Comparator<SuperT> Comparing<SuperT, SuperU>(Function<SuperT, SuperU> keyExtractor)
Parameters
keyExtractor
Function<SuperT, SuperU>
Returns
- Comparator<SuperT>
Type Parameters
SuperT
SuperU
Comparing<SuperT, SuperU>(Function<SuperT, SuperU>, Comparator<SuperU>)
Accepts a function that extracts a sort key from a type T, and returns a Comparator<T> that compares by that sort key using the specified Comparator.
public static Comparator<SuperT> Comparing<SuperT, SuperU>(Function<SuperT, SuperU> keyExtractor, Comparator<SuperU> keyComparator)
Parameters
keyExtractor
Function<SuperT, SuperU>keyComparator
Comparator<SuperU>
Returns
- Comparator<SuperT>
Type Parameters
SuperT
SuperU
NullsFirst<SuperT>(Comparator<SuperT>)
Returns a null-friendly comparator that considers null to be less than non-null.
public static Comparator<SuperT> NullsFirst<SuperT>(Comparator<SuperT> comparator)
Parameters
comparator
Comparator<SuperT>
Returns
- Comparator<SuperT>
Type Parameters
SuperT
NullsLast<SuperT>(Comparator<SuperT>)
Returns a null-friendly comparator that considers null to be greater than non-null.
public static Comparator<SuperT> NullsLast<SuperT>(Comparator<SuperT> comparator)
Parameters
comparator
Comparator<SuperT>
Returns
- Comparator<SuperT>
Type Parameters
SuperT