< prev index next >
src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java
Print this page
*** 122,132 ****
*
* @since 1.3.1
*/
public abstract class DataTransferer {
/**
! * The <code>DataFlavor</code> representing a Java text encoding String
* encoded in UTF-8, where
* <pre>
* representationClass = [B
* mimeType = "application/x-java-text-encoding"
* </pre>
--- 122,132 ----
*
* @since 1.3.1
*/
public abstract class DataTransferer {
/**
! * The {@code DataFlavor} representing a Java text encoding String
* encoded in UTF-8, where
* <pre>
* representationClass = [B
* mimeType = "application/x-java-text-encoding"
* </pre>
*** 321,331 ****
* order.
*
* @param flavors the data flavors
* @param map the FlavorTable which contains mappings between
* DataFlavors and data formats
! * @throws NullPointerException if flavors or map is <code>null</code>
*/
public SortedMap<Long, DataFlavor> getFormatsForFlavors(DataFlavor[] flavors,
FlavorTable map)
{
Map<Long,DataFlavor> formatMap = new HashMap<>(flavors.length);
--- 321,331 ----
* order.
*
* @param flavors the data flavors
* @param map the FlavorTable which contains mappings between
* DataFlavors and data formats
! * @throws NullPointerException if flavors or map is {@code null}
*/
public SortedMap<Long, DataFlavor> getFormatsForFlavors(DataFlavor[] flavors,
FlavorTable map)
{
Map<Long,DataFlavor> formatMap = new HashMap<>(flavors.length);
*** 476,486 ****
* transfer subsystem.
*
* @param formats the data formats
* @param map the FlavorTable which contains mappings between
* DataFlavors and data formats
! * @throws NullPointerException if formats or map is <code>null</code>
*/
public Set<DataFlavor> getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
Set<DataFlavor> flavorSet = new HashSet<>(formats.length);
for (long format : formats) {
--- 476,486 ----
* transfer subsystem.
*
* @param formats the data formats
* @param map the FlavorTable which contains mappings between
* DataFlavors and data formats
! * @throws NullPointerException if formats or map is {@code null}
*/
public Set<DataFlavor> getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
Set<DataFlavor> flavorSet = new HashSet<>(formats.length);
for (long format : formats) {
*** 507,523 ****
* 1) a mapping from at least one of the specified formats exists in the
* specified map and
* 2) the data translation for this mapping can be performed by the data
* transfer subsystem.
* The array will be sorted according to a
! * <code>DataFlavorComparator</code> created with the specified
* map as an argument.
*
* @param formats the data formats
* @param map the FlavorTable which contains mappings between
* DataFlavors and data formats
! * @throws NullPointerException if formats or map is <code>null</code>
*/
public DataFlavor[] getFlavorsForFormatsAsArray(long[] formats,
FlavorTable map) {
// getFlavorsForFormatsAsSet() is less expensive than
// getFlavorsForFormats().
--- 507,523 ----
* 1) a mapping from at least one of the specified formats exists in the
* specified map and
* 2) the data translation for this mapping can be performed by the data
* transfer subsystem.
* The array will be sorted according to a
! * {@code DataFlavorComparator} created with the specified
* map as an argument.
*
* @param formats the data formats
* @param map the FlavorTable which contains mappings between
* DataFlavors and data formats
! * @throws NullPointerException if formats or map is {@code null}
*/
public DataFlavor[] getFlavorsForFormatsAsArray(long[] formats,
FlavorTable map) {
// getFlavorsForFormatsAsSet() is less expensive than
// getFlavorsForFormats().
*** 1803,1827 ****
throw ioe;
}
/**
* Concatenates the data represented by two objects. Objects can be either
! * byte arrays or instances of <code>InputStream</code>. If both arguments
* are byte arrays byte array will be returned. Otherwise an
! * <code>InputStream</code> will be returned.
* <p>
* Currently is only called from native code to prepend palette data to
* platform-specific image data during image transfer on Win32.
*
* @param obj1 the first object to be concatenated.
* @param obj2 the second object to be concatenated.
! * @return a byte array or an <code>InputStream</code> which represents
* a logical concatenation of the two arguments.
* @throws NullPointerException is either of the arguments is
! * <code>null</code>
* @throws ClassCastException is either of the arguments is
! * neither byte array nor an instance of <code>InputStream</code>.
*/
private Object concatData(Object obj1, Object obj2) {
InputStream str1 = null;
InputStream str2 = null;
--- 1803,1827 ----
throw ioe;
}
/**
* Concatenates the data represented by two objects. Objects can be either
! * byte arrays or instances of {@code InputStream}. If both arguments
* are byte arrays byte array will be returned. Otherwise an
! * {@code InputStream} will be returned.
* <p>
* Currently is only called from native code to prepend palette data to
* platform-specific image data during image transfer on Win32.
*
* @param obj1 the first object to be concatenated.
* @param obj2 the second object to be concatenated.
! * @return a byte array or an {@code InputStream} which represents
* a logical concatenation of the two arguments.
* @throws NullPointerException is either of the arguments is
! * {@code null}
* @throws ClassCastException is either of the arguments is
! * neither byte array nor an instance of {@code InputStream}.
*/
private Object concatData(Object obj1, Object obj2) {
InputStream str1 = null;
InputStream str2 = null;
*** 1960,1970 ****
return retval;
}
/**
* Helper function to convert a Set of DataFlavors to a sorted array.
! * The array will be sorted according to <code>DataFlavorComparator</code>.
*/
public static DataFlavor[] setToSortedDataFlavorArray(Set<DataFlavor> flavorsSet) {
DataFlavor[] flavors = new DataFlavor[flavorsSet.size()];
flavorsSet.toArray(flavors);
final Comparator<DataFlavor> comparator = DataFlavorUtil.getDataFlavorComparator().reversed();
--- 1960,1970 ----
return retval;
}
/**
* Helper function to convert a Set of DataFlavors to a sorted array.
! * The array will be sorted according to {@code DataFlavorComparator}.
*/
public static DataFlavor[] setToSortedDataFlavorArray(Set<DataFlavor> flavorsSet) {
DataFlavor[] flavors = new DataFlavor[flavorsSet.size()];
flavorsSet.toArray(flavors);
final Comparator<DataFlavor> comparator = DataFlavorUtil.getDataFlavorComparator().reversed();
*** 1991,2010 ****
}
/**
* Returns platform-specific mappings for the specified native.
* If there are no platform-specific mappings for this native, the method
! * returns an empty <code>List</code>.
*/
public LinkedHashSet<DataFlavor> getPlatformMappingsForNative(String nat) {
return new LinkedHashSet<>();
}
/**
* Returns platform-specific mappings for the specified flavor.
* If there are no platform-specific mappings for this flavor, the method
! * returns an empty <code>List</code>.
*/
public LinkedHashSet<String> getPlatformMappingsForFlavor(DataFlavor df) {
return new LinkedHashSet<>();
}
}
--- 1991,2010 ----
}
/**
* Returns platform-specific mappings for the specified native.
* If there are no platform-specific mappings for this native, the method
! * returns an empty {@code List}.
*/
public LinkedHashSet<DataFlavor> getPlatformMappingsForNative(String nat) {
return new LinkedHashSet<>();
}
/**
* Returns platform-specific mappings for the specified flavor.
* If there are no platform-specific mappings for this flavor, the method
! * returns an empty {@code List}.
*/
public LinkedHashSet<String> getPlatformMappingsForFlavor(DataFlavor df) {
return new LinkedHashSet<>();
}
}
< prev index next >