For example, the ArrayList class should have been defined with a first and last method, but alas it did not. However, it's easy enough to add those methods in Groovy, as shown in Listing 5.
举例来说,应该使用first和last方法来定义arraylist类,不过并未采用这种方式。
First, if you choose good names for the method arguments, then your calls to those methods document each argument with a name.
第一,如果你为方法参数选择了好的名字,那么你对那些函数的调用事实上为每一个参数记载了一个名字。
Method chaining USES return values from methods to relay instruction context, which in this case is the object instance making the first method invocation.
方法链接使用方法的返回值来中转指令上下文,在这种情况下是进行第一个方法调用的对象实例。
应用推荐