hasInstance()

http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/Scriptable.html#hasInstance(org.mozilla.javascript.Scriptable)
Scriptableの件の追記ってことで。

The instanceof operator.

The JavaScript code "lhs instanceof rhs" causes rhs.hasInstance(lhs) to be called.

ということなので、以下のように実装するのがいいかも。サブクラスとかはよくわからないけど。


public boolean hasInstance(Scriptable lhs) {
return getClassName().equals(lhs.getClassName());
}