< prev index next >

jdk/src/java.datatransfer/share/classes/sun/datatransfer/DataFlavorUtil.java

Print this page




  38 import java.nio.charset.Charset;
  39 import java.nio.charset.IllegalCharsetNameException;
  40 import java.nio.charset.StandardCharsets;
  41 import java.nio.charset.UnsupportedCharsetException;
  42 import java.util.Collections;
  43 import java.util.Comparator;
  44 import java.util.HashMap;
  45 import java.util.Iterator;
  46 import java.util.LinkedHashSet;
  47 import java.util.Map;
  48 import java.util.ServiceLoader;
  49 import java.util.Set;
  50 import java.util.SortedSet;
  51 import java.util.TreeSet;
  52 import java.util.function.Supplier;
  53 
  54 
  55 /**
  56  * Utility class with different datatransfer helper functions
  57  *
  58  * @since 1.9
  59  */
  60 public class DataFlavorUtil {
  61 
  62     private DataFlavorUtil() {
  63         // Avoid instantiation
  64     }
  65 
  66     private static Comparator<String> getCharsetComparator() {
  67        return CharsetComparator.INSTANCE;
  68     }
  69 
  70     public static Comparator<DataFlavor> getDataFlavorComparator() {
  71        return DataFlavorComparator.INSTANCE;
  72     }
  73 
  74     public static Comparator<Long> getIndexOrderComparator(Map<Long, Integer> indexMap) {
  75         return new IndexOrderComparator(indexMap);
  76     }
  77 
  78     public static Comparator<DataFlavor> getTextFlavorComparator() {




  38 import java.nio.charset.Charset;
  39 import java.nio.charset.IllegalCharsetNameException;
  40 import java.nio.charset.StandardCharsets;
  41 import java.nio.charset.UnsupportedCharsetException;
  42 import java.util.Collections;
  43 import java.util.Comparator;
  44 import java.util.HashMap;
  45 import java.util.Iterator;
  46 import java.util.LinkedHashSet;
  47 import java.util.Map;
  48 import java.util.ServiceLoader;
  49 import java.util.Set;
  50 import java.util.SortedSet;
  51 import java.util.TreeSet;
  52 import java.util.function.Supplier;
  53 
  54 
  55 /**
  56  * Utility class with different datatransfer helper functions
  57  *
  58  * @since 9
  59  */
  60 public class DataFlavorUtil {
  61 
  62     private DataFlavorUtil() {
  63         // Avoid instantiation
  64     }
  65 
  66     private static Comparator<String> getCharsetComparator() {
  67        return CharsetComparator.INSTANCE;
  68     }
  69 
  70     public static Comparator<DataFlavor> getDataFlavorComparator() {
  71        return DataFlavorComparator.INSTANCE;
  72     }
  73 
  74     public static Comparator<Long> getIndexOrderComparator(Map<Long, Integer> indexMap) {
  75         return new IndexOrderComparator(indexMap);
  76     }
  77 
  78     public static Comparator<DataFlavor> getTextFlavorComparator() {


< prev index next >