Type coercion for luajava package, make luajava an "addon"
This commit is contained in:
@@ -6,17 +6,23 @@ import lua.StackState;
|
||||
public class LString extends LValue {
|
||||
|
||||
final String m_string;
|
||||
final int m_hash;
|
||||
|
||||
public LString(String string) {
|
||||
this.m_string = string;
|
||||
this.m_hash = string.hashCode();
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
return o != null && o instanceof LString && m_string.equals(((LString)o).m_string);
|
||||
if ( o != null && o instanceof LString ) {
|
||||
LString s = (LString) o;
|
||||
return m_hash == s.m_hash && m_string.equals(s.m_string);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return m_string.hashCode();
|
||||
return m_hash;
|
||||
}
|
||||
|
||||
// TODO: what to do with LuaState?
|
||||
|
||||
Reference in New Issue
Block a user