首页 \ 问答 \ 关于java concurrenthashmap替换方法的问题(Question about java concurrenthashmap replace method)

关于java concurrenthashmap替换方法的问题(Question about java concurrenthashmap replace method)

我有以下代码

public class Test{

private static final String key = "key";

public static void main(String[] a){
    ConcurrentHashMap<String,String > map = new ConcurrentHashMap<String,String>();
    System.out.println(map.replace(key,"1"));
    System.out.println(map.replace(key,"2"));
}

}

输出两次都为null。 它不应该是1秒钟吗?


I have the following code

public class Test{

private static final String key = "key";

public static void main(String[] a){
    ConcurrentHashMap<String,String > map = new ConcurrentHashMap<String,String>();
    System.out.println(map.replace(key,"1"));
    System.out.println(map.replace(key,"2"));
}

}

The output is null both times. Isn't it supposed to be 1 second time?


原文:https://stackoverflow.com/questions/4949615
更新时间:2024-01-24 18:01

最满意答案

我同意,这没有意义。 根据我对TOGAF的理解,应该“回到建筑工作要求的发起者”。

正如您自己注意到的那样,架构工作声明不是输入,而是A阶段的输出。另一方面,建筑工作请求是一个输入,应该包含业务目标。


I agree, this does not make sense. To my understanding of TOGAF, it should be "go back to the originators of the Request for Architecture Work".

As you noticed yourself, the Statement of Architecture Work is not an input, but an output of phase A. The Request for Architecture Work on the other hand is an input and should contain the business goals.

相关问答

更多
  • http:// www.2wedm.cn/thread-2498-1-1.html这是论坛网上的,你要随便注册一下就可以下载了
  • 尝试手动编辑Makefile.config并更改这些行 # CUDA architecture setting: going with all of them. # For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility. # For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility. # For CUDA >= 9.0, comment the *_ ...
  • 架构存储库包含ADM迭代执行的内容等。 外部参考体系结构,标准等更多。体系结构存储库本身不是可交付的,因为它是建立体系结构功能时的物理实现。 审查TOGAF世界中的可交付成果并签名工件和工件可以是图表,目录或矩阵。 Architecture repository holds content from the execution of ADM iterations and more. The more is external reference architectures, standards etc. Ar ...
  • 根据Togaf 9的Togaf文档: 体系结构1.系统的正式描述或组件级别的详细计划,以指导其实施(来源:ISO / IEC 42010:2007)。 2.组件的结构,它们之间的相互关系以及管理它们随着时间的推移而设计和发展的原则和指导方针。 它没有提供解决方案的正式定义。 通俗地说,建筑是一个抽象的解决方案。 它可以是一个超集或一组解决方案。 解决方案是一个更具体的问题表示,而体系结构代表更广泛的系统图景。 As Per Togaf Documentation for Togaf 9: Architect ...
  • 如果你不必使用tensorflow 1.7, 这个仓库可能有你想要的。 只是要清楚,我从来没有尝试过任何一个。 如果您需要在Windows上安装, 此存储库可能会有所帮助。 If you don't have to use tensorflow 1.7, this repository might have what you want. Just to be clear, I never tried any of them myself. If you need to install on Windows, ...
  • 我建议阅读Eric Evans的“Domain-Driven Design”和Vaughn Vernon的“实现领域驱动设计”。 首先要意识到的不是建立一个统治全部的大模型。 DDD是关于域(其中之一是核心域)和子域。 它是关于有限的上下文,可以通过书中描述的各种方式进行连接。 所以基本上你会得到很多自主子系统,看起来有多余的数据,它们以松散耦合的方式相互通信,并将部分数据与松散耦合的通信同步。 许多最重要的限制只会最终保持一致,系统,流程和用户必须容忍这一点。 因此,在您描述的复杂性的情况下,我认为是。 ...
  • 阶段B到阶段D包括为每个体系结构域定义基线和目标体系结构,并确定基线和目标之间的差距。 在D阶段结束时,您应该有四组架构定义和四组缺口分析。 阶段E涉及将已识别的差距合并到工作包中。 这些集体是机会。 基线(当前)体系结构和目标(未来)体系结构之间的差距是机会。 然后,您将这些要求纳入路线图并草拟实施计划,这就是解决方案要素。 希望能帮助到你。 Phases B through D involve defining the baseline and target architectures for each ...
  • 我同意,这没有意义。 根据我对TOGAF的理解,应该“回到建筑工作要求的发起者”。 正如您自己注意到的那样,架构工作声明不是输入,而是A阶段的输出。另一方面,建筑工作请求是一个输入,应该包含业务目标。 I agree, this does not make sense. To my understanding of TOGAF, it should be "go back to the originators of the Request for Architecture Work". As you not ...
  • Ubuntu不再维护PL / JAVA包。 您提到的软件包使用的是旧版本的PL / JAVA,具体取决于gcj。 强烈建议使用PL / JAVA 1.5.0版,使用最新的Oracle或OpenJDK java版本。 悲伤的消息是你必须自己建造它。 有关说明,请参阅 https://tada.github.io/pljava/build/build.html (建筑物) https://tada.github.io/pljava/install/install.html (安装) There is no ma ...
  • 我通过从项目中删除libCommonCrypto.dylib,libz.dylib并将security.framework,javascript.framework添加到项目中解决了这个问题。 I have solved this problem by removing libCommonCrypto.dylib,libz.dylib from project and adding security.framework, javascript.framework to the project.

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。