首页 / 词典 / good

hashcode

  • 网络散列值
hashcodehashcode
  1. The first of the new methods added is hashCode () .

    新添加的第一个方法是hashCode()。

  2. The hashCode () method exists purely for efficiency .

    hashCode()方法纯粹用于提高效率。

  3. Equality method : define the equals () and hashCode () methods together for correct equality .

    判等方法(Equalitymethod):为正确的相等方式一起定义equals()和hashcode()方法。

  4. Default equals , hashcode , and toString methods are automatically generated .

    自动生成默认的equals、hashcode和toString方法。

  5. Having every Java object support hashCode () allows for efficient storage and retrieval using hash-based collections .

    使所有Java对象都能够支持hashCode()并结合使用基于散列的集合,可以实现有效的存储和检索。

  6. It is a classic Value Object , thus it implements equals () and hashCode () based upon its internal state .

    它是一个典型的ValueObject,因此它基于其内部状态实现了equals()和hashCode()。

  7. The Object class has two methods for making inferences about an object 's identity : equals () and hashCode () .

    Object类有两种方法来推断对象的标识:equals()和hashCode()。

  8. When creating your own classes , you are supposed to provide both equals () and hashCode () methods together .

    在创建自己的类时,既需要提供equals()方法,又需要提供hashCode()方法。

  9. In this case , when the equals () and hashCode () methods are generated , the style property is excluded .

    在本例中,当equals()和hashCode()方法生成时,style属性并没有被包括。

  10. Using int , instead of long , for the return type of hashCode () increases the possibility of hash collisions .

    使用int而不是long作为hashCode()的返回类型增加了散列冲突的几率。

  11. The interface contract for Object requires that if two objects are equal according to equals (), then they must have the same hashCode () value .

    Object的interfacecontract要求如果根据equals()两个对象是相等的,那么它们必须有相同的hashCode()值。

  12. Unfortunately this caused one problem : XPathNode inherits equals () and hashCode () from QName .

    遗憾的是,这造成了一个问题:XPathNode从QName继承了equals()和hashCode()。

  13. For any array type , you can call Arrays . hashCode ( arrayVar ) and get a well formed hash code .

    对于任意数组类型,都可以调用Arrays.hashCode(arrayVar)方法来获得格式良好的哈希码。

  14. Because these classes are immutable and implement hashCode () and equals () sensibly , they all make good hash keys .

    由于这些类都是不可修改的并且可以实施hashCode()和equals(),它们都可以做为很好的散列关键字。

  15. The window that opens asks you which fields you want to include when the hashCode () and equals () methods are called on your class .

    打开的窗口将询问您在类中调用hashCode()和equals()方法时需要包括哪些字段。

  16. Depending on your class , you may also want to delegate part of the computation to the equals () or hashCode () function of the superclass .

    根据您使用的类,您可能希望降低superclass的equals()或hashCode()功能一部分计算能力。

  17. For more complex classes , the behavior of equals () and hashCode () may even be imposed by the specification of a superclass or interface .

    对于比较复杂的类来说,equals()和hashCode()的行为可能甚至受到superclass或interface的影响。

  18. Should equals () and hashCode () be based on the object 's identity ( like the default implementation ) or the object 's state ( like Integer and String )?

    equals()和hashCode()是否应基于对象的标识(象缺省实施)或对象的状态(象Integer和String)?

  19. Eclipse lets you automatically generate the hashCode () and equals () methods for your classes so you don 't have to do it yourself .

    Eclipse允许您自动生成类的hashCode()和equals()方法,因此您无需亲自执行此操作。

  20. I have three methods to exercise various aspects of the software : testing the constructor , testing the getters , and testing the equals () and hashCode () methods .

    我有三个方法来执行软件的各个方面:测试构造器、测试读方法(getters)以及测试equals()和hashCode()方法。

  21. Note that both of these implementations delegate a portion of the computation to the equals () or hashCode () method of the state fields of the class .

    注意:这两种实施都降低了类状态字段的equals()或hashCode()方法一定比例的计算能力。

  22. It also creates appropriate equals and hashcode methods , as shown in the last test & the object contents are the same , but they do not point to the same reference .

    该注解还创建了适当的equals和hashcode方法,如最后一个测试中所示,对象内容是相同的,但它们没有指向同一个引用。

  23. Because on some architectures the address space is larger than the range of values for int , it is possible that two distinct objects could have the same hashCode () .

    由于在某些架构上,地址空间大于int值的范围,两个不同的对象有相同的hashCode()是可能的。

  24. It turns out it can do quite a lot : it can call the get () method , and it can call any of the methods inherited from Object ( such as hashCode ()) .

    事实证明Unbox方法能做许多工作:它能调用get()方法,并且能调用任何从Object继承而来的方法(比如hashCode())。

  25. Using the Eclipse Galileo hashCode () and equals () generation really comes in handy when you want to create rules that make your objects equal based on the actual values in the fields .

    有时,您需要创建一些规则,根据实际的字段值将您的对象变为相等的对象。这时,使用EclipseGalileohashCode()和equals()生成功能真的很方便。

  26. To change this behavior , click Source > Generate hashCode () and equals () to generate a new version of the equals () method that compares all the fields , like the one shown below .

    要改变这种行为,单击Source>GeneratehashCode()andequals()以生成equals()方法的一个新版本,新的方法将比较所有字段,如下所示。

  27. With the help of the new hashCode () method of Arrays , you can use it to generate a hash code for any local array types , instead of rolling your own each time you need it .

    在Arrays的新方法hashCode()的帮助下,可以为任何本地数组类型生成哈希码,而不用在每次需要它的时候折腾您自己。

  28. FindBugs has a detector for detecting many instances of this problem , such as overriding equals () but not hashCode (), or overriding hashCode () but not equals () .

    FindBugs有一个检测器用于检测这个问题的很多实例,如重载了equals()但没有重载hashCode(),或重载了hashCode()但没有重载equals()。

  29. Basic ( rulesets / basic . xml ) & A grab bag of rules that most developers are unlikely to disagree with : catch blocks shouldn 't be empty , override hashCode () anytime you override equals (), etc.

    基本(rulesets/basic.xml)&规则的一个基本合集,可能大多数开发人员都不认同它:catch块不该为空,无论何时重写equals(),都要重写hashCode(),等等。