电话从超级所有子类的方法?
当然可以在子类中提供这些方法的优化实现,但是不是必须这么做。
You certainly can provide optimized implementations of these methods in your subclasses, but you don't have to.
相反,我向为每个子类执行适当的操作的子类添加额外的方法。
Instead, I add extra methods to the subclasses that perform the appropriate action for each subclass.
如果这些类中的任何一个的子类需要覆盖默认行为,那么可以通过覆盖这个方法实现。
If a subclass of one of these classes needed to override the default behavior, it could do so by overriding the method.
创建一个子类,并仅仅重载您在测试方法中所使用的那些方法。
You create your subclass and override just those methods that you use in your methods under test.
这是一种可以使客户端能确定他接收到的是类层次中的什么成员的方法,并相应处理子类中的附加信息。
This is one approach that enables the client to determine what member of the class hierarchy it receives, and process the additional information in the subclass accordingly.
在项目的后续阶段中,这提供了一种简单的方法,为不同类型的外部通信添加新的子类。
This approach provided an easy way of adding new subclasses for different types of external communication at later stages in the project.
这个方法还会将正在显示的子类清单置空。
This method also blanks out the list of subcategories being displayed.
如果可以重写类的话,则可以重写它的方法的行为,因此您最安全的选择就是不允许将类子类化。
If the class can be overridden, its methods' behaviors can be overridden as well, so your safest bet is to disallow subclassing.
您可以在应用程序需要创建其类型依赖于子类的实现的对象时,使用工厂方法模式。
You use the factory method pattern when an application needs to create objects whose type depend on the implementation of subclasses.
是否还能把更多的方法从子类提升到通用的父类中?
Can I pull more methods from the child into the generic parent class?
继承抽象类的子类必须实现在其父类或自身中声明为抽象的所有抽象方法。
A child class that extends an abstract class must implement all abstract methods in its parent or itself be declared abstract.
我的经验是应该总是使读写方法受保护,所以只有子类可以访问其属性。
My experience is that you should always strive to make accessors protected, so only subclasses can access the attributes.
然后您就可以在键入的以基类作为方法参数的方法中使用基类或任何一个子类。
You can then use the base class, or any of the subclasses, in methods that are typed to expect the base class as a method argument.
有太多的替代方法可以轻易地为每种增强情形创建子类。
There are too many permutations to easily create subclasses for every enhancement scenario.
子类必须提供每个方法的实现。
A child class must provide an implementation for each method.
然后让子类改写某些特殊的方法从而改变基本读取器的行为。
The subclass can then override any particular method to alter the behavior of the base reader.
将字段声明为受保护时,子类中的方法就有可能直接访问它们,这样就可能有效地增加类层次结构中的耦合。
When fields are declared protected, there is the possibility that methods in subclasses will directly access them, effectively increasing the coupling within a class hierarchy.
接下来,引用生成的程序,并提供子类(带有可理解的方法名)。
Next, refer to the generated program, and provide sub-classes (with understandable method names) as necessary.
最后,在单例模式的一些实现方式中,单例类的子类能够动态地重载方法,这是静态方法所不能办到的。
With some implementations of the singleton, you allow writers of subclasses to override methods polymorphically, something not possible with static methods.
当子类所重写的方法被调用时,你可以在子类中对父类的内部状态进行操作。
In a subclass you can make assumptions about the internal state of the superclass when the method you override is getting called.
在这种分析性使用方法的子类型的第二步中,把在数据仓库中发现的信息反馈给MDM系统,以便在IT 领域中使用这些信息。
In a second step in this sub-type of the analytical method of use, insight gained in the data warehouse is made actionable by feeding it back to the MDM System for use in the IT landscape.
在quicktemplate子类的内部,通过覆盖这些方法,可以随心所欲地格式化和样式化类别列表和交叉引用等。
Inside the QuickTemplate subclass, you'll override methods to format and style things like category listings and cross-references the way you want.
有时需要编写一个子类(通常作为内部类)来测试protected 的方法。
Sometimes you need to write a subclass (often as an inner class) in order to test protected methods.
要直接使用fork/join,您必须使用带有一个任务闭包的runForkJoin()方法或一个将AbstractForkJoinWorker分为子类的任务类。
To use fork/join directly, you must either use the runForkJoin() method with a task closure or a task class that subclasses AbstractForkJoinWorker.
现在,项阵列可以是private的,因为子类使用受保护的add方法将配置项添加到列表中。
Now, the items array can be private because the descendant classes use the protected add method to add configuration items to the list.
这个建议匹配的方法调用是在JDBC连接上定义的,而且会返回Statement或任何子类。
This matches any call to a method defined on a JDBC connection that returns a Statement or any subclass thereof.
class - name是类的完全限定名,方法在此类(或其子类)中声明。
Class-name is the fully qualified name of the class in which the method is declared (or a subclass thereof).
EmptyVisitor只是提供了所有不同种类的visitor的空的实现,允许您只对感兴趣的visitor方法建子类和重写。
EmptyVisitor just provides an empty implementation of all the various types of visitors, allowing you to subclass and override only the visitor methods of interest.
EmptyVisitor只是提供了所有不同种类的visitor的空的实现,允许您只对感兴趣的visitor方法建子类和重写。
EmptyVisitor just provides an empty implementation of all the various types of visitors, allowing you to subclass and override only the visitor methods of interest.
应用推荐