Cell
Keywords: uk.ac.bbk.dcs.automed.qproc.Cell class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uk.ac.bbk.dcs.automed.qproc
Class Cell

    java.lang.Object
      uk.ac.bbk.dcs.automed.qproc.Cell

    public class Cell

extends java.lang.Object

Every node in an ASG is a Cell, so one has to use this class in order to perform any operations on an ASG

Field Summary
`static int` | `ANNOTATION_COMP_ARG`
`static int` | `ANNOTATION_COMP_ROOT`
`static int` | `ANNOTATION_NEITHER`
`static int` | `ANNOTATION_UNKNOWN`
`static int` | `apply`
`static int` | `constant`
`static int` | `constructor`
`static int` | `function`
`static int` | `lambda`
`static int` | `scheme`
`static int` | `special`
`static int` | `sysvariable`
`static int` | `variable`

Constructor Summary
`Cell(int snum, java.lang.Object sdata)`
`Cell(int snum, java.lang.Object lRef, java.lang.Object rRef)`
`Cell(int snum, java.lang.Object lRef, java.lang.Object rRef, java.lang.Object sdata)`
`Cell(java.lang.Object lRef, java.lang.Object rRef)`
`Cell(java.lang.String sdata)`

Method Summary
`Cell` | `copyOfGraph()` Returns an exact copy of the ASG
`java.lang.Object` | `data()` Returns the Object contained in the Cell
`int` | `getAnnotation()`
`double` | `getDouble()` Returns the value of the double contained in the Cell
`boolean` | `isApply()` Returns true if tag is apply
`boolean` | `isConsConstructor()` Returns true if tag is "Cons"
`boolean` | `isConstant()` Returns true if tag is constant
`boolean` | `isConstructor()` Returns true if tag is constructor
`boolean` | `isFunction()` Returns true if tag is function
`boolean` | `isLambda()` Returns true if tag is lambda
`boolean` | `isNilConstructor()` Returns true if tag is "Nil"
`boolean` | `isNum()` Returns true if the Cell contains a double
`boolean` | `isScheme()` Returns true if tag is scheme
`boolean` | `isSpecial()` Returns true if tag is special
`boolean` | `isSysVariable()` Returns true if tag is sysvariable
`boolean` | `isVariable()` Returns true if tag is variable
`Cell` | `l()` Returns a reference to the left child of the Cell
`void` | `mimicThisCell(Cell n)` Returns an exact copy of the input Cell.
`boolean` | `newScope()`
`Cell` | `r()` Returns a reference to the right child of the Cell
`boolean` | `representsComprehension()` Returns true if the Cell is the root of an ASG representing a comprehension
`boolean` | `representsFunction(java.lang.String function, int argNum)`
`boolean` | `representsGenerator()` Returns true if the Cell is the root of an ASG representing a generator
`boolean` | `representsList()` Returns true if the Cell is the root of an ASG representing a list
`boolean` | `representsPair()` Returns true if tag is "Tuple2"
`boolean` | `representsSingleton()`
`boolean` | `representsTuple()` Returns true if the Cell is the root of an ASG representing a Tuple
`void` | `set_l(Cell n)` Sets the reference to the left child of the Cell to n
`void` | `set_r(Cell n)` Sets the reference to the left child of the Cell to n
`void` | `setAnnotation(int annotation)`
`void` | `setCellNil()` set the cell itself a Nil Cell
`void` | `setData(java.lang.Object newData)` Sets the Cell's data
`void` | `setNewScope()`
`Cell` | `singleton()` Returns the root of an ASG representing an empty list
`int` | `tag()` Returns the Cell's tag
`java.lang.String` | `text()` Returns the string representation of the object contained in the Cell

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### apply

    public static int apply

### lambda

    public static int lambda

### constant

    public static int constant

### scheme

    public static int scheme

### constructor

    public static int constructor

### variable

    public static int variable

### function

    public static int function

### special

    public static int special

### sysvariable

    public static int sysvariable

### ANNOTATION_UNKNOWN

    public static final int ANNOTATION_UNKNOWN

See Also:
  Constant Field Values

### ANNOTATION_COMP_ROOT

    public static final int ANNOTATION_COMP_ROOT

See Also:
  Constant Field Values

### ANNOTATION_COMP_ARG

    public static final int ANNOTATION_COMP_ARG

See Also:
  Constant Field Values

### ANNOTATION_NEITHER

    public static final int ANNOTATION_NEITHER

See Also:
  Constant Field Values

Constructor Detail

### Cell

    public Cell(int snum,
                java.lang.Object lRef,
                java.lang.Object rRef,
                java.lang.Object sdata)

Parameters:
  `snum` - designates the type of the Cell. Possible values: apply, lambda, constant, identifier, scheme, constructor, variable, function, special, sysvariable
  `lRef` - reference to the Cell's left child
  `rRef` - reference to the Cell's right child
  `sdata` - Object container, whose value depends on snum. Possible values: apply:null, lambda:lambda, constant:(integer, String, ...), scheme:(String), constructor:(String, for example Cons, Tuple2, ...), variable:(String, e.g. x, y, ...), function:(function name), special:Let, sysvariable:(wrapper object)

### Cell

    public Cell(int snum,
                java.lang.Object lRef,
                java.lang.Object rRef)

### Cell

    public Cell(int snum,
                java.lang.Object sdata)

### Cell

    public Cell(java.lang.Object lRef,
                java.lang.Object rRef)

### Cell

    public Cell(java.lang.String sdata)

Method Detail

### text

    public java.lang.String text()

  Returns the string representation of the object contained in the Cell

### data

    public java.lang.Object data()

  Returns the Object contained in the Cell

### isNum

    public boolean isNum()

  Returns true if the Cell contains a double

### getDouble

    public double getDouble()

  Returns the value of the double contained in the Cell

### tag

    public int tag()

  Returns the Cell's tag

### l

    public Cell l()

  Returns a reference to the left child of the Cell

### r

    public Cell r()

  Returns a reference to the right child of the Cell

### set_l

    public void set_l(Cell n)

  Sets the reference to the left child of the Cell to n

### set_r

    public void set_r(Cell n)

  Sets the reference to the left child of the Cell to n

### setData

    public void setData(java.lang.Object newData)

  Sets the Cell's data

### mimicThisCell

    public void mimicThisCell(Cell n)

  Returns an exact copy of the input Cell.

### copyOfGraph

    public Cell copyOfGraph()

  Returns an exact copy of the ASG

### singleton

    public Cell singleton()

  Returns the root of an ASG representing an empty list

### isApply

    public boolean isApply()

  Returns true if tag is apply

### isLambda

    public boolean isLambda()

  Returns true if tag is lambda

### isConstant

    public boolean isConstant()

  Returns true if tag is constant

### isScheme

    public boolean isScheme()

  Returns true if tag is scheme

### isConstructor

    public boolean isConstructor()

  Returns true if tag is constructor

### isVariable

    public boolean isVariable()

  Returns true if tag is variable

### isSpecial

    public boolean isSpecial()

  Returns true if tag is special

### isFunction

    public boolean isFunction()

  Returns true if tag is function

### isSysVariable

    public boolean isSysVariable()

  Returns true if tag is sysvariable

### isNilConstructor

    public boolean isNilConstructor()

  Returns true if tag is "Nil"

### isConsConstructor

    public boolean isConsConstructor()

  Returns true if tag is "Cons"

### representsComprehension

    public boolean representsComprehension()

  Returns true if the Cell is the root of an ASG representing a comprehension

### representsGenerator

    public boolean representsGenerator()

  Returns true if the Cell is the root of an ASG representing a generator

### representsPair

    public boolean representsPair()

  Returns true if tag is "Tuple2"

### representsTuple

    public boolean representsTuple()

  Returns true if the Cell is the root of an ASG representing a Tuple

### representsList

    public boolean representsList()

  Returns true if the Cell is the root of an ASG representing a list

### representsSingleton

    public boolean representsSingleton()

### setNewScope

    public void setNewScope()

### newScope

    public boolean newScope()

### setAnnotation

    public void setAnnotation(int annotation)
                       throws java.lang.Exception

  Parameters:
    `annotation` - sets the annotation for this cell
  Throws:
    `java.lang.Exception`

### getAnnotation

    public int getAnnotation()

  Returns:
    the annotation of this cell

### representsFunction

    public boolean representsFunction(java.lang.String function,
                                      int argNum)

  Parameters:
    `function` - the textual representation of a function name, such as (++), (--), "member", ect.
  Returns:
    true, if this is an apply cell containing the function specified by the input string

### setCellNil

    public void setCellNil()

  set the cell itself a Nil Cell

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD