The Meta-Environment API

aterm.pure
Class ATermApplImpl

java.lang.Object
  extended by aterm.pure.ATermVisitableImpl
      extended by aterm.pure.ATermImpl
          extended by aterm.pure.ATermApplImpl
All Implemented Interfaces:
ATerm, ATermAppl, Identifiable, jjtraveler.Visitable, shared.SharedObject, shared.SharedObjectWithID

public class ATermApplImpl
extends ATermImpl
implements ATermAppl


Field Summary
private  ATerm[] args
           
private  AFun fun
           
 
Fields inherited from class aterm.pure.ATermImpl
factory
 
Fields inherited from interface aterm.ATerm
AFUN, APPL, BLOB, INT, LIST, LONG, PLACEHOLDER, REAL
 
Constructor Summary
protected ATermApplImpl(PureFactory factory)
           
protected ATermApplImpl(PureFactory factory, ATermList annos, AFun fun, ATerm[] i_args)
           
 
Method Summary
 Visitable accept(Visitor v)
           
 shared.SharedObject duplicate()
           
 boolean equivalent(shared.SharedObject obj)
           
 AFun getAFun()
          Gets the AFun object that represents the function symbol of this application
 ATerm getArgument(int index)
          Gets a specific argument of this application.
 ATerm[] getArgumentArray()
          Gets the arguments of this application as an array of ATerm objects.
 ATermList getArguments()
          Gets the arguments of this application.
 int getArity()
          Gets the arity of this application.
 java.lang.String getName()
          Gets the function name of this application.
 int getNrSubTerms()
           
 ATerm getSubTerm(int index)
           
 int getType()
          Gets the type of this term.
protected  int hashFunction()
           
protected  void init(int hashCode, ATermList annos, AFun fun, ATerm[] i_args)
           
protected  void initHashCode(ATermList annos, AFun fun, ATerm[] i_args)
           
 boolean isQuoted()
          Checks if this application is quoted.
protected  ATermAppl make(AFun fun, ATerm[] i_args)
           
protected  ATermAppl make(AFun fun, ATerm[] i_args, ATermList annos)
           
 ATerm make(java.util.List<java.lang.Object> arguments)
          Create a new term based on this term as a pattern and a list of arguments.
protected  boolean match(ATerm pattern, java.util.List<java.lang.Object> list)
           
(package private)  boolean matchArguments(ATerm[] pattern_args, java.util.List<java.lang.Object> list)
           
private  java.lang.Object[] serialize()
           
 ATerm setAnnotations(ATermList annos)
          Sets all annotations of this term.
 ATermAppl setArgument(ATerm newarg, int index)
          Sets a specific argument of this application.
 ATerm setSubTerm(int index, ATerm t)
           
private static int staticDoobs_hashFuntion(java.lang.Object[] o)
           
 
Methods inherited from class aterm.pure.ATermImpl
equals, getAnnotation, getAnnotations, getFactory, getPureFactory, getUniqueIdentifier, hasAnnotations, hashCode, init, internSetAnnotations, isEqual, match, match, removeAnnotation, removeAnnotations, setAnnotation, setHashCode, setUniqueIdentifier, toString, writeToSharedTextFile, writeToTextFile, writeToTextFile
 
Methods inherited from class aterm.pure.ATermVisitableImpl
getChildAt, getChildCount, setChildAt
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface aterm.ATerm
equals, getAnnotation, getAnnotations, getFactory, hasAnnotations, hashCode, isEqual, match, match, removeAnnotation, removeAnnotations, setAnnotation, toString, writeToSharedTextFile, writeToTextFile
 
Methods inherited from interface jjtraveler.Visitable
getChildAt, getChildCount, setChildAt
 
Methods inherited from interface aterm.Identifiable
getUniqueIdentifier
 

Field Detail

fun

private AFun fun

args

private ATerm[] args
Constructor Detail

ATermApplImpl

protected ATermApplImpl(PureFactory factory)
Parameters:
factory -

ATermApplImpl

protected ATermApplImpl(PureFactory factory,
                        ATermList annos,
                        AFun fun,
                        ATerm[] i_args)
Method Detail

getType

public int getType()
Description copied from interface: ATerm
Gets the type of this term.

Specified by:
getType in interface ATerm
Returns:
the type of this ATerm.
See Also:
ATerm.INT, ATerm.REAL, ATerm.APPL, ATerm.LIST, ATerm.PLACEHOLDER, ATerm.BLOB, ATerm.AFUN, ATerm.LONG

init

protected void init(int hashCode,
                    ATermList annos,
                    AFun fun,
                    ATerm[] i_args)
Parameters:
hashCode -
annos -
fun -
i_args -

initHashCode

protected void initHashCode(ATermList annos,
                            AFun fun,
                            ATerm[] i_args)
Parameters:
annos -
fun -
i_args -

duplicate

public shared.SharedObject duplicate()
Specified by:
duplicate in interface shared.SharedObject

make

protected ATermAppl make(AFun fun,
                         ATerm[] i_args,
                         ATermList annos)

make

protected ATermAppl make(AFun fun,
                         ATerm[] i_args)

equivalent

public boolean equivalent(shared.SharedObject obj)
Specified by:
equivalent in interface shared.SharedObject

match

protected boolean match(ATerm pattern,
                        java.util.List<java.lang.Object> list)
Overrides:
match in class ATermImpl

matchArguments

boolean matchArguments(ATerm[] pattern_args,
                       java.util.List<java.lang.Object> list)

getArgumentArray

public ATerm[] getArgumentArray()
Description copied from interface: ATermAppl
Gets the arguments of this application as an array of ATerm objects.

Specified by:
getArgumentArray in interface ATermAppl
Returns:
an array containing all arguments of this application.

getAFun

public AFun getAFun()
Description copied from interface: ATermAppl
Gets the AFun object that represents the function symbol of this application

Specified by:
getAFun in interface ATermAppl
Returns:
the function symbol of this application.

getArguments

public ATermList getArguments()
Description copied from interface: ATermAppl
Gets the arguments of this application.

Specified by:
getArguments in interface ATermAppl
Returns:
a list containing all arguments of this application.

getArgument

public ATerm getArgument(int index)
Description copied from interface: ATermAppl
Gets a specific argument of this application.

Specified by:
getArgument in interface ATermAppl
Parameters:
index - the index of the argument to be retrieved.
Returns:
the ith argument of the application.

setArgument

public ATermAppl setArgument(ATerm newarg,
                             int index)
Description copied from interface: ATermAppl
Sets a specific argument of this application.

Specified by:
setArgument in interface ATermAppl
Parameters:
newarg - the new ith argument.
index - the index of the argument to be set.
Returns:
a copy of this application with argument i replaced by arg.

isQuoted

public boolean isQuoted()
Description copied from interface: ATermAppl
Checks if this application is quoted. A quoted application looks like this: "foo", whereas an unquoted looks like this: foo.

Specified by:
isQuoted in interface ATermAppl
Returns:
true if this application is quoted, false otherwise.

getName

public java.lang.String getName()
Description copied from interface: ATermAppl
Gets the function name of this application.

Specified by:
getName in interface ATermAppl
Returns:
the function name of this application.

getArity

public int getArity()
Description copied from interface: ATermAppl
Gets the arity of this application. Arity is the number of arguments of a function application.

Specified by:
getArity in interface ATermAppl
Returns:
the number of arguments of this application.

make

public ATerm make(java.util.List<java.lang.Object> arguments)
Description copied from interface: ATerm
Create a new term based on this term as a pattern and a list of arguments.

Specified by:
make in interface ATerm
Overrides:
make in class ATermImpl
Parameters:
arguments - the list of arguments used to fill up holes in the pattern
Returns:
the constructed aterm

setAnnotations

public ATerm setAnnotations(ATermList annos)
Description copied from interface: ATerm
Sets all annotations of this term.

Specified by:
setAnnotations in interface ATerm
Parameters:
annos - the annotations to set.
Returns:
a new version of this term with the requested annotations.
See Also:
ATerm.getAnnotations()

accept

public Visitable accept(Visitor v)
                 throws jjtraveler.VisitFailure
Throws:
jjtraveler.VisitFailure

getNrSubTerms

public int getNrSubTerms()
Overrides:
getNrSubTerms in class ATermImpl

getSubTerm

public ATerm getSubTerm(int index)
Overrides:
getSubTerm in class ATermImpl

setSubTerm

public ATerm setSubTerm(int index,
                        ATerm t)
Overrides:
setSubTerm in class ATermImpl

serialize

private java.lang.Object[] serialize()

hashFunction

protected int hashFunction()

staticDoobs_hashFuntion

private static int staticDoobs_hashFuntion(java.lang.Object[] o)

The Meta-Environment API