MIDlet实现RecordComparator接口,并定义compare (byte rec1, byte rec2)方法来比较两个候选记录。
The MIDlet implements the RecordComparator interface and defines a compare (byte rec1, byte rec2) method to compare two candidate records.
在 Scala 文档集中,经典的示例就是 Ordered 特征,它定义了名字很有趣的方法,以提供比较(以及排序)功能,如清单 13 所示
Within the Scala documentation set, the classic example is the Ordered trait, which defines methods-with-funny-names to provide comparison (and thus ordering) capabilities, as shown in Listing 13
这个大于的操作符的时候,是到类的定义里去识别,大于是一个比较的方法,那么让我在这里说仔细一点吧。
When I try and evaluate that expression of greater than, is going to go into the class to say greater than is a comp method.
When I try and evaluate that expression of greater than, is going to go into the class to say greater than is a comp method.
这个大于的操作符的时候,是到类的定义里去识别,大于是一个比较的方法,那么让我在这里说仔细一点吧。
应用推荐