1. /*
  2. * @(#)FlavorMap.java 1.17 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt.datatransfer;
  8. import java.util.Map;
  9. /**
  10. * A two-way Map between "natives" (Strings), which correspond to platform-
  11. * specfic data formats, and "flavors" (DataFlavors), which corerspond to
  12. * platform-independent MIME types. FlavorMaps need not be symmetric, but
  13. * typically are.
  14. *
  15. * @version 1.17, 01/23/03
  16. *
  17. * @since 1.2
  18. */
  19. public interface FlavorMap {
  20. /**
  21. * Returns a <code>Map</code> of the specified <code>DataFlavor</code>s to
  22. * their corresponding <code>String</code> native. The returned
  23. * <code>Map</code> is a modifiable copy of this <code>FlavorMap</code>'s
  24. * internal data. Client code is free to modify the <code>Map</code>
  25. * without affecting this object.
  26. *
  27. * @param flavors an array of <code>DataFlavor</code>s which will be the
  28. * key set of the returned <code>Map</code>. If <code>null</code> is
  29. * specified, a mapping of all <code>DataFlavor</code>s currently
  30. * known to this <code>FlavorMap</code> to their corresponding
  31. * <code>String</code> natives will be returned.
  32. * @return a <code>java.util.Map</code> of <code>DataFlavor</code>s to
  33. * <code>String</code> natives
  34. */
  35. Map getNativesForFlavors(DataFlavor[] flavors);
  36. /**
  37. * Returns a <code>Map</code> of the specified <code>String</code> natives
  38. * to their corresponding <code>DataFlavor</code>. The returned
  39. * <code>Map</code> is a modifiable copy of this <code>FlavorMap</code>'s
  40. * internal data. Client code is free to modify the <code>Map</code>
  41. * without affecting this object.
  42. *
  43. * @param natives an array of <code>String</code>s which will be the
  44. * key set of the returned <code>Map</code>. If <code>null</code> is
  45. * specified, a mapping of all <code>String</code> natives currently
  46. * known to this <code>FlavorMap</code> to their corresponding
  47. * <code>DataFlavor</code>s will be returned.
  48. * @return a <code>java.util.Map</code> of <code>String</code> natives to
  49. * <code>DataFlavor</code>s
  50. */
  51. Map getFlavorsForNatives(String[] natives);
  52. }