F
Farouche
Hi
I would like some suggestions on how to, effectively compute a Hash Value
for a "Collection" of simple Field Objects:
internal class Field
{
private string _fieldName;
private object _fieldValue;
public Field(string fieldName, object fieldValue)
{
this._fieldName = fieldName;
this._fieldValue = fieldValue;
}
public int GetHashcode()
{
Return ????????
}
}
The HashCode for Field must ofcourse be computed based on both Name and
Value
These Field objects are stored in a derived HashTable:
internal class FieldGroup : Hashtable
{
public int GetHashCode()
{
string key;
Field fld;
foreach (int key in this.Keys) {
fld = this(key);
?????????
}
}
}
FieldGroup objects are filled with Field objects in this way:
FieldGroup fg = new FieldGroup();
string aName;
object aValue;
fg(aName) = new Field(myName, myValue);
I would like a suggestion on the most effective way to calculate a unique
HashCOde for such a FieldGroup object based on its contained Field objects.
Thanks in advance
Farouche
I would like some suggestions on how to, effectively compute a Hash Value
for a "Collection" of simple Field Objects:
internal class Field
{
private string _fieldName;
private object _fieldValue;
public Field(string fieldName, object fieldValue)
{
this._fieldName = fieldName;
this._fieldValue = fieldValue;
}
public int GetHashcode()
{
Return ????????
}
}
The HashCode for Field must ofcourse be computed based on both Name and
Value
These Field objects are stored in a derived HashTable:
internal class FieldGroup : Hashtable
{
public int GetHashCode()
{
string key;
Field fld;
foreach (int key in this.Keys) {
fld = this(key);
?????????
}
}
}
FieldGroup objects are filled with Field objects in this way:
FieldGroup fg = new FieldGroup();
string aName;
object aValue;
fg(aName) = new Field(myName, myValue);
I would like a suggestion on the most effective way to calculate a unique
HashCOde for such a FieldGroup object based on its contained Field objects.
Thanks in advance
Farouche