通常,您会看到侦听器被定义为内嵌匿名类。
Often, you'd see the listener defined as an inline anonymous class.
匿名类就像是满满一桶冰水,每次用的时候都会洒到您的腿上。
Anonymous classes are like a bucketful of cold water that's spilled in your lap every time you want to use them.
为了在递归方法中传递,匿名类应该扩展方法已知的包装器类型。
To pass this to a recursive method, the anonymous class should extend a wrapper type known to the method.
当每次调用匿名类的父方法时都必须创建一个该类实例。
An instance of this class has to be created for each time the parent method is called.
为了实现该侦听器类,我们将在主资源管理器窗口中编码一个匿名类。
To implement this listener class, we'll code an anonymous class in the main Explorer Window.
多余句子结构所需的过多的额外处理阻碍了对匿名类的使用。
All of the extra effort in wasted syntax discourages their use.
不过匿名类的名称却无法预料,因此我们只需要考虑其实现细节。
However, the names are not necessarily predictable and should be considered an implementation detail.
将不同属性指定为键属性的匿名类型实例不是同一类型的实例。
GetHashCode for an anonymous type is based on the key properties of the type.
如果这个匿名类可被作为一个内部类单独放置,那么清单1中的代码将会简洁很多。
The code in Listing 1 would be much neater if the anonymous class was placed separately as an inner class.
注意:从技术角度考虑,匿名类也拥有类型名称,该类型名称是由编译器自动生成的。
Note: Technically speaking, anonymous classes have names that are generated by the compiler.
有同样属性名和类型的两个匿名类型对象将被指派为自动生成的同样的类。
Two anonymously typed objects that have the same property names and types will be assigned to the same automatically generated class.
例如,清单1所示的代码使用一个匿名类创建了一个ThreadFactory。
As an example, the code in Listing 1 USES an anonymous class to create a Thread Factory.
最接近的方式是利用类(经常是匿名类)作为想要执行的方法的 “holder”。
The closest you can come is to use a class (frequently an anonymous class) as a "holder" of a method you need to execute.
这样就允许我们通过使用集合操作来从匿名类或具有值约束的类来创建复合类。
This allows the use of set operations to build up complex classes from anonymous classes or classes with value restrictions.
CLR自己对匿名类型没有什么概念,只是把它们看作有着自动产生名字的普通类。
The CLR itself doesn't have any notion of anonymous types and sees them as normal classes with automatically generated names.
它的作用在于,您可以使用匿名类来替代您所希望替代的方法;剩下的方法会按默认方式实现。
What's useful about this class is that you can use anonymous classes to override only the methods you want; the rest of the methods are implemented by default.
匿名类允许创建这样的对象,该对象能够捕获定义它们的一部分环境,但是对象和代码块不一样。
Anonymous classes let you create objects that capture part of the environment in which they were defined, but objects and blocks of code are not the same thing.
匿名类型允许您定义一个类,然后在不给出类名称的情况下声明并初始化该类的对象。
Anonymous types allow you to define a class, then declare and initialize an object of that class, without giving the class a name.
为了实现递归,可以通过将proceed(. .)调用封装在匿名类中来隐藏连接点的其他部分。
To do this recursively, you close over the rest of the join point by encapsulating the proceed (..) call in an anonymous class.
大概地讲,因为我们的匿名类没有定义自己的click,所以这个方法会按照声明从右到左开始寻找。
Loosely speaking, since our anonymous class doesn't define click itself, the method lookup proceeds right to left, as declared.
如果你添加了一个方法,则所有JRuby要做的事情就是生成一个新的匿名类,该类包含了这一方法的方法体。
If you add a method, all JRuby has to do is generate a new anonymous class that includes the body of that method.
使用定制的SecurityManager或ClassLoader阻止加载匿名类或其他无法直接控制的类。
Use a custom SecurityManager or ClassLoader that prevents loading of anonymous classes or other classes not under your direct control.
由于在异步函数中所使用的“局部变量”实际上是某个匿名类中的字段,因此在调用期间它们必须被保留。
Since the "locals" used by an asynchronous functions are actually fields on an anonymous class, they must be retained for the duration of the call.
因为每个匿名类都有一个唯一的名称,因此在加载该类是不会有问题的,而这样做的结果是,应用被实时动态地更新了。
As each anonymous class has a unique name there are no issues loading it and as a result the application is updated on-the-fly.
那些匿名函数所需的本地变量据说被“封闭”(closedover)或“提升”(lifted)到该匿名类中。
Locals variables needed by those functions are said to "closed over" or "lifted" into the anonymous class.
匿名类是一种语法速写标记,使您能够在需要实现某个抽象类或者接口的地方创建一个类的实例,而不需要显式提供类的名称。
An anonymous class is a kind of syntactic shorthand that lets you instantiate a class implementing an abstract class or interface where you need it, without having to explicitly give it a class name.
该间接产物基于“高级编译技术(类似抽象字节码)”,会产生一个主类和几个匿名类、以及一些启用JIT的支持类。
The indirection, which is based on "advanced compilation techniques (like abstract bytecode)" results in one master class and several anonymous, JIT enabled support classes.
如果此过程耗时数秒,这对于异步调用而言是很常见的,而该匿名类可能在不经意间被晋升为垃圾回收器中更昂贵的1代或2代对象[3]。
If this takes several seconds, which is not uncommon for an asynchronous call, the anonymous class may be inadvertently promoted to the more expensive generation 1 or 2.
ConvertAnonymousClasstoNested重构能够接受一个匿名类并将其转换为最初包含这个匿名类的方法的一个嵌套类。
The convert anonymous class to nested refactoring takes an anonymous class and converts it to a nested class of the method that originally contained the anonymous class.
本系列所给出的表单自动保存特性适用于认证的和匿名的这两类用户。
The form auto-saving feature presented in this series works with authenticated and anonymous users.
应用推荐