singleton

—— 英文翻译成中文

谷歌翻译

独生子
  • 0

有道翻译

单例
词典解释
n. 一个;独身
n. (Singleton)人名;(英)辛格尔顿
网络释义
Singleton - 单元素集合,单例模式,单件
John Singleton - 约翰辛格顿,约翰·辛格顿,约翰
singleton set - 单元素集,单元素集合,单元素集合
  • 0

腾讯翻译

单个物件 / 单身人士 / 单张花色牌
  • 0

yandex翻译

单独
  • 0

babylon翻译

一个, 单独, 独身
  • 0

双语例句

  • 为了能让事件排序正确工作,此值必须保持为 1 以便所有请求都能被相同的 singleton 做排序处理。
    For event sequencing to work properly, this value must remain one so that all requests are processed for sequencing by the same singleton.
  • 这是一个单实例根用户管理对象,开始和终止所有其他管理对象/守护进程。
    This is the singleton root management object that starts and stops all other management objects/daemons.
  • 通过使用这种功能,您可以使用流行的单例模式。
    Through this functionality, you can use the popular singleton pattern.
  • 举例来讲,如果作为应用程序的全局用户界面的单实例框架被创建了两个,应用程序就会在屏幕上显示两个框架——这会使用户感到非常纠结。
    For example, if your singleton Frame is meant as a global user interface for your application and two are created, your application will have two Frames on the screen -- quite confusing for the user.
  • 这是一个惟一的类,也就意味着所有项目正在运行的服务器实例只有一个惟一的映射。
    This class is a singleton, meaning there's only one map of running server instances for all projects.
  • 单态 模型提供了具有特定名称的对象的共享实例,可以在查询时对其进行检索。
    Singleton mode provides a shared instance of the object with a particular name, which will be retrieved on lookup.
  • 这样会给容器一个标记,表明需绕过对这些方法的共享和同步访问,将 EJB 组件作为一个单独系统。
    This will give the container a marker for knowing to treat this EJB component as a singleton, bypassing all pooling and synchronization access to the methods.
  • 这个单实例对象是根用户管理对象,启动和停止所有其他管理任务。
    This singleton is the root management object that starts and stops all other management tasks.
  • 因为配置非单体方面与配置域对象共享许多公共内容,所以后面我会研究一个应用于这两者的简单解决方案。
    Because configuring non-singleton aspects shares much in common with configuring domain objects, I'll then look at a simple solution that applies to them both.
  • 这个测试类的意思就是不论那个线程在任何时候,在单例下调用这个类公共方法,都将返回相同的值。
    This setup means that no matter which thread uses this class in the Singleton Pattern, whenever that public method is called, it should output the same value.
  • 该类中仅剩的另一个方法(用 斜体标识)用于获取该单件的一个引用,如果尚未实例化则创建它。
    The only other method (set in italics) in the class is used to get a reference to the singleton and to create it if it is not yet instantiated.
  • 比如数据库连接池就是单例设计模式的一个例子:我们一般不想让应用程序具有连接池类的多个资源密集型实例。
    An example use case for a singleton would be a database connection pool: You don't want your application to have multiple resource-intensive instances of a connection pool class.
  • 由于只有一个单实例,单例对象的域只会在一个类中出现一次,就像静态域一样。
    Since there is only one singleton instance, any instance fields of a singleton will occur only once per class, just like static fields.
  • 在此种解决方法中,我们试图避免在每次该方法被调用时由于对该单例类进行锁住而产生的开销。
    In this situation, we intend to avoid the expense of grabbing the lock of the singleton class every time the method is called.
  • 静态访问特别适合实现单一设计模式,在这种模式中只存在一个类实例。
    Static access is especially useful for implementing the singleton design pattern, where only one instance of class exists.
  • 单例模式是一种非常有用的设计模式,它允许你的类对外只提供一个实例,但是常犯的错误在于不止一个实例被创建。
    The singleton is a useful design pattern for allowing only one instance of your class, but common mistakes can inadvertently allow more than one instance to be created.
  • BE 处的代码为 Singleton 对象从堆中分配内存,并将一个指向该块内存的指针存储到 eax 中。
    The code at BE allocates the memory from the heap for the Singleton object and stores a pointer to that memory in eax.
  • 比如说,一个表达式不能引用类或者对象主体内才被计算的实例字段,但是它可以引用一个方法或者一个单例对象。
    For example, an expression could not refer to an instance field that will be computed inside the class or object body, but it could invoke a method on a singleton object.
  • 我们既可以执行每个状态作为Singleton,也可以创建一个状态工厂用于生成和管理状态。
    We could either implement each state as a Singleton, or create a factory of states which creates and manages the states.
  • 这段代码的一个简单优化是对 Empty 类应用同一个设计类型,因为每一个 Empty 的实例都是同样的。
    A simple optimization to this code would be to apply the Singleton design pattern to class Empty, because every instance of Empty is identical.
  • 本文讨论的主题是单例模式,请将上述实现方式牢记于心,因为接下来的现象可能出现在任何一种实现方式中。
    As I discuss the singleton, keep the above implementations in mind, although many of those phenomena can occur for any implementation of the singleton.
  • 因为根据设计它是线程安全的,创建它之后可以把它缓存在一个公共静态最终变量中,或者包装在单实例模式中以供以后访问。
    Since it is thread safe by design, you might cache it in a public static final variable, or wrap it in a singleton pattern after creation for later access.
  • 但更糟的问题是模型只是通过单体模式表达的一个全局状态。
    And, to make matters worse, the model is simply a global state, expressed through a singleton.
  • 线程 1 在它停止的地方启动,并执行 //2 代码行,这导致创建另一个 Singleton 对象。
    Thread 1 starts where it left off and executes line //2 which results in another Singleton object being created.