edu.vub.at.objects.natives
Class NATStripe

java.lang.Object
  extended byedu.vub.at.objects.natives.NATNil
      extended byedu.vub.at.objects.natives.NATByCopy
          extended byedu.vub.at.objects.natives.NATStripe
All Implemented Interfaces:
ATAbstractGrammar, ATConversions, ATExpression, ATNil, ATObject, ATStatement, ATStripe, java.io.Serializable
Direct Known Subclasses:
NATStripe.OBJRootStripe

public class NATStripe
extends NATByCopy
implements ATStripe

The native implementation of AmbientTalk stripe objects.

Author:
tvcutsem
See Also:
Serialized Form

Nested Class Summary
static class NATStripe.OBJRootStripe
          The root stripe of the stripe hierarchy: every stripe eventually has this stripe as its parent.
 
Field Summary
private  ATTable parentStripes_
           
private  ATSymbol stripeName_
           
 
Fields inherited from class edu.vub.at.objects.natives.NATNil
_INSTANCE_
 
Constructor Summary
protected NATStripe(ATSymbol stripeName, ATTable parentStripes)
          The constructor is declared protected such that it cannot be used externally, but can be used by the OBJRootStripe class to create a stripe with an empty parent table, which is normally not allowed.
 
Method Summary
static NATStripe atValue(ATSymbol stripeName)
           
static NATStripe atValue(ATSymbol stripeName, ATTable parentStripes)
          Stripes should not be created directly because it should be verified that their list of parent stripes is never empty.
static NATStripe atValue(java.lang.String stripeName)
           
static NATStripe atValue(java.lang.String stripeName, NATStripe singleParent)
           
 ATStripe base_asStripe()
           
 ATTable base_getParentStripes()
           
 ATSymbol base_getStripeName()
           
 boolean base_isStripe()
           
 ATBoolean base_isSubstripeOf(ATStripe superstripe)
          Native implementation of: def isSubstripeOf(superstripe) { (superstripe.name() == name).or: { (superstripes.find: { |sstripe| sstripe.isSubstripeOf(superstripe) }) !
 boolean equals(java.lang.Object other)
          Identity of stripes is based on their name
 ATTable meta_getStripes()
          Returns the stripes of this object.
 NATText meta_print()
          Prints out the object in a human-readable way.
 
Methods inherited from class edu.vub.at.objects.natives.NATByCopy
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_asField, base_asHandler, base_asMessage, base_asMessageCreation, base_asMethod, base_asMirror, base_asNumber, base_asSplice, base_asStatement, 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_isSymbol, base_isTable, base_isUnquoteSplice, base_isVariableAssignment, base_new, createChild, isAmbientTalkObject, isJavaObjectUnderSymbiosis, isNativeBoolean, isNativeField, 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_newInstance, 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_newInstance, 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_asField, base_asHandler, base_asMessage, base_asMessageCreation, base_asMethod, base_asMirror, base_asNumber, base_asSplice, base_asStatement, 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_isSymbol, base_isTable, base_isUnquoteSplice, base_isVariableAssignment, isAmbientTalkObject, isJavaObjectUnderSymbiosis, isNativeBoolean, isNativeField, isNativeText
 

Field Detail

stripeName_

private final ATSymbol stripeName_

parentStripes_

private final ATTable parentStripes_
Constructor Detail

NATStripe

protected NATStripe(ATSymbol stripeName,
                    ATTable parentStripes)
The constructor is declared protected such that it cannot be used externally, but can be used by the OBJRootStripe class to create a stripe with an empty parent table, which is normally not allowed. Hence, by construction the only stripe with an empty parent table is the root stripe.

Method Detail

atValue

public static NATStripe atValue(java.lang.String stripeName)

atValue

public static NATStripe atValue(ATSymbol stripeName)

atValue

public static NATStripe atValue(java.lang.String stripeName,
                                NATStripe singleParent)

atValue

public static NATStripe atValue(ATSymbol stripeName,
                                ATTable parentStripes)
Stripes should not be created directly because it should be verified that their list of parent stripes is never empty. Stripes created with an empty parent list automatically get assigned the root stripe as their single parent.


base_getStripeName

public ATSymbol base_getStripeName()
                            throws InterpreterException
Specified by:
base_getStripeName in interface ATStripe
Throws:
InterpreterException

base_getParentStripes

public ATTable base_getParentStripes()
                              throws InterpreterException
Specified by:
base_getParentStripes in interface ATStripe
Throws:
InterpreterException

base_isSubstripeOf

public ATBoolean base_isSubstripeOf(ATStripe superstripe)
                             throws InterpreterException
Native implementation of: def isSubstripeOf(superstripe) { (superstripe.name() == name).or: { (superstripes.find: { |sstripe| sstripe.isSubstripeOf(superstripe) }) != nil } };

Specified by:
base_isSubstripeOf in interface ATStripe
Throws:
InterpreterException

equals

public boolean equals(java.lang.Object other)
Identity of stripes is based on their name

Overrides:
equals in class NATNil

base_isStripe

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

base_asStripe

public ATStripe base_asStripe()
Specified by:
base_asStripe in interface ATConversions
Overrides:
base_asStripe in class NATNil

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

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