1 /* 2 * @(#)FlavorTable.java 1.5 04/05/05 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package java.awt.datatransfer; 9 10 import java.util.List; 11 12 13 /** 14 * A FlavorMap which relaxes the traditional 1-to-1 restriction of a Map. A 15 * flavor is permitted to map to any number of natives, and likewise a native 16 * is permitted to map to any number of flavors. FlavorTables need not be 17 * symmetric, but typically are. 18 * 19 * @author David Mendenhall 20 * @version 1.5, 05/05/04 21 * 22 * @since 1.4 23 */ 24 public interface FlavorTable extends FlavorMap { 25 26 /** 27 * Returns a <code>List</code> of <code>String</code> natives to which the 28 * specified <code>DataFlavor</code> corresponds. The <code>List</code> 29 * will be sorted from best native to worst. That is, the first native will 30 * best reflect data in the specified flavor to the underlying native 31 * platform. The returned <code>List</code> is a modifiable copy of this 32 * <code>FlavorTable</code>'s internal data. Client code is free to modify 33 * the <code>List</code> without affecting this object. 34 * 35 * @param flav the <code>DataFlavor</code> whose corresponding natives 36 * should be returned. If <code>null</code> is specified, all 37 * natives currently known to this <code>FlavorTable</code> are 38 * returned in a non-deterministic order. 39 * @return a <code>java.util.List</code> of <code>java.lang.String</code> 40 * objects which are platform-specific representations of platform- 41 * specific data formats 42 */ 43 List<String> getNativesForFlavor(DataFlavor flav); 44 45 /** 46 * Returns a <code>List</code> of <code>DataFlavor</code>s to which the 47 * specified <code>String</code> corresponds. The <code>List</code> will be 48 * sorted from best <code>DataFlavor</code> to worst. That is, the first 49 * <code>DataFlavor</code> will best reflect data in the specified 50 * native to a Java application. The returned <code>List</code> is a 51 * modifiable copy of this <code>FlavorTable</code>'s internal data. 52 * Client code is free to modify the <code>List</code> without affecting 53 * this object. 54 * 55 * @param nat the native whose corresponding <code>DataFlavor</code>s 56 * should be returned. If <code>null</code> is specified, all 57 * <code>DataFlavor</code>s currently known to this 58 * <code>FlavorTable</code> are returned in a non-deterministic 59 * order. 60 * @return a <code>java.util.List</code> of <code>DataFlavor</code> 61 * objects into which platform-specific data in the specified, 62 * platform-specific native can be translated 63 */ 64 List<DataFlavor> getFlavorsForNative(String nat); 65 } 66