首页 \ 问答 \ Scala案例类和Hash Collision(Scala case classes and Hash Collision)

Scala案例类和Hash Collision(Scala case classes and Hash Collision)

当我从Eclipse IDE生成equals和hashCode方法时,我正面临着Hash Collision问题。

我计划使用Scala API case classes用于相同的目的,因为它自动创建equalshashcode

Scala生成的方法是否足以处理Hash Collision问题?

在使用Case Classes时,任何人都遇到了Hash Collision问题?


I am facing Hash Collision issue when i generated the equals and hashCode methods from Eclipse IDE.

I am planning to use Scala API case classes for the same purpose, since its creating equals and hashcode automatically.

Is Scala generated methods are good enough to handle the Hash Collision issue?

Anyone faced the Hash Collision issues while using Case Classes?


原文:https://stackoverflow.com/questions/35283794
更新时间:2022-01-01 08:01

最满意答案

您的ViewState假设不太正确。 如ASP.NET页面生命周期概述中所述,ViewState在InitComplete之后InitComplete

意思是,无论你在InitInitComplete写入控件的属性(在生命周期的那一点都不推荐使用btw),最终会被InitCompleteLoad之间的ViewState覆盖。

您的网页显示的行为是正确的。


You are not quite correct in your ViewState assumption. As described in ASP.NET Page Life Cycle Overview, the ViewState is loaded AFTER InitComplete.

Meaning, whatever you write into the control's properties in Init or InitComplete (which btw is not recommended at that point of the Life Cycle) will definetly be overwritte by the ViewState between InitComplete and Load.

The behaviour your page is showing is correct.

相关问答

更多
  • 我会去做那些: http : //msdn.microsoft.com/en-us/library/ms178472.aspx http://i.msdn.microsoft.com/dynimg/IC386473.png I would go with the ones that made it: http://msdn.microsoft.com/en-us/library/ms178472.aspx http://i.msdn.microsoft.com/dynimg/IC386473.png
  • 自从我发布了这个问题以来,这段时间已经有一段时间了,这个问题很受我对MVC的一些经验和了解。 仍然收到一些非常有用的信息,最终导致我找到一个解决方案,并获得一些MVC的见解。 首先抛出了我的一切,那就是你可以有一个控件用强类型的对象作为参数,如下所示: public ActionResult DoSomething(MyClass myObject)... 该对象源于同一个控制器: ... return View(myObject); ... 这导致我相信对象生活在这两个步骤中,我以某种方式可以期望你可 ...
  • 这里有一个想法(假设你可以使用jQuery): 仅注册最内层儿童的onresize 。 然后在那个onresize里面,调用$(this).parent().trigger('onresize'); 这将确保它正确地上链。 注意:如果你不使用jQuery,你仍然可以在javascript中实现这个事件冒泡。 Here's one idea (assuming you can use jQuery): Register innermost child's onresize only. Then inside ...
  • 您的ViewState假设不太正确。 如ASP.NET页面生命周期概述中所述,ViewState在InitComplete之后InitComplete 。 意思是,无论你在Init或InitComplete写入控件的属性(在生命周期的那一点都不推荐使用btw),最终会被InitComplete和Load之间的ViewState覆盖。 您的网页显示的行为是正确的。 You are not quite correct in your ViewState assumption. As described in A ...
  • NavigationController像堆栈一样工作。 当你弹出一些东西被释放时。 例如视图控制器像这样堆叠: A→B→C→D 如果您将调用popToViewController(B),堆栈应该是: A - > B 视图控制器C和D应该被释放,当然如果它们没有强大的引用来保存它们的话) NavigationController is working like stack. When you are popping something it's being deallocated. For example ...
  • 没有生命周期方法,但您可以使用现有的shouldComponentUpdate和componentWillUpdate挂钩并将状态更改逻辑包装在一个检查中,以确保previousState !== this.state No lifecycle methods exist, but you can use the existing shouldComponentUpdate and componentWillUpdate hooks and wrap your state change logic in a ...
  • 在LoadViewState之前触发Init,在LoadViewState之后触发Load。 我不知道Load在LoadPostBack之前被激活了...默认情况下,LoadViewState在初始页面加载时没有调用,但是在所有其他时间调用...所以我假设你有自定义viewstate处理这个控件和我正在做一些特别的事 您可以做的另一件事是,在LoadViewState方法运行之后,放置一个自定义事件并在LoadVIewState例程结束时触发此事件... LoadViewState is not calle ...
  • 释 您可以在javascript中更新HiddenField值并将其返回到服务器。 如果您希望在Load之后对象可用,则使用LoadComplete是可以的。 如果您希望此对象在加载时可用于所有控件,则最早可以从输入获取数据是通过重载PreLoad并在那里创建对象。 你的逻辑没有问题。 结论 您的实施中存在一些错误。 让我们现在看看代码。 Explaination You can update HiddenField values in javascript and get them back at the ...
  • 一种方法是使用您在网站中始终使用的基页。 这将包含一个名为PageLoadComplete的变量,您可以在PageLoad事件结束时设置该变量。 然后,您可以在方法中检查此变量的状态。 public abstract class BasePage : System.Web.UI.Page { public bool PageLoadComplete { get; private set; } protected override void OnLoad(EventArgs e) { ...
  • 我认为你是对的。 这是来自MSDN: Init - 在初始化所有控件并应用任何外观设置后触发。 单个控件的Init事件发生在页面的Init事件之前。 使用此事件可以读取或初始化控件属性。 您可以查看此链接以获取更多详细信息: ASP.NET页面生命周期概述 I think you are correct. This is from MSDN: Init - Raised after all controls have been initialized and any skin settings have b ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。