1 /* 2 * @(#)FlavorMap.java 1.19 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.Map; 11 12 13 /** 14 * A two-way Map between "natives" (Strings), which correspond to platform- 15 * specfic data formats, and "flavors" (DataFlavors), which corerspond to 16 * platform-independent MIME types. FlavorMaps need not be symmetric, but 17 * typically are. 18 * 19 * @version 1.19, 05/05/04 20 * 21 * @since 1.2 22 */ 23 public interface FlavorMap { 24 25 /** 26 * Returns a <code>Map</code> of the specified <code>DataFlavor</code>s to 27 * their corresponding <code>String</code> native. The returned 28 * <code>Map</code> is a modifiable copy of this <code>FlavorMap</code>'s 29 * internal data. Client code is free to modify the <code>Map</code> 30 * without affecting this object. 31 * 32 * @param flavors an array of <code>DataFlavor</code>s which will be the 33 * key set of the returned <code>Map</code>. If <code>null</code> is 34 * specified, a mapping of all <code>DataFlavor</code>s currently 35 * known to this <code>FlavorMap</code> to their corresponding 36 * <code>String</code> natives will be returned. 37 * @return a <code>java.util.Map</code> of <code>DataFlavor</code>s to 38 * <code>String</code> natives 39 */ 40 Map<DataFlavor,String> getNativesForFlavors(DataFlavor[] flavors); 41 42 /** 43 * Returns a <code>Map</code> of the specified <code>String</code> natives 44 * to their corresponding <code>DataFlavor</code>. The returned 45 * <code>Map</code> is a modifiable copy of this <code>FlavorMap</code>'s 46 * internal data. Client code is free to modify the <code>Map</code> 47 * without affecting this object. 48 * 49 * @param natives an array of <code>String</code>s which will be the 50 * key set of the returned <code>Map</code>. If <code>null</code> is 51 * specified, a mapping of all <code>String</code> natives currently 52 * known to this <code>FlavorMap</code> to their corresponding 53 * <code>DataFlavor</code>s will be returned. 54 * @return a <code>java.util.Map</code> of <code>String</code> natives to 55 * <code>DataFlavor</code>s 56 */ 57 Map<String,DataFlavor> getFlavorsForNatives(String[] natives); 58 } 59