1 /*
   2  * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.awt.datatransfer;
  27 
  28 import java.util.List;
  29 
  30 
  31 /**
  32  * A FlavorMap which relaxes the traditional 1-to-1 restriction of a Map. A
  33  * flavor is permitted to map to any number of natives, and likewise a native
  34  * is permitted to map to any number of flavors. FlavorTables need not be
  35  * symmetric, but typically are.
  36  *
  37  * @author David Mendenhall
  38  *
  39  * @since 1.4
  40  */
  41 public interface FlavorTable extends FlavorMap {
  42 
  43     /**
  44      * Returns a <code>List</code> of <code>String</code> natives to which the
  45      * specified <code>DataFlavor</code> corresponds. The <code>List</code>
  46      * will be sorted from best native to worst. That is, the first native will
  47      * best reflect data in the specified flavor to the underlying native
  48      * platform. The returned <code>List</code> is a modifiable copy of this
  49      * <code>FlavorTable</code>'s internal data. Client code is free to modify
  50      * the <code>List</code> without affecting this object.
  51      *
  52      * @param flav the <code>DataFlavor</code> whose corresponding natives
  53      *        should be returned. If <code>null</code> is specified, all
  54      *        natives currently known to this <code>FlavorTable</code> are
  55      *        returned in a non-deterministic order.
  56      * @return a <code>java.util.List</code> of <code>java.lang.String</code>
  57      *         objects which are platform-specific representations of platform-
  58      *         specific data formats
  59      */
  60     List<String> getNativesForFlavor(DataFlavor flav);
  61 
  62     /**
  63      * Returns a <code>List</code> of <code>DataFlavor</code>s to which the
  64      * specified <code>String</code> corresponds. The <code>List</code> will be
  65      * sorted from best <code>DataFlavor</code> to worst. That is, the first
  66      * <code>DataFlavor</code> will best reflect data in the specified
  67      * native to a Java application. The returned <code>List</code> is a
  68      * modifiable copy of this <code>FlavorTable</code>'s internal data.
  69      * Client code is free to modify the <code>List</code> without affecting
  70      * this object.
  71      *
  72      * @param nat the native whose corresponding <code>DataFlavor</code>s
  73      *        should be returned. If <code>null</code> is specified, all
  74      *        <code>DataFlavor</code>s currently known to this
  75      *        <code>FlavorTable</code> are returned in a non-deterministic
  76      *        order.
  77      * @return a <code>java.util.List</code> of <code>DataFlavor</code>
  78      *         objects into which platform-specific data in the specified,
  79      *         platform-specific native can be translated
  80      */
  81     List<DataFlavor> getFlavorsForNative(String nat);
  82 }