Module org.tquadrat.foundation.util
Class StringBasedComparator<T>
java.lang.Object
org.tquadrat.foundation.util.internal.StringBasedComparator<T>
- Type Parameters:
T
- The type of the objects to compare.
- All Implemented Interfaces:
Comparator<T>
@ClassVersion(sourceVersion="$Id: StringBasedComparator.java 1060 2023-09-24 19:21:40Z tquadrat $")
@API(status=STABLE,
since="0.1.0")
public class StringBasedComparator<T>
extends Object
implements Comparator<T>
An implementation of
Comparator
that compares object instances based on their String representation.- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: StringBasedComparator.java 1060 2023-09-24 19:21:40Z tquadrat $
- Since:
- 0.1.0
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.util.internal.StringBasedComparator"
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringConverter
<T> The instance ofStringConverter
that is used to translate the object instances to Strings. -
Constructor Summary
ConstructorsConstructorDescriptionStringBasedComparator
(StringConverter<T> stringConverter) Creates a new instance ofStringBasedComparator
. -
Method Summary
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 Details
-
m_StringConverter
The instance ofStringConverter
that is used to translate the object instances to Strings.
-
-
Constructor Details
-
StringBasedComparator
Creates a new instance ofStringBasedComparator
.- Parameters:
stringConverter
- The instance ofStringConverter
that is used to translate the object instances to Strings.
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<T>
-