collections

How to detect collection changes in NHibernate

两盒软妹~` 提交于 2020-02-25 05:50:23
问题 How can I detect changes (additions and removals) from many to many sets and lists in NHibernate? I'm using an interceptor to detect changes in the object model (for auditing and more), this works great for changes within object (using OnSave/OnFlushDirty) but not for collections. When a collection changes the OnCollectionUpdate method is called but it only receives the key of the object holding the collection and the collection's latest items. What I need is: the object holding the

How to detect collection changes in NHibernate

爱⌒轻易说出口 提交于 2020-02-25 05:47:50
问题 How can I detect changes (additions and removals) from many to many sets and lists in NHibernate? I'm using an interceptor to detect changes in the object model (for auditing and more), this works great for changes within object (using OnSave/OnFlushDirty) but not for collections. When a collection changes the OnCollectionUpdate method is called but it only receives the key of the object holding the collection and the collection's latest items. What I need is: the object holding the

Why is VectorBuilder in the package scala.collections.immutable?

馋奶兔 提交于 2020-02-23 10:02:11
问题 VectorBuilder is defined in the same source file as Vector . Vector is immutable and in the scala.collections.immutable package, so as a consequence the builder is in the same package. As far as I can tell, CanBuildFrom uses a VectorBuilder as the default, if the return type is not explicitly typed. Is there a reason for not having the builder in a separate file in the mutable package? Is the builder not meant to be used directly? If so, which builder or buffer is to be used to create a Seq ?

Why is VectorBuilder in the package scala.collections.immutable?

大憨熊 提交于 2020-02-23 10:02:08
问题 VectorBuilder is defined in the same source file as Vector . Vector is immutable and in the scala.collections.immutable package, so as a consequence the builder is in the same package. As far as I can tell, CanBuildFrom uses a VectorBuilder as the default, if the return type is not explicitly typed. Is there a reason for not having the builder in a separate file in the mutable package? Is the builder not meant to be used directly? If so, which builder or buffer is to be used to create a Seq ?

What Should I use? a dictionary, list, or something else [closed]

放肆的年华 提交于 2020-02-23 08:28:20
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed yesterday . Please excuse the very entry-level nature of this question. I'm very new to c#. When I work with various libraries and components that have objects stored in collections, I'm able to retrieve the object by either the object name or its index. I want to implement a similar collection in c#; however, my

What Should I use? a dictionary, list, or something else [closed]

痞子三分冷 提交于 2020-02-23 08:27:21
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed yesterday . Please excuse the very entry-level nature of this question. I'm very new to c#. When I work with various libraries and components that have objects stored in collections, I'm able to retrieve the object by either the object name or its index. I want to implement a similar collection in c#; however, my

Sorting an arraylist of my own type in Java

≡放荡痞女 提交于 2020-02-22 07:47:46
问题 I have a type in Java called Item which is defined as follows: private Integer itemNo; private String itemName; private String itemDescription; ... And I would like to be able to sort an arraylist of this type in descending order according to itemName. From what I read, this can be done via: Collections.sort(items, Collections.reverseOrder()); Where items is: ArrayList<Item> items = new ArrayList<Item>(); But I find that the call to Collections.sort gives me a: Item cannot be cast to java

Cost of implicit conversion from java to scala collections

左心房为你撑大大i 提交于 2020-02-20 09:22:07
问题 I'd like to know the cost of implicit conversion from java collection to scala ones. In this doc there are several implicit two-way conversions for which it is said that "converting from a source type to a target type and back again will return the original source object" . I conclude that the cost should be minor (wrapping), but still how much is it? I ask this question because I use java sets in some scala code, which is implicitly converted to scala set as I import asScalaSet (I do need it

VBA Debugger shows only 256 elements of a collection

匆匆过客 提交于 2020-02-16 05:50:11
问题 the title explains my problem. Im working on an excelmakro and my questions is, is there an option that the debugger shows all elements like it does with an array? And if not, is the only workaround the storage of my classobjects in an array after inflating the collection? I appreciate your help. 回答1: You could use debug.print and write the output into the immediate window and bypass the limit that way. I am almost certain that there is no way to increase that limit, but maybe someone else

VBA Debugger shows only 256 elements of a collection

三世轮回 提交于 2020-02-16 05:49:27
问题 the title explains my problem. Im working on an excelmakro and my questions is, is there an option that the debugger shows all elements like it does with an array? And if not, is the only workaround the storage of my classobjects in an array after inflating the collection? I appreciate your help. 回答1: You could use debug.print and write the output into the immediate window and bypass the limit that way. I am almost certain that there is no way to increase that limit, but maybe someone else