事实上,重写是发现和纠正一些错误的最好方法,如语法和拼写错误。
In fact, rewriting is the best way to find out and correct some mistakes, like grammar and spelling mistakes.
我们实际上可以用多种方法重写上一个例子的最后一行。
We could actually write the last line of the previous example in several ways.
无需创建接口和去掉整个模拟对象的存根—您可以有选择地重写方法并返回一个简单的模拟响应。
No need to create an interface and stub out an entire mock object - you can strategically override that one method and return a simple mocked-out response.
然后就可以放弃事件或者调用重写了基类的方法。
Then you can either abandon the event or must invoke the method overridden in the based class.
重写长时间查询是另外一个无需添加索引即可增强性能的方法。
Rewriting long-running queries is another way to boost performance without adding indexes.
当子类所重写的方法被调用时,你可以在子类中对父类的内部状态进行操作。
In a subclass you can make assumptions about the internal state of the superclass when the method you override is getting called.
为了支持等待的线程,在清单2中已经重写了remove方法。
In Listing 2, the remove method has been overridden to support waiting threads.
现在您已经创建了一个原始标题的合理副本,您也需要重写Footer方法,以便于您生成页脚。
Now that you've created a reasonable facsimile of the original header, you also need to override the footer method so you can generate the footer.
RewriterUtils是一个helper类,此类将提供一对由URL重写HTTP模块和 HTTP处理程序使用的静态方法。
RewriterUtils is a helper class that provides a couple of static methods used by both the URL rewriting HTTP module and HTTP handler.
被重写的click方法会增加count。
为了举例说明,可以将%INCLUDE “lsxsd . lss ”行添加到Web服务的(options)部分,然后重写GetUserRoles方法,如下所示。
As an example, you could add the line % INCLUDE "lsxsd.lss" to the (Options) section of the Web service and rewrite the GetUserRoles method like this.
它使用了HTTP的方法和页眉(header),但是重写了HTTP中管理连接和数据转移格式的部分。
It USES HTTP methods and headers, but it overrides the parts of the protocol that manage connections and data transfer formats.
要通过HTTP程序程序执行url重写,我们可以创建一个HTTP处理程序工厂,该处理程序工厂的GetHandler方法将检查被请求的路径,以确定是否需要重写url。
To perform URL rewriting through an HTTP handler, we can create an HTTP handler factory whose GetHandler method checks the requested path to determine if it needs to be rewritten.
将调用重写后的execute方法来处理请求,它继承自超类org . apache . struts . action . action。
The overridden method execute , which is inherited from the super-class org.apache.struts.action.Action, is called for processing the request.
你只需要继承BaseIntrospectionRule,重写你关心的方法,并添加相匹配的基于XML的元数据文件即可。
Simply inherit from BaseIntrospectionRule, override the methods you care about, and add a matching XML-base meta-data file.
要定义任何可能的SAX事件处理程序,程序员必须扩展XML::SAX::Base并重写任何需要的方法。
To define any conceivable SAX event handler, a programmer extends XML::SAX::Base and overrides whatever methods are of interest.
如果重写visit (Code),并从那里调用super .visit (Code),则当超类visit (Code)返回时,它将调用用于该方法中所有catch块的visit (CodeException)。
If you override visit (Code) and call super.visit (Code) from it, when the superclass visit (Code) returns, it will have called visit (CodeException) for all the catch blocks in the method.
这个实现对ActionExecutor[2]类(由oozie提供)进行了扩展,并重写了一些必要的方法。
This implementation extends ActionExecutor [2] class (provided by Oozie) and overrides the required methods.
用这种方法扩展JAAS减少了您或另一个程序员必须在应用程序生命周期内业务规则发生更改时重写代码的可能性。
Extending the JAAS in this way decreases the chances that you or another programmer will have to rewrite the code as the business rules change over the lifespan of the application.
其次,程序员必须重写必要的基本方法。
Secondly, the programmer must override base methods as necessary.
但是我们在这里给你一个新的方法,如果你没试过的话你应该试试。重写或者重新总结你的课堂笔记和课本章节。
But here's something you should try if you haven't yet - rewriting or summarizing both your own classroom notes and the textbook chapters.
如果可以重写类的话,则可以重写它的方法的行为,因此您最安全的选择就是不允许将类子类化。
If the class can be overridden, its methods' behaviors can be overridden as well, so your safest bet is to disallow subclassing.
尽管对于重写方法,可能会多一点开销,但让编写测试的人专注于正在发生的事情是很重要的。
Although there maybe a little more overhead with regards to overriding methods, it is important to keep the test writer concentrated on what is happening.
你需要记住对象重写了哪个方法,以及为哪些对象添加了新的功能。
You have to remember which object is overriding which method, and what objects have new functionality attached to them.
处理程序必须调用超类中的方法而是重写模块中的方法(如清单9所示)。
It is essential that the handler invoke methods in the superclass rather than methods in the overriding module (see Listing 9).
它实现了对提供的类编写者实例的传递处理,使您可以只重写需要特殊处理的方法。
It implements the pass-through handling for a supplied class writer instance, letting you override only the methods where you need special handling.
这样您就可以将场所获取方法放在工具类中,来重写列表10中的代码,如列表11所示。
So you can rewrite the code in Listing 10 a little bit by putting the locale get method in a utility class, as Listing 11 shows.
父类中的重写方法不仅局限于构造函数。
Overriding methods in a parent class is not limited to the constructor.
必须通过实现接口或者扩展DefaultHandler类并根据需要重写它的方法,创建这些事件的handler。
A handler has to be created for these events by either implementing an interface or extending the DefaultHandler class and overriding its methods as needed.
Swing适配器允许您子类化适配器,并且可以仅重写处理事件所需的方法。
The Swing adaptors allow you to subclass the adaptor and just override the methods you need to handle for the event.
应用推荐