com.caucho.es
Class ESObject

java.lang.Object
  |
  +--com.caucho.es.ESBase
        |
        +--com.caucho.es.ESObject
Direct Known Subclasses:
ESClass, ESClosure, ESGlobal, ESRegexp

public class ESObject
extends ESBase

Implementation class for a JavaScript Object.


Field Summary
protected  boolean snapPrototype
           
 
Fields inherited from class com.caucho.es.ESBase
DONT_DELETE, DONT_ENUM, esBase, esEmpty, esNull, esUndefined, READ_ONLY
 
Constructor Summary
protected ESObject()
           
  ESObject(java.lang.String className, ESBase proto)
          Simple constructor for parentless objects.
protected ESObject(java.lang.String className, ESBase proto, int hashSize)
           
 
Method Summary
 ESBase call(Call call, int length)
           
protected  boolean canPut(ESString name)
           
 ESBase construct(Call call, int length)
           
 java.lang.Object copy(java.util.HashMap refs)
           
protected  void copy(java.util.HashMap refs, java.lang.Object newObj)
           
protected  void copy(java.lang.Object newObj)
           
 ESBase delete(ESString name)
          Deletes the entry.
 boolean ecmaEquals(ESBase b)
           
 ESBase getProperty(ESString name)
          Gets a property value.
 java.util.Iterator keys()
           
 void put(ESString name, ESBase value, int flags)
           
 void put(int i, ESBase value, int flags)
          Sets the named property
 void put(java.lang.String name, ESBase value, int flags)
           
 void setProperty(ESString name, ESBase value)
          Puts a new value in the property table with the appropriate flags
protected  void shallowCopy(java.lang.Object newObj)
           
 boolean toBoolean()
           
 java.lang.Object toJavaObject()
           
 double toNum()
          Returns a string rep of the object
 ESObject toObject()
           
 ESBase toPrimitive(int hint)
          XXX: not right
 ESString toSource(IntMap map, boolean isLoopPass)
           
 ESString toStr()
          Returns a string rep of the object
 ESBase typeof()
           
 void unwatch(ESString name)
           
 void watch(ESString name, ESBase fun)
           
 
Methods inherited from class com.caucho.es.ESBase
call, getJavaType, getProperty, greaterThan, hasProperty, isBoolean, isNum, isString, lessThan, plus, setProperty, setProperty, toInt32, toJavaString, toPrimitive, toString, valueOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

snapPrototype

protected boolean snapPrototype
Constructor Detail

ESObject

protected ESObject()

ESObject

public ESObject(java.lang.String className,
                ESBase proto)
Simple constructor for parentless objects.

ESObject

protected ESObject(java.lang.String className,
                   ESBase proto,
                   int hashSize)
Method Detail

getProperty

public ESBase getProperty(ESString name)
                   throws java.lang.Exception
Gets a property value.
Overrides:
getProperty in class ESBase

canPut

protected boolean canPut(ESString name)

setProperty

public void setProperty(ESString name,
                        ESBase value)
                 throws java.lang.Exception
Puts a new value in the property table with the appropriate flags
Overrides:
setProperty in class ESBase

put

public void put(ESString name,
                ESBase value,
                int flags)

put

public void put(java.lang.String name,
                ESBase value,
                int flags)

delete

public ESBase delete(ESString name)
              throws java.lang.Exception
Deletes the entry. Returns true if successful.
Overrides:
delete in class ESBase

watch

public void watch(ESString name,
                  ESBase fun)

unwatch

public void unwatch(ESString name)

put

public void put(int i,
                ESBase value,
                int flags)
Sets the named property

keys

public java.util.Iterator keys()
                        throws ESException
Overrides:
keys in class ESBase

typeof

public ESBase typeof()
              throws ESException
Overrides:
typeof in class ESBase

toPrimitive

public ESBase toPrimitive(int hint)
                   throws java.lang.Exception
XXX: not right
Overrides:
toPrimitive in class ESBase

toObject

public ESObject toObject()
Overrides:
toObject in class ESBase

toJavaObject

public java.lang.Object toJavaObject()
                              throws ESException
Overrides:
toJavaObject in class ESBase

toNum

public double toNum()
             throws java.lang.Exception
Returns a string rep of the object
Overrides:
toNum in class ESBase

toStr

public ESString toStr()
               throws java.lang.Exception
Returns a string rep of the object
Overrides:
toStr in class ESBase

toSource

public ESString toSource(IntMap map,
                         boolean isLoopPass)
                  throws java.lang.Exception
Overrides:
toSource in class ESBase

toBoolean

public boolean toBoolean()
Overrides:
toBoolean in class ESBase

copy

public java.lang.Object copy(java.util.HashMap refs)

copy

protected void copy(java.lang.Object newObj)

copy

protected void copy(java.util.HashMap refs,
                    java.lang.Object newObj)

shallowCopy

protected void shallowCopy(java.lang.Object newObj)

ecmaEquals

public boolean ecmaEquals(ESBase b)
                   throws java.lang.Exception
Overrides:
ecmaEquals in class ESBase

call

public ESBase call(Call call,
                   int length)
            throws java.lang.Exception
Overrides:
call in class ESBase

construct

public ESBase construct(Call call,
                        int length)
                 throws java.lang.Exception
Overrides:
construct in class ESBase