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