1 /* 2 * Copyright (c) 2000, 2017, 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 * A FlavorMap which relaxes the traditional 1-to-1 restriction of a Map. A 32 * flavor is permitted to map to any number of natives, and likewise a native is 33 * permitted to map to any number of flavors. FlavorTables need not be 34 * symmetric, but typically are. 35 * 36 * @author David Mendenhall 37 * @since 1.4 38 */ 39 public interface FlavorTable extends FlavorMap { 40 41 /** 42 * Returns a {@code List} of {@code String} natives to which the specified 43 * {@code DataFlavor} corresponds. The {@code List} will be sorted from best 44 * native to worst. That is, the first native will best reflect data in the 45 * specified flavor to the underlying native platform. The returned 46 * {@code List} is a modifiable copy of this {@code FlavorTable}'s internal 47 * data. Client code is free to modify the {@code List} without affecting 48 * this object. 49 * 50 * @param flav the {@code DataFlavor} whose corresponding natives should be 51 * returned. If {@code null} is specified, all natives currently 52 * known to this {@code FlavorTable} are returned in a 53 * non-deterministic order. 54 * @return a {@code java.util.List} of {@code java.lang.String} objects 55 * which are platform-specific representations of platform-specific 56 * data formats 57 */ 58 List<String> getNativesForFlavor(DataFlavor flav); 59 60 /** 61 * Returns a {@code List} of {@code DataFlavor}s to which the specified 62 * {@code String} corresponds. The {@code List} will be sorted from best 63 * {@code DataFlavor} to worst. That is, the first {@code DataFlavor} will 64 * best reflect data in the specified native to a Java application. The 65 * returned {@code List} is a modifiable copy of this {@code FlavorTable}'s 66 * internal data. Client code is free to modify the {@code List} without 67 * affecting this object. 68 * 69 * @param nat the native whose corresponding {@code DataFlavor}s should be 70 * returned. If {@code null} is specified, all {@code DataFlavor}s 71 * currently known to this {@code FlavorTable} are returned in a 72 * non-deterministic order. 73 * @return a {@code java.util.List} of {@code DataFlavor} objects into which 74 * platform-specific data in the specified, platform-specific native 75 * can be translated 76 */ 77 List<DataFlavor> getFlavorsForNative(String nat); 78 }