Revision: 4262
          http://vexi.svn.sourceforge.net/vexi/?rev=4262&view=rev
Author:   mkpg2
Date:     2011-10-03 22:14:26 +0000 (Mon, 03 Oct 2011)
Log Message:
-----------
Improve. Give immutable an informative (and key-able) string representation.

Modified Paths:
--------------
    trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JS.jpp

Modified: trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JS.jpp
===================================================================
--- trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JS.jpp   2011-09-30 
03:15:47 UTC (rev 4261)
+++ trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JS.jpp   2011-10-03 
22:14:26 UTC (rev 4262)
@@ -384,6 +384,13 @@
         public void addConstructor(JS constructor) throws JSExn {
             throw new JSExn("Attemted to add constructor to immutable");
         }
+        
+        /** <p>Returns ClassName$xxxxxxxx where xxxxxxxx is the hashcode in 
hex.</p> 
+         *  <p>Uniqueness (so can act as a keys in a map) and some human 
readability are 
+         *     the only two things we really require from these strings.</p> 
+         *  <p>REMARK - the hash should be unique whilst an object exists, 
though its not guaranteed by Java</p> */
+        public String coerceToString() { return getClass().getSimpleName()+"$" 
+ Integer.toHexString(hashCode()); }
+
     }
 
     public interface Cloneable extends JS {
@@ -768,7 +775,7 @@
         /** <p>Returns obj$xxxxxxxx where xxxxxxxx is the hashcode in hex.</p> 
          *  <p>Uniqueness (so can act as a keys in a map) and some human 
readability are 
          *     the only two things we really require from these strings.</p> 
-         *  <p>REMARK - the hash should be unique, though its not guaranteed 
by Java</p> */
+         *  <p>REMARK - the hash should be unique whilst an object exists, 
though its not guaranteed by Java</p> */
         public String coerceToString() { return "obj$" + 
Integer.toHexString(hashCode()); }
 
         public Map getPropsMap() { return traps; }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to