Module org.tquadrat.foundation.util
Class ListBasedComparator.SimpleKeyProvider<T,K extends T>
java.lang.Object
org.tquadrat.foundation.util.internal.ListBasedComparator.SimpleKeyProvider<T,K>
- Type Parameters:
T- The type to order.K- The key type that is used to determine the order; this may be the same as the type itself. At least, an instance of typeTmust be assignable toK.
- All Implemented Interfaces:
Comparators.KeyProvider<T,K>
- Enclosing class:
ListBasedComparator<T,K>
@ClassVersion(sourceVersion="$Id: ListBasedComparator.java 1032 2022-04-10 17:27:44Z tquadrat $")
public static class ListBasedComparator.SimpleKeyProvider<T,K extends T>
extends Object
implements Comparators.KeyProvider<T,K>
A simple implementation of
Comparators.KeyProvider
that returns the instance itself as the sort order key.- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: ListBasedComparator.java 1032 2022-04-10 17:27:44Z tquadrat $
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.util.internal.ListBasedComparator.SimpleKeyProvider"
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SimpleKeyProvider
public SimpleKeyProvider()Creates a new instance ofSimpleKeyProvider.
-
-
Method Details
-
getKey
Returns the sort order key for the given instance.- Specified by:
getKeyin interfaceComparators.KeyProvider<T,K extends T> - Parameters:
instance- The instance; may benull.- Returns:
- The instance itself as the sort order key;
nullif the instance isnullitself.
-
