// Path: src/main/java/com/github/haixing_hu/javafx/util/StringConverterComparator.java
// public final class StringConverterComparator<T> implements Comparator<T> {
// 
//   private final StringConverter<T> converter;
// 
//   /**
//    * Constructs a {@link StringConverterComparator} with a specified string
//    * converter.
//    *
//    * @param converter
//    *          a specified string converter.
//    */
//   public StringConverterComparator(StringConverter<T> converter) {
//     this.converter = requireNonNull("converter", converter);
//   }
// 
//   @Override
//   public int compare(T o1, T o2) {
//     final String o1str = converter.toString(o1);
//     final String o2str = converter.toString(o2);
//     return o1str.compareTo(o2str);
//   }
// 
// }
// 
// Path: src/main/java/com/github/haixing_hu/javafx/util/ToStringComparator.java
// public final class ToStringComparator<T> implements Comparator<T> {
// 
//   @Override
//   public int compare(T o1, T o2) {
//     final String o1str = o1.toString();
//     final String o2str = o2.toString();
//     return o1str.compareTo(o2str);
//   }
// }
// 
// Path: src/main/java/com/github/haixing_hu/javafx/util/ToStringConverter.java
// public final class ToStringConverter<T> extends StringConverter<T> {
// 
//   @Override
//   public String toString(T object) {
//     return (object == null ? "" : object.toString());
//   }
// 
//   @Override
//   public T fromString(String string) {
//     throw new UnsupportedOperationException();
//   }
// 
// }


import java.util.Comparator;
import javafx.util.StringConverter;
import com.github.haixing_hu.javafx.util.StringConverterComparator;
import com.github.haixing_hu.javafx.util.ToStringComparator;
import com.github.haixing_hu.javafx.util.ToStringConverter;
import static com.github.haixing_hu.lang.Argument.requireNonNull;
package com.github.haixing_hu.javafx.control.textfield;





/**
 * This is a simple string based suggestion provider. All generic suggestions T
 * are turned into strings for processing.
 *
 * @param <T>
 *          the type of suggestions.
 */
public class DefaultSuggestionProvider<T> extends AbstractSuggestionProvider<T> {

  private final StringConverter<T> converter;
  private final Comparator<T> comparator;

  /**
   * Create a new {@link DefaultSuggestionProvider}, using the default
   * {@link ToStringConverter} and {@link ToStringComparator}.
   */
  public DefaultSuggestionProvider() {
    converter = new ToStringConverter<T>();
// Path: src/main/java/com/github/haixing_hu/javafx/util/StringConverterComparator.java
// public final class StringConverterComparator<T> implements Comparator<T> {
// 
//   private final StringConverter<T> converter;
// 
//   /**
//    * Constructs a {@link StringConverterComparator} with a specified string
//    * converter.
//    *
//    * @param converter
//    *          a specified string converter.
//    */
//   public StringConverterComparator(StringConverter<T> converter) {
//     this.converter = requireNonNull("converter", converter);
//   }
// 
//   @Override
//   public int compare(T o1, T o2) {
//     final String o1str = converter.toString(o1);
//     final String o2str = converter.toString(o2);
//     return o1str.compareTo(o2str);
//   }
// 
// }
// 
// Path: src/main/java/com/github/haixing_hu/javafx/util/ToStringComparator.java
// public final class ToStringComparator<T> implements Comparator<T> {
// 
//   @Override
//   public int compare(T o1, T o2) {
//     final String o1str = o1.toString();
//     final String o2str = o2.toString();
//     return o1str.compareTo(o2str);
//   }
// }
// 
// Path: src/main/java/com/github/haixing_hu/javafx/util/ToStringConverter.java
// public final class ToStringConverter<T> extends StringConverter<T> {
// 
//   @Override
//   public String toString(T object) {
//     return (object == null ? "" : object.toString());
//   }
// 
//   @Override
//   public T fromString(String string) {
//     throw new UnsupportedOperationException();
//   }
// 
// }


// Path: src/main/java/com/github/haixing_hu/javafx/control/textfield/DefaultSuggestionProvider.java
import java.util.Comparator;
import javafx.util.StringConverter;
import com.github.haixing_hu.javafx.util.StringConverterComparator;
import com.github.haixing_hu.javafx.util.ToStringComparator;
import com.github.haixing_hu.javafx.util.ToStringConverter;
import static com.github.haixing_hu.lang.Argument.requireNonNull;

package com.github.haixing_hu.javafx.control.textfield;





/**
 * This is a simple string based suggestion provider. All generic suggestions T
 * are turned into strings for processing.
 *
 * @param <T>
 *          the type of suggestions.
 */
public class DefaultSuggestionProvider<T> extends AbstractSuggestionProvider<T> {

  private final StringConverter<T> converter;
  private final Comparator<T> comparator;

  /**
   * Create a new {@link DefaultSuggestionProvider}, using the default
   * {@link ToStringConverter} and {@link ToStringComparator}.
   */
  public DefaultSuggestionProvider() {
    converter = new ToStringConverter<T>();
    comparator = new ToStringComparator<T>();