edu.vub.at.objects.natives
Class NATField

java.lang.Object
  extended byedu.vub.at.objects.natives.NATNil
      extended byedu.vub.at.objects.natives.NATByRef
          extended byedu.vub.at.objects.natives.NATField
All Implemented Interfaces:
ATAbstractGrammar, ATConversions, ATExpression, ATField, ATNil, ATObject, ATStatement, java.io.Serializable

public class NATField
extends NATByRef
implements ATField

NATField implements a causally connected field of an object. Rather than storing these fields directly in every object, we choose to only make people pay when they choose to reify them.

Author:
smostinc
See Also:
Serialized Form

Field Summary
private  NATCallframe frame_
           
private  ATSymbol name_
           
 
Fields inherited from class edu.vub.at.objects.natives.NATNil
_INSTANCE_
 
Constructor Summary
NATField(ATSymbol name, NATCallframe frame)
           
 
Method Summary
 ATField base_asField()
           
 ATSymbol base_getName()
           
 ATObject base_readField()
           
 ATNil base_writeField(ATObject newValue)
          Sets the value of the field if possible
 boolean isNativeField()
           
 ATTable meta_getStripes()
          Returns the stripes of this object.
 ATObject meta_newInstance(ATTable initargs)
          Fields can be re-initialized when installed in an object that is being cloned.
 NATText meta_print()
          Prints out the object in a human-readable way.
 
Methods inherited from class edu.vub.at.objects.natives.NATByRef
meta_pass, meta_resolve
 
Methods inherited from class edu.vub.at.objects.natives.NATNil
asAmbientTalkObject, asJavaClassUnderSymbiosis, asJavaObjectUnderSymbiosis, asNativeBoolean, asNativeException, asNativeFarReference, asNativeFraction, asNativeNumber, asNativeNumeric, asNativeTable, asNativeText, base__opeql__opeql_, base_asActorMirror, base_asAsyncMessage, base_asBegin, base_asBoolean, base_asClosure, base_asDefinition, base_asExpression, base_asFarReference, base_asHandler, base_asMessage, base_asMessageCreation, base_asMethod, base_asMirror, base_asNumber, base_asSplice, base_asStatement, base_asStripe, base_asSymbol, base_asTable, base_asUnquoteSplice, base_asVariableAssignment, base_init, base_isBoolean, base_isCallFrame, base_isClosure, base_isFarReference, base_isMessageCreation, base_isMethod, base_isMirror, base_isSplice, base_isStripe, base_isSymbol, base_isTable, base_isUnquoteSplice, base_isVariableAssignment, base_new, createChild, equals, isAmbientTalkObject, isJavaObjectUnderSymbiosis, isNativeBoolean, isNativeText, meta_addField, meta_addMethod, meta_assignField, meta_assignVariable, meta_clone, meta_defineField, meta_doesNotUnderstand, meta_eval, meta_extend, meta_getDynamicParent, meta_getLexicalParent, meta_grabField, meta_grabMethod, meta_invoke, meta_isCloneOf, meta_isRelatedTo, meta_isStripedWith, meta_listFields, meta_listMethods, meta_lookup, meta_quote, meta_receive, meta_respondsTo, meta_select, meta_send, meta_share, readResolve, toString, writeReplace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.vub.at.objects.ATObject
base__opeql__opeql_, base_init, base_new, meta_addField, meta_addMethod, meta_assignField, meta_assignVariable, meta_clone, meta_defineField, meta_doesNotUnderstand, meta_eval, meta_extend, meta_getDynamicParent, meta_getLexicalParent, meta_grabField, meta_grabMethod, meta_invoke, meta_isCloneOf, meta_isRelatedTo, meta_isStripedWith, meta_listFields, meta_listMethods, meta_lookup, meta_pass, meta_quote, meta_receive, meta_resolve, meta_respondsTo, meta_select, meta_send, meta_share
 
Methods inherited from interface edu.vub.at.objects.coercion.ATConversions
asAmbientTalkObject, asJavaClassUnderSymbiosis, asJavaObjectUnderSymbiosis, asNativeBoolean, asNativeException, asNativeFarReference, asNativeFraction, asNativeNumber, asNativeNumeric, asNativeTable, asNativeText, base_asActorMirror, base_asAsyncMessage, base_asBegin, base_asBoolean, base_asClosure, base_asDefinition, base_asExpression, base_asFarReference, base_asHandler, base_asMessage, base_asMessageCreation, base_asMethod, base_asMirror, base_asNumber, base_asSplice, base_asStatement, base_asStripe, base_asSymbol, base_asTable, base_asUnquoteSplice, base_asVariableAssignment, base_isBoolean, base_isCallFrame, base_isClosure, base_isFarReference, base_isMessageCreation, base_isMethod, base_isMirror, base_isSplice, base_isStripe, base_isSymbol, base_isTable, base_isUnquoteSplice, base_isVariableAssignment, isAmbientTalkObject, isJavaObjectUnderSymbiosis, isNativeBoolean, isNativeText
 

Field Detail

name_

private final ATSymbol name_

frame_

private final NATCallframe frame_
Constructor Detail

NATField

public NATField(ATSymbol name,
                NATCallframe frame)
Method Detail

base_getName

public ATSymbol base_getName()
Specified by:
base_getName in interface ATField
Returns:
a string by which the slot can be identified.

base_readField

public ATObject base_readField()
                        throws InterpreterException
Specified by:
base_readField in interface ATField
Returns:
the current value of the field.
Throws:
InterpreterException

base_writeField

public ATNil base_writeField(ATObject newValue)
                      throws InterpreterException
Description copied from interface: ATField
Sets the value of the field if possible

Specified by:
base_writeField in interface ATField
Parameters:
newValue - - the value the field should hold.
Returns:
- the return value is ignored.
Throws:
InterpreterException - - if the field cannot be modified.

meta_print

public NATText meta_print()
                   throws InterpreterException
Description copied from interface: ATObject
Prints out the object in a human-readable way.

Specified by:
meta_print in interface ATObject
Overrides:
meta_print in class NATNil
Throws:
InterpreterException

isNativeField

public boolean isNativeField()
Specified by:
isNativeField in interface ATConversions
Overrides:
isNativeField in class NATNil

base_asField

public ATField base_asField()
                     throws XTypeMismatch
Specified by:
base_asField in interface ATConversions
Overrides:
base_asField in class NATNil
Throws:
XTypeMismatch

meta_newInstance

public ATObject meta_newInstance(ATTable initargs)
                          throws InterpreterException
Fields can be re-initialized when installed in an object that is being cloned. They expect the new owner of the field as the sole instance to their 'new' method

Specified by:
meta_newInstance in interface ATObject
Overrides:
meta_newInstance in class NATNil
Throws:
InterpreterException

meta_getStripes

public ATTable meta_getStripes()
                        throws InterpreterException
Description copied from interface: ATObject
Returns the stripes of this object. Note that only the stripes that were attached directly to this object are returned, not all of the parent's stripes as well.

Specified by:
meta_getStripes in interface ATObject
Overrides:
meta_getStripes in class NATNil
Throws:
InterpreterException