1 |
/* Transferable.java -- Data transfer source |
/* Transferable.java -- Data transfer source |
2 |
Copyright (C) 1999 Free Software Foundation, Inc. |
Copyright (C) 1999, 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
41 |
import java.io.IOException; |
import java.io.IOException; |
42 |
|
|
43 |
/** |
/** |
44 |
* This interface is implemented by classes that can transfer data. |
* This interface is implemented by classes that can transfer data. |
45 |
* |
* |
46 |
* @author Aaron M. Renn (arenn@urbanophile.com) |
* @author Aaron M. Renn <arenn@urbanophile.com> |
47 |
*/ |
* @since 1.1 |
48 |
|
* @status updated to 1.4 |
49 |
|
*/ |
50 |
public interface Transferable |
public interface Transferable |
51 |
{ |
{ |
52 |
|
/** |
53 |
/** |
* This method returns a list of available data flavors for the data being |
54 |
* Returns the data in the specified <code>DataFlavor</code> |
* transferred. The array returned will be sorted from most preferred |
55 |
* |
* flavor at the beginning to least preferred at the end. |
56 |
* @param flavor The data flavor to return. |
* |
57 |
* |
* @return adA list of data flavors for this data |
58 |
* @return The data in the appropriate flavor. |
*/ |
59 |
* |
public abstract DataFlavor[] getTransferDataFlavors(); |
60 |
* @exception UnsupportedFlavorException If the flavor is not supported. |
|
61 |
* @exception IOException If the data is not available. |
/** |
62 |
*/ |
* Tests whether or not this data can be delivered in the specified data |
63 |
public abstract Object |
* flavor. |
64 |
getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, |
* |
65 |
IOException; |
* @param flavor the data flavor to test |
66 |
|
* @return true if the data flavor is supported |
67 |
/*************************************************************************/ |
*/ |
68 |
|
public abstract boolean isDataFlavorSupported(DataFlavor flavor); |
69 |
/** |
|
70 |
* This method returns a list of available data flavors for the |
/** |
71 |
* data being transferred. The array returned will be sorted from most |
* Returns the data in the specified <code>DataFlavor</code>. |
72 |
* preferred flavor at the beginning to least preferred at the end. |
* |
73 |
* |
* @param flavor the data flavor to return |
74 |
* @return A list of data flavors for this data. |
* @return the data in the appropriate flavor |
75 |
*/ |
* @throws UnsupportedFlavorException if the flavor is not supported |
76 |
public abstract DataFlavor[] |
* @throws IOException if the data is not available |
77 |
getTransferDataFlavors(); |
* @see DataFlavor#getRepresentationClass |
78 |
|
*/ |
79 |
/*************************************************************************/ |
public abstract Object getTransferData(DataFlavor flavor) |
80 |
|
throws UnsupportedFlavorException, IOException; |
|
/** |
|
|
* Tests whether or not this data can be delivered in the specified |
|
|
* data flavor. |
|
|
* |
|
|
* @param flavor The data flavor to test. |
|
|
* |
|
|
* @return <code>true</code> if the data flavor is supported, |
|
|
* <code>false</code> otherwise. |
|
|
*/ |
|
|
public abstract boolean |
|
|
isDataFlavorSupported(DataFlavor flavor); |
|
|
|
|
81 |
} // interface Transferable |
} // interface Transferable |
|
|
|