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 SummaryFieldsModifier and TypeFieldDescriptionprivate final StringConverter<T> The instance ofStringConverterthat is used to translate the object instances to Strings.
- 
Constructor SummaryConstructorsConstructorDescriptionStringBasedComparator(StringConverter<T> stringConverter) Creates a new instance ofStringBasedComparator.
- 
Method SummaryMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparatorequals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
- 
Field Details- 
m_StringConverterThe instance ofStringConverterthat is used to translate the object instances to Strings.
 
- 
- 
Constructor Details- 
StringBasedComparatorCreates a new instance ofStringBasedComparator.- Parameters:
- stringConverter- The instance of- StringConverterthat is used to translate the object instances to Strings.
 
 
- 
- 
Method Details- 
compare- Specified by:
- comparein interface- Comparator<T>
 
 
- 
