java.awt.datatransfer
Interface Transferable

All Known Implementing Classes:
DropTargetContext.TransferableProxy, StringSelection

public interface Transferable

This interface is implemented by classes that can transfer data.

Since:
1.1

Method Summary
 Object getTransferData(DataFlavor flavor)
          Returns the data in the specified DataFlavor.
 DataFlavor[] getTransferDataFlavors()
          This method returns a list of available data flavors for the data being transferred.
 boolean isDataFlavorSupported(DataFlavor flavor)
          Tests whether or not this data can be delivered in the specified data flavor.
 

Method Detail

getTransferDataFlavors

DataFlavor[] getTransferDataFlavors()
This method returns a list of available data flavors for the data being transferred. The array returned will be sorted from most preferred flavor at the beginning to least preferred at the end.

Returns:
adA list of data flavors for this data

isDataFlavorSupported

boolean isDataFlavorSupported(DataFlavor flavor)
Tests whether or not this data can be delivered in the specified data flavor.

Parameters:
flavor - the data flavor to test
Returns:
true if the data flavor is supported

getTransferData

Object getTransferData(DataFlavor flavor)
                       throws UnsupportedFlavorException,
                              IOException
Returns the data in the specified DataFlavor.

Parameters:
flavor - the data flavor to return
Returns:
the data in the appropriate flavor
Throws:
UnsupportedFlavorException - if the flavor is not supported
IOException - if the data is not available
See Also:
DataFlavor.getRepresentationClass()