JSHOP2
Class TaskAtom

java.lang.Object
  extended by JSHOP2.CompileTimeObject
      extended by JSHOP2.TaskAtom

public class TaskAtom
extends CompileTimeObject

Each task atom both at compile time and at run time is represented as an object of this class.

Version:
1.0.3
Author:
Okhtay Ilghami, http://www.cs.umd.edu/~okhtay

Field Summary
private  Predicate head
          The task atom itself.
private  boolean immediate
          Whether or not this task atom is marked :immediate.
private  boolean primitive
          Whether this task atom is a primitive one.
 
Fields inherited from class JSHOP2.CompileTimeObject
endl
 
Constructor Summary
TaskAtom(Predicate headIn, boolean immediateIn, boolean primitiveIn)
          To initialize this task atom.
 
Method Summary
 TaskAtom bind(Term[] binding)
          To calculate the result of applying a given binding to this task atom.
 Predicate getHead()
          To get the head of this task atom.
 boolean isImmediate()
          To check if this task atom is marked :immediate.
 boolean isPrimitive()
          To check if this task atom is primitive.
 void print()
          This function is used to print this task atom.
 java.lang.String toCode()
          This function produces Java code to create this task atom.
 java.lang.String toString()
          This function is used to produce a printable String showing the value of this task atom.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

head

private Predicate head
The task atom itself.


immediate

private boolean immediate
Whether or not this task atom is marked :immediate.


primitive

private boolean primitive
Whether this task atom is a primitive one.

Constructor Detail

TaskAtom

public TaskAtom(Predicate headIn,
                boolean immediateIn,
                boolean primitiveIn)
To initialize this task atom.

Parameters:
headIn - the task atom itself.
immediateIn - whether or not this task atom is marked :immediate.
primitiveIn - whether or not this task atom is a primitive one.
Method Detail

bind

public TaskAtom bind(Term[] binding)
To calculate the result of applying a given binding to this task atom.

Parameters:
binding - the binding to be applied.
Returns:
the result of the binding.

getHead

public Predicate getHead()
To get the head of this task atom.

Returns:
the head of this task atom.

isImmediate

public boolean isImmediate()
To check if this task atom is marked :immediate.

Returns:
true if the task atom is marked :immediate, false otherwise.

isPrimitive

public boolean isPrimitive()
To check if this task atom is primitive.

Returns:
true if the task atom is primitive, false otherwise.

print

public void print()
This function is used to print this task atom.


toCode

public java.lang.String toCode()
This function produces Java code to create this task atom.

Specified by:
toCode in class CompileTimeObject
Returns:
the produced code as a String.

toString

public java.lang.String toString()
This function is used to produce a printable String showing the value of this task atom.

Overrides:
toString in class java.lang.Object
Returns:
the printable String that shows the value of this task atom.