java.awt.datatransfer
Class DataFlavor.TextFlavorComparator

java.lang.Object
  extended bysun.awt.datatransfer.DataTransferer.IndexedComparator
      extended bysun.awt.datatransfer.DataTransferer.DataFlavorComparator
          extended byjava.awt.datatransfer.DataFlavor.TextFlavorComparator
All Implemented Interfaces:
Comparator
Enclosing class:
DataFlavor

static class DataFlavor.TextFlavorComparator
extends sun.awt.datatransfer.DataTransferer.DataFlavorComparator


Field Summary
 
Fields inherited from class sun.awt.datatransfer.DataTransferer.DataFlavorComparator
flavorToFormatMap
 
Fields inherited from class sun.awt.datatransfer.DataTransferer.IndexedComparator
order, SELECT_BEST, SELECT_WORST
 
Constructor Summary
(package private) DataFlavor.TextFlavorComparator()
           
 
Method Summary
 int compare(Object obj1, Object obj2)
          Compares two DataFlavor objects.
 
Methods inherited from class sun.awt.datatransfer.DataTransferer.DataFlavorComparator
 
Methods inherited from class sun.awt.datatransfer.DataTransferer.IndexedComparator
compareIndices, compareLongs
 
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
 

Constructor Detail

DataFlavor.TextFlavorComparator

DataFlavor.TextFlavorComparator()
Method Detail

compare

public int compare(Object obj1,
                   Object obj2)
Compares two DataFlavor objects. Returns a negative integer, zero, or a positive integer as the first DataFlavor is worse than, equal to, or better than the second.

DataFlavors are ordered according to the rules outlined for selectBestTextFlavor.

Parameters:
obj1 - the first DataFlavor to be compared
obj2 - the second DataFlavor to be compared
Returns:
a negative integer, zero, or a positive integer as the first argument is worse, equal to, or better than the second
Throws:
ClassCastException - if either of the arguments is not an instance of DataFlavor
NullPointerException - if either of the arguments is null
See Also:
DataFlavor.selectBestTextFlavor(java.awt.datatransfer.DataFlavor[])