tom.engine.adt.il.types
Class AbsTerm

java.lang.Object
  extended by tom.engine.adt.il.IlAbstractType
      extended by tom.engine.adt.il.types.AbsTerm
All Implemented Interfaces:
Comparable, shared.SharedObject, shared.SharedObjectWithID, Visitable
Direct Known Subclasses:
absvar, sl, st

public abstract class AbsTerm
extends IlAbstractType


Field Summary
protected static IdConverter idConv
           
 
Fields inherited from class tom.engine.adt.il.IlAbstractType
atermFactory, factory
 
Constructor Summary
protected AbsTerm()
          Sole constructor.
 
Method Summary
static AbsTerm fromStream(InputStream stream)
          Returns a tom.engine.adt.il.types.AbsTerm from a Stream without any conversion
static AbsTerm fromStream(InputStream stream, ATermConverter atConv)
          Apply a conversion on the ATerm contained in the Stream and returns a tom.engine.adt.il.types.AbsTerm from it
static AbsTerm fromString(String s)
          Returns a tom.engine.adt.il.types.AbsTerm from a String without any conversion
static AbsTerm fromString(String s, ATermConverter atConv)
          Apply a conversion on the ATerm contained in the String and returns a tom.engine.adt.il.types.AbsTerm from it
static AbsTerm fromTerm(aterm.ATerm trm)
          Returns a tom.engine.adt.il.types.AbsTerm from an ATerm without any conversion
static AbsTerm fromTerm(aterm.ATerm trm, ATermConverter atConv)
          Apply a conversion on the ATerm and returns a tom.engine.adt.il.types.AbsTerm
 AbsTerm getAbst()
          Returns the subterm corresponding to the slot Abst
 int getIndex()
          Returns the subterm corresponding to the slot Index
 String getName()
          Returns the subterm corresponding to the slot Name
 Symbol getSymbol()
          Returns the subterm corresponding to the slot Symbol
 Variable getVarname()
          Returns the subterm corresponding to the slot Varname
 boolean isabsvar()
          Returns true if the term is rooted by the symbol absvar
 boolean issl()
          Returns true if the term is rooted by the symbol sl
 boolean isst()
          Returns true if the term is rooted by the symbol st
 int length()
          Returns the length of the list
 AbsTerm reverse()
          Returns an inverted term
 AbsTerm setAbst(AbsTerm _arg)
          Returns a new term where the subterm corresponding to the slot Abst is replaced by the term given in argument.
 AbsTerm setIndex(int _arg)
          Returns a new term where the subterm corresponding to the slot Index is replaced by the term given in argument.
 AbsTerm setName(String _arg)
          Returns a new term where the subterm corresponding to the slot Name is replaced by the term given in argument.
 AbsTerm setSymbol(Symbol _arg)
          Returns a new term where the subterm corresponding to the slot Symbol is replaced by the term given in argument.
 AbsTerm setVarname(Variable _arg)
          Returns a new term where the subterm corresponding to the slot Varname is replaced by the term given in argument.
 aterm.ATerm toATerm()
          Returns an ATerm representation of this term.
 
Methods inherited from class tom.engine.adt.il.IlAbstractType
compareTo, compareToLPO, convertATermToBoolean, convertATermToChar, convertATermToDouble, convertATermToFloat, convertATermToInt, convertATermToLong, convertATermToString, getUniqueIdentifier, setUniqueIdentifier, symbolName, toString, toStringBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface shared.SharedObject
duplicate, equivalent, hashCode
 
Methods inherited from interface tom.library.sl.Visitable
getChildAt, getChildCount, getChildren, setChildAt, setChildren
 

Field Detail

idConv

protected static IdConverter idConv
Constructor Detail

AbsTerm

protected AbsTerm()
Sole constructor. (For invocation by subclass constructors, typically implicit.)

Method Detail

isabsvar

public boolean isabsvar()
Returns true if the term is rooted by the symbol absvar

Returns:
true if the term is rooted by the symbol absvar

isst

public boolean isst()
Returns true if the term is rooted by the symbol st

Returns:
true if the term is rooted by the symbol st

issl

public boolean issl()
Returns true if the term is rooted by the symbol sl

Returns:
true if the term is rooted by the symbol sl

getIndex

public int getIndex()
Returns the subterm corresponding to the slot Index

Returns:
the subterm corresponding to the slot Index

setIndex

public AbsTerm setIndex(int _arg)
Returns a new term where the subterm corresponding to the slot Index is replaced by the term given in argument. Note that there is no side-effect: a new term is returned and the original term is left unchanged

Parameters:
_arg - the value of the new subterm
Returns:
a new term where the subterm corresponding to the slot Index is replaced by _arg

getName

public String getName()
Returns the subterm corresponding to the slot Name

Returns:
the subterm corresponding to the slot Name

setName

public AbsTerm setName(String _arg)
Returns a new term where the subterm corresponding to the slot Name is replaced by the term given in argument. Note that there is no side-effect: a new term is returned and the original term is left unchanged

Parameters:
_arg - the value of the new subterm
Returns:
a new term where the subterm corresponding to the slot Name is replaced by _arg

getAbst

public AbsTerm getAbst()
Returns the subterm corresponding to the slot Abst

Returns:
the subterm corresponding to the slot Abst

setAbst

public AbsTerm setAbst(AbsTerm _arg)
Returns a new term where the subterm corresponding to the slot Abst is replaced by the term given in argument. Note that there is no side-effect: a new term is returned and the original term is left unchanged

Parameters:
_arg - the value of the new subterm
Returns:
a new term where the subterm corresponding to the slot Abst is replaced by _arg

getSymbol

public Symbol getSymbol()
Returns the subterm corresponding to the slot Symbol

Returns:
the subterm corresponding to the slot Symbol

setSymbol

public AbsTerm setSymbol(Symbol _arg)
Returns a new term where the subterm corresponding to the slot Symbol is replaced by the term given in argument. Note that there is no side-effect: a new term is returned and the original term is left unchanged

Parameters:
_arg - the value of the new subterm
Returns:
a new term where the subterm corresponding to the slot Symbol is replaced by _arg

getVarname

public Variable getVarname()
Returns the subterm corresponding to the slot Varname

Returns:
the subterm corresponding to the slot Varname

setVarname

public AbsTerm setVarname(Variable _arg)
Returns a new term where the subterm corresponding to the slot Varname is replaced by the term given in argument. Note that there is no side-effect: a new term is returned and the original term is left unchanged

Parameters:
_arg - the value of the new subterm
Returns:
a new term where the subterm corresponding to the slot Varname is replaced by _arg

toATerm

public aterm.ATerm toATerm()
Returns an ATerm representation of this term.

Specified by:
toATerm in class IlAbstractType
Returns:
null to indicate to sub-classes that they have to work

fromTerm

public static AbsTerm fromTerm(aterm.ATerm trm)
Returns a tom.engine.adt.il.types.AbsTerm from an ATerm without any conversion

Parameters:
trm - ATerm to handle to retrieve a Gom term
Returns:
the term from the ATerm

fromString

public static AbsTerm fromString(String s)
Returns a tom.engine.adt.il.types.AbsTerm from a String without any conversion

Parameters:
s - String containing the ATerm
Returns:
the term from the String

fromStream

public static AbsTerm fromStream(InputStream stream)
                          throws IOException
Returns a tom.engine.adt.il.types.AbsTerm from a Stream without any conversion

Parameters:
stream - stream containing the ATerm
Returns:
the term from the Stream
Throws:
IOException - if a problem occurs with the stream

fromTerm

public static AbsTerm fromTerm(aterm.ATerm trm,
                               ATermConverter atConv)
Apply a conversion on the ATerm and returns a tom.engine.adt.il.types.AbsTerm

Parameters:
trm - ATerm to convert into a Gom term
atConv - ATermConverter used to convert the ATerm
Returns:
the Gom term
Throws:
IllegalArgumentException

fromString

public static AbsTerm fromString(String s,
                                 ATermConverter atConv)
Apply a conversion on the ATerm contained in the String and returns a tom.engine.adt.il.types.AbsTerm from it

Parameters:
s - String containing the ATerm
atConv - ATerm Converter used to convert the ATerm
Returns:
the Gom term

fromStream

public static AbsTerm fromStream(InputStream stream,
                                 ATermConverter atConv)
                          throws IOException
Apply a conversion on the ATerm contained in the Stream and returns a tom.engine.adt.il.types.AbsTerm from it

Parameters:
stream - stream containing the ATerm
atConv - ATerm Converter used to convert the ATerm
Returns:
the Gom term
Throws:
IOException

length

public int length()
Returns the length of the list

Returns:
the length of the list
Throws:
IllegalArgumentException - if the term is not a list

reverse

public AbsTerm reverse()
Returns an inverted term

Returns:
the inverted list
Throws:
IllegalArgumentException - if the term is not a list