(The class invariant above was effectively a field-invariant specification!)
(上面的类不变条件实际上就是一个字段不变条件的规范!)
Maintain a certain property, assumed on entry and guaranteed on exit: the class invariant.
在进入时假定,并在退出时对峙一些特定的属性:不变式。
A class invariant must hold before and after all method calls (once the object is constructed).
类在方法调用之前和之后必须保持不变(一旦对象已经构建)。
That means that this property, the class invariant, must be satisfied whenever an instance of the class is created.
这就意味着无论什么时候创建一个类实例,该属性(或者说类不变式)的一致性都必须得到确保。
It's as if the class invariant is added to the pre - and post-condition of every single exported routine of the class.
如此看来,类不变式好像是被附加到了类暴露例程的前置和后置条件上。
A typical kind of property that you might want to express, say, in a class invariant for a graph class, is that the graph has no cycles.
比如在一个图类中,你可能想要表述的典型属性是该图没有回路。这就是一个一阶谓词演算不可表述的属性。
But more fundamentally, a class invariant is a way to characterize the fundamental consistency and integrity properties of the class and its instances.
但从根本上讲,类不变式是一种刻画类和类实例的基本的一致性和完整性的方法。
The class Invariant guarantees (for the local class) that the state of the class will be maintained within specified tolerances at the end of each feature execution.
不变式保证,在执行完每个功能后,类的状态被都保持在一个规定的状态。
The class Invariant guarantees (for the local class) that the state of the class will be maintained within specified tolerances at the end of each feature execution.
不变式包管,在履行完每个功能后,类的状况被都对峙在一个规定的状况。
That is to say, assuming the class invariant was satisfied before the routine was called, the routine must ensure that class invariant is again going to be satisfied on exit.
也就是说,假设类不变式在该例程调用前被满足了,那么例程退出时必须再次确保类不变式得到满足。
What's more, in pure DBC terms, a class that abides by DBC rules has a contract with the outside world about the internal consistency that it will maintain, which is known as the class invariant.
另外,在纯dbc术语中,遵循dbc规则的类针对其将维护的内部一致性与外部世界有一个契约,即人所共知的类不变式。
The contract specification for BankAccount includes a class-wide invariant that the balance must always be greater than or equal to zero (sorry, no overdrafts allowed!).
BankAccount的接口规范包含一个类范围的不变条件测试,即余额总要大于或等于0(对不起,不允许透支)。
For example, many class or method invariants are first written as JUnit assertions; these invariant checks could be reused for production diagnostics if it did not automatically trigger exceptions.
比如,很多类或方法常量首先作为JUnit断言写入,如果不自动触发异常这些常量,则可以在产品诊断中重复使用它们。
By using potential well family method, we study the invariant sets and vacuum isolating behaviour of solutions to a class of nonlinear wave equations.
应用位势井族方法,研究了一类非线性波动方程的不变集合与解的真空隔离,证明了当初始能量小于位势井深度时,此问题存在不变集合与解的真空隔离现象。
This paper discusses a class of decoupled control systems of linear time-invariant systems, and introduces a simple decoupled method.
本文研究线性定常系统的某一类解藕控制系统,提出一种简便的解藕方法。
An explicit contract is any contract you declare in a class method, such as a precondition, a postcondition or an invariant.
显式的合同是在类方法中,如前提条件后,置条件或不变声明任何合同。
An explicit contract is any contract you declare in a class method, such as a precondition, a postcondition or an invariant.
显式的合同是在类方法中,如前提条件后,置条件或不变声明任何合同。
应用推荐