Listing 1. Protecting a block of code with ReentrantLock.
清单1.用ReentrantLock保护代码块。
To use this refactoring, select a block of code in the editor and press Alt+Shift+M.
要使用这个重构,请选择编辑器中的一个代码块,然后按下 Alt+Shift+M。
Next you'll execute the component tests that you have created for this new block of code.
下一步你可以执行为你的那部分新代码设计的组件测试。
The subsequent block of code initializes the XML-RPC client connection to the blog server.
接下来的代码初始化到博客服务器的XML - RPC客户端连接。
In this case, the each method has the block of code between the braces associated with it.
在此情况下,each方法都有一个代码块,并且被与之相关的括号括起来。
The code in braces is a closure and is simply a block of code that's passed to callcc.
花括号中的代码是一个闭包,它仅仅是传递给 callcc的代码块。
The final block of code occurs within the context of the active scene as shown in Listing 11.
在当前场面的上下文中,执行的最后一个代码块见清单11。
This block of code, again from Listing 3, looks for calls made to the Logger's log method.
这段代码也取自清单3,查找对Logger的log方法的调用。
When a method is called only once by another method, and it makes more sense as a block of code.
当一个方法只被另一个方法调用一次,并且作为一个代码块更有意义时。
The third block of code (lines 8-11) handles writing the document to an output stream as text.
第三个代码块(第 8-11 行)处理将文档作为文本写入输出流。
All right. The fourth thing I'm going to do, is I'm going to then construct the block of code.
好,我要做的第四件事情就是,我会去写这块循环代码。
The Extract method refactoring allows you to select a block of code and convert it to a method.
ExtractMethod重构允许您选择一块代码并将其转换为一个方法。
You can copy and paste the preceding block of code and modify it according to your own configuration.
这段代码可以复制并粘贴,并根据配置作适当的修改。
Finding a seemingly arbitrary number in the middle of a 40 line block of code is a maintenance nightmare.
在40行的代码块了中寻找一个不带任何表意的字符变量,对于维护工作来说简直是场噩梦。
To create this form, start with a file called datastore.jsp, then plug in the block of code in Listing 6.
要创建这个表单,我们首先需要创建一个datastore . jsp文件,然后编写清单6所示的代码块。
A given SRC object knows what block of code it needs to call by looking through its inheritance tree.
给定的src对象通过查看整个继承树知道它需要调用哪一个代码块。
As an example, consider any repetitive coding pattern, such as executing a block of code with a lock held.
以一个常见的编码模式为例,如执行带有Lock的代码块。
For example, say I want to move the block of code after the call to map.get in Listing 3 to a separate method.
例如,假设我想要在调用了清单3中的map .get后,将代码块移到另外一个方法。
Every event has a handler which is a block of code that is executed in response to the occurrence of the event.
每个事件有一个处理函数,即在发生此事件时执行的代码块。
Because of the scoping rules for closures, one cannot use a goto to enter a block of code containing a closure.
因为闭包的范围规则,开发时不能使用goto语句进入包含闭包的代码块。
The next step is to create the actor itself, using the actor method, which takes a block of code as a parameter.
下一步是使用actor方法创建actor本身,这个方法通过参数接收一个代码块。
In the next block of code I define the concept f: product, defining its preferred label, as well as alternate labels.
在接下来的代码块中,我定义了概念f:product,同时定义了它的优选标签和备选标签。
So all he has to do is copy a block of code over into an HTML file, change the contents of it and he is good to go!
因此,他要做的全部事情就是把一部分代码复制到一个HTML文件中,改变它的内容,然后他就可以继续前进了!
The team is currently considering adding the keyword dynamic to the language and using it to demarcate a block of code.
我们目前正在考虑添加一个名为dynamic的关键字来将动态代码块分隔开。
A code block is simply a block of code that returns a value, and if no value is returned then a NULL object is returned.
代码块就是将返回一个值的一组代码,如果没有返回值,那么会返回一个NULL对象。
That is, a block of code (function) that now doesn't have to be represented via thread state and registers and such.
也就是说,现在并不通过线程状态和寄存器表示代码块(函数)。
A block of code that must be executed in sequence and without interruption to guarantee correct operation of the software.
一段必须按次序执行的代码,并且不能被中断,否则不能保证软件正确地操作。
Finally, you can implement the traditional use case for exception handling over a block of code as shown in Listing 7.
最后如清单7所示,您能实现对代码块进行异常处理的传统用例。
The final block of code calls this method and prints the result code, which is the blogid of the post on the blog server.
最后一段代码调用此方法并打印结果代码,也就是博客服务器上的文章的blogid。
After all, in theory, the if simply checks a condition, and if the condition is true, executes the block of code that follows.
毕竟,从理论上说,if只检查一个条件。如果条件为真,则执行后面跟着的代码。
应用推荐