Mercurial Hosting > luan
comparison src/luan/modules/BasicLuan.java @ 1095:2443152dc2f1
add Luan.hash_code() and Table.hash_value()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 21 Feb 2017 20:27:17 -0700 |
parents | 60661a8e738c |
children | 490f77bb2ad1 |
comparison
equal
deleted
inserted
replaced
1094:cb4c20fce7d0 | 1095:2443152dc2f1 |
---|---|
238 public static String number_type(Number v) throws LuanException { | 238 public static String number_type(Number v) throws LuanException { |
239 Utils.checkNotNull(v); | 239 Utils.checkNotNull(v); |
240 return v.getClass().getSimpleName().toLowerCase(); | 240 return v.getClass().getSimpleName().toLowerCase(); |
241 } | 241 } |
242 | 242 |
243 public static int hash_code(Object obj) throws LuanException { | |
244 if( obj == null ) { | |
245 return 0; | |
246 } else { | |
247 return obj.hashCode(); | |
248 } | |
249 } | |
250 | |
243 } | 251 } |