在Java中反转HashMap键和值(Reverse HashMap keys and values in Java)
这是一个简单的问题,我有一个简单的HashMap,我想要反转键和值。
HashMap<Character, String> myHashMap = new HashMap<Character, String>(); myHashMap.put('a', "test one"); myHashMap.put('b', "test two");
我想创建一个新的HashMap,我把它放在对立面。
HashMap<String, Character> reversedHashMap = new HashMap<String, Character>(); e.g. Keys "test one" & "test two" and values 'a' & 'b'.
It's a simple question, I have a simple HashMap of which i want to reverse the keys and values.
HashMap<Character, String> myHashMap = new HashMap<Character, String>(); myHashMap.put('a', "test one"); myHashMap.put('b', "test two");
and I want to create a new HashMap in which i put the opposites.
HashMap<String, Character> reversedHashMap = new HashMap<String, Character>(); e.g. Keys "test one" & "test two" and values 'a' & 'b'.
原文:https://stackoverflow.com/questions/20412354
更新时间:2023-10-09 08:10
最满意答案
在Visual Studio中,右键单击该文件并转到属性 。
在该文件的属性下,确保将生成操作设置为内容 。 否则它不会通过web部署发布。
In Visual Studio, right-click on the file and go to Properties.
Under the file's properties, make sure that Build Action is set to Content. Otherwise it won't be published via web deploy.
相关问答
更多-
在Visual Studio中,右键单击该文件并转到属性 。 在该文件的属性下,确保将生成操作设置为内容 。 否则它不会通过web部署发布。 In Visual Studio, right-click on the file and go to Properties. Under the file's properties, make sure that Build Action is set to Content. Otherwise it won't be published via web deplo ...
-
ASP.NET Web服务应用程序项目模板不适用于.Net Framework 4.0,但可用于.Net Framework 3.5。 如果您在.net framework 4.0上构建应用程序,则可以在传统中将WCF Service Application用作ASMX。 请注意,您需要启用AspNetCompatibilityMode才能访问HttpContext对象。 如果您仍想使用ASMX,请选择“ASP.NET空白Web应用程序”,然后将ASMX文件添加到项目中。 ASP.NET Web Servi ...
-
有大量文档可供使用。 例如,一种方法是使用Azure管理门户UI: Example: 1. Go to the management portal for Windows Azure (WindowsAzure.com). 2. Create a new web site (see below). 3. Click on the web site to manage and configure it. 4. The manage and configure (dashboard) page is a ...
-
的MSBuild 但是,如果你想要一个快速和肮脏的解决方案(并且因为你没有提到TFS或持续集成,我假设你这样做),然后写一个robocopy脚本只复制更新的文件。 但话又说回来; 使用Robocopy部署站点 MSBuild But if you fancy a quick & dirty solution (and since you haven't mentioned TFS or continuous integration, i assume you do), then write a roboco ...
-
Visual Studio 2010发布Web功能不包括所有DLL(Visual Studio 2010 Publish Web feature not including all DLLs)[2023-06-28]
在我心中,这些答案都没有。 这似乎是一个真正的错误。 如果我找到一个非黑客解决方案,或者Microsoft修复该错误,我将更新此响应。 更新: 似乎没有希望。 https://connect.microsoft.com/VisualStudio/feedback/details/731303/publish-web-feature-not-including-all-dlls None of these answers are sufficient in my mind. This does seem to ... -
如果你指的是如何在vs2010中添加旧的asmx样式引用右键单击引用并选择“添加服务引用”,然后单击“高级”,然后单击“添加Web引用” 对于一个wcf服务,只需右键单击并说“添加引用” 使用它 - 输入您班级的名字。 由于我不知道你的名字空间,你可能必须在顶部包含一个导入。 但基本上 - ServiceReference1.WhateverClient cleint = new ServiceReference1.WhateverClient(); 在代码中执行ServiceReference1时,应该会 ...
-
不,发布过程发布整个网站。 首先在本地计算机上发布它,然后使用FTP工具(Filezilla,CoreFTP ...)有选择地将文件上传到服务器。 No, the publish process publishes the whole website. Publish it on your local computer first and then use an FTP tool (Filezilla, CoreFTP...) to selectively upload your files to the ...
-
使用visual studio 2010消费sharepoint 2010 Web服务(consuming sharepoint 2010 web service with visual studio 2010)[2022-05-04]
试试这个代码:请尝试以下功能。 您需要传递FileURL(文档的完整网址),标题(您希望为下载的文件提供通行证名称。) (注意:此功能需要传递凭据以及要下载的文档的完整URL。我认为这对您来说已经足够了) public string DownLoadfiletolocal(string FileURL, string Title) { //Copy.Copy is a webservice object that I consumed. Copy.Copy CopyObj = new Copy.Copy ... -
无法使Visual Studio的“发布Web应用程序”工作(Can't get Visual Studio's “Publish Web Application” to work)[2024-03-25]
因此,答案是“添加>现有项目”到项目中,以在项目中包含我的脚本的缩小版本。 至于另一个问题:“我的问题是我不想在解决方案资源管理器中看到我的Release版本的.min.js文件......我是否只需要处理它或者是否有我遗漏的东西?” 我将选择“我只需处理它”作为答案。 So, the answer was to "Add > Existing Item" to the project to include the minified versions of my scripts in the project ... -
要首先回答特定问题,您可以通过创建相同类型的新项目(例如ASP.NET MVC3),然后构建该新项目,轻松地重新生成此文件。 EntityFramework.xml将出现在新项目的bin文件夹中。 您可以将其复制到您现有的项目中。 但是,只需从项目中排除缺少的文件(通过在解决方案资源管理器中右键单击),因为不需要构建,那么您将实现通过VS2010发布项目的目标。 To answer the specific question first, you can easily regenerate this fil ...