I would like to use the Iesi.Collections HashedSet class for entity collections in NHibernate. The functionality I want is that duplicate entities cannot be added. I would like entities to be considered duplicate if they share the Id (i.e. primary key) field, or, if they have Id == 0 (i.e. unsaved), then certain key properties are compar...
I am using using Microsoft .NET Framework 4.0.
I have run into this using Aggregate on a Dictionary<T, List<T>> to extract the set of type T values used across all type List<T> lists in the dictionary. Here is the simplest case I could come up with that exhibits the same behaviour.
First, as the documentation states, the following does...
in java...
public class someclass {
private HashSet<Someobject> contents = new HashSet<Someobject>();
private Set<Someobject> contents2 = new HashSet<Someobject>();
}
what's the difference? in the end it's both a hashset isn't it? the second one looks just wrong to me but i have seen it frequently used, accepted and working......
I've written a class called PuzzleBoard that represents an nxn board. I will be keeping several PuzzleBoard objects in a HashSet, so I have to overwrite the 'int hashCode()' method.
Below are the fields of my class:
private int N;
private int[][] puzzle;
private int blankCellX;
private int blankCellY;
private int cost;
What Ecli...
I created an object HashSet, and the value is an object (Triple) which is my own class. But I get a strange thing, when there are two equal objects on my HashSet, is it possible? Here is my overriding method for the equals in the class Triple
@Override
public boolean equals(Object other){
if (other == null) return false;
if (other =...