Path: blob/master/src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorMap.java
41159 views
/*1* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.awt.datatransfer;2627import java.util.Map;2829/**30* A two-way Map between "natives" (Strings), which correspond to31* platform-specific data formats, and "flavors" (DataFlavors), which correspond32* to platform-independent MIME types. FlavorMaps need not be symmetric, but33* typically are.34*35* @since 1.236*/37public interface FlavorMap {3839/**40* Returns a {@code Map} of the specified {@code DataFlavor}s to their41* corresponding {@code String} native. The returned {@code Map} is a42* modifiable copy of this {@code FlavorMap}'s internal data. Client code is43* free to modify the {@code Map} without affecting this object.44*45* @param flavors an array of {@code DataFlavor}s which will be the key set46* of the returned {@code Map}. If {@code null} is specified, a47* mapping of all {@code DataFlavor}s currently known to this48* {@code FlavorMap} to their corresponding {@code String} natives49* will be returned.50* @return a {@code java.util.Map} of {@code DataFlavor}s to {@code String}51* natives52*/53Map<DataFlavor, String> getNativesForFlavors(DataFlavor[] flavors);5455/**56* Returns a {@code Map} of the specified {@code String} natives to their57* corresponding {@code DataFlavor}. The returned {@code Map} is a58* modifiable copy of this {@code FlavorMap}'s internal data. Client code is59* free to modify the {@code Map} without affecting this object.60*61* @param natives an array of {@code String}s which will be the key set of62* the returned {@code Map}. If {@code null} is specified, a mapping63* of all {@code String} natives currently known to this64* {@code FlavorMap} to their corresponding {@code DataFlavor}s will65* be returned.66* @return a {@code java.util.Map} of {@code String} natives to67* {@code DataFlavor}s68*/69Map<String, DataFlavor> getFlavorsForNatives(String[] natives);70}717273