<cfscript>
        foo = StructNew();
        foo.a = "b";
        foo.b = "a";
        WriteOutput(foo.hashCode());
</cfscript>

Also, I have included more information on how the hashCode is generated
below.

public int hashCode()
Returns the hash code value for this map. The hash code of a map is
defined to be the sum of the hash codes of each entry in the map's
entrySet() view. This ensures that t1.equals(t2) implies that
t1.hashCode()==t2.hashCode() for any two maps t1 and t2, as required by
the general contract of Object.hashCode.

This implementation iterates over entrySet(), calling hashCode on each
element (entry) in the Collection, and adding up the results.

Specified by: hashCode in interface Map
Overrides: hashCode in class Object
Returns: the hash code value for this map.
See Also: Map.Entry.hashCode(), Object.hashCode(),
Object.equals(Object), Set.equals(Object)

Matt Liotta
President & CEO
Montara Software, Inc.
http://www.montarasoftware.com/
V: 415-577-8070
F: 415-341-8906
P: [EMAIL PROTECTED]

> -----Original Message-----
> From: Jon Hall [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, September 01, 2002 6:59 PM
> To: CF-Talk
> Subject: Re: Uniquely identifing a structure.
> 
> How?
> 
> --
> jon
> mailto:[EMAIL PROTECTED]
> 
> Sunday, September 1, 2002, 9:03:38 PM, you wrote:
> 
> ML> If you are using CFMX you can get the HashCode of the underlying
> ML> HashMap.
> 
> ML> Matt Liotta
> ML> President & CEO
> ML> Montara Software, Inc.
> ML> http://www.montarasoftware.com/
> ML> V: 415-577-8070
> ML> F: 415-341-8906
> ML> P: [EMAIL PROTECTED]
> 
> >> -----Original Message-----
> >> From: James Sleeman [mailto:[EMAIL PROTECTED]]
> >> Sent: Sunday, September 01, 2002 5:52 PM
> >> To: CF-Talk
> >> Subject: Uniquely identifing a structure.
> >>
> >> Hi all,
> >>     I need to get a simple string value that will uniquely identify
a
> >> given
> >> structure, currently what I am using is this...
> >>
> >> <CFWDDX ACTION="CFML2WDDX" INPUT=#AStructure# OUTPUT="AWddx">
> >> <CFSET aKey = Hash(AWddx)>
> >>
> >> which produces exactly what I want, but my problem is that this
> ML> happens
> >> several times per request and thus it is potentially a bottle neck
> ML> (even
> >> if
> >> wddx is fast, the structure in question could possibly be large).
> >>
> >> Does anybody have any better ideas on how to accomplish this ?
> >>
> >> ---
> >> James Sleeman
> >>
> >>
> >> ---
> >> Outgoing mail is certified Virus Free.
> >> Checked by AVG anti-virus system (http://www.grisoft.com).
> >> Version: 6.0.384 / Virus Database: 216 - Release Date: 24/08/2002
> >>
> >>
> ML>
> 
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to