Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

alice.logictuple
Class LogicTuple  view LogicTuple download LogicTuple.java

java.lang.Object
  extended byalice.logictuple.LogicTuple
All Implemented Interfaces:
java.io.Serializable, alice.tuplemedium.Tuple, alice.tuplemedium.TupleTemplate

public class LogicTuple
extends java.lang.Object
implements alice.tuplemedium.Tuple, alice.tuplemedium.TupleTemplate, java.io.Serializable

Defines the communication language based on logic tuples, which stand both for tuple and tuple template For logic tuple, the matching is the classic prolog matching and the propagation corresponds to unification. A logic tuple is like a Prolog term, usually a Prolog structure characterized by a name and 0 or more argument (which in this case are objects of the class TupleArgument)

Version:
1.0

Field Summary
private  TupleArgument info
          the information content of logic tuple
 
Constructor Summary
LogicTuple()
           
LogicTuple(java.lang.String name)
          Constructs the logic tuple providing the tuple name, without arguments
LogicTuple(java.lang.String name, TupleArgument t1)
          Constructs the logic tuple providing the tuple name and one argument
LogicTuple(java.lang.String name, TupleArgument[] list)
          Constructs the logic tuple providing the tuple name and argument list
LogicTuple(java.lang.String name, TupleArgument t1, TupleArgument t2)
          Constructs the logic tuple providing the tuple name and two arguments
LogicTuple(java.lang.String name, TupleArgument t1, TupleArgument t2, TupleArgument t3)
          Constructs the logic tuple providing the tuple name and three arguments
LogicTuple(java.lang.String name, TupleArgument t1, TupleArgument t2, TupleArgument t3, TupleArgument t4)
          Constructs the logic tuple providing the tuple name and four arguments
LogicTuple(java.lang.String name, TupleArgument t1, TupleArgument t2, TupleArgument t3, TupleArgument t4, TupleArgument t5)
          Constructs the logic tuple providing the tuple name and five arguments
LogicTuple(java.lang.String name, TupleArgument t1, TupleArgument t2, TupleArgument t3, TupleArgument t4, TupleArgument t5, TupleArgument t6)
          Constructs the logic tuple providing the tuple name and six arguments
LogicTuple(java.lang.String name, TupleArgument t1, TupleArgument t2, TupleArgument t3, TupleArgument t4, TupleArgument t5, TupleArgument t6, TupleArgument t7)
          Constructs the logic tuple providing the tuple name and seven arguments
LogicTuple(alice.tuprolog.Term t)
          Constructs the logic tuple from a tuprolog term
LogicTuple(TupleArgument t)
          Constructs the logic tuple from a tuple argument (it's the most free form of construction)
 
Method Summary
 TupleArgument getArg(int index)
          Gets a argument inside the logic tuple
 int getArity()
          Gets the number of argument of the logic tuple
 float getFloat(int index)
          Helper service to get directly a float argument inside the logic tuple
 int getInt(int index)
          Helper service to get directly an integer argument inside the logic tuple
 java.lang.String getName()
          Gets the name of the logic tuple
 java.lang.String getString(int index)
          Helper service to get directly a string argument inside the logic tuple
 boolean match(alice.tuplemedium.Tuple t)
          Specifies if a logic tuple (as a tuple template) matches with a specified tuple, typically an other logic tuple
static LogicTuple parse(java.lang.String st)
          Static service to get a Logic tuple from a textual representation
 boolean propagate(alice.tuplemedium.Tuple t)
          Tries to unify a logic tuple (as a tuple template) with a specified tuple, typically an other logic tuple
 java.lang.String toString()
          Gets the string representation of the logic tuple
 alice.tuprolog.Term toTerm()
          Gets the Term representation of the logic tuple
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

info

private TupleArgument info
the information content of logic tuple

Constructor Detail

LogicTuple

public LogicTuple(java.lang.String name,
                  TupleArgument[] list)
Constructs the logic tuple providing the tuple name and argument list


LogicTuple

public LogicTuple(java.lang.String name)
Constructs the logic tuple providing the tuple name, without arguments


LogicTuple

public LogicTuple(java.lang.String name,
                  TupleArgument t1)
Constructs the logic tuple providing the tuple name and one argument


LogicTuple

public LogicTuple(java.lang.String name,
                  TupleArgument t1,
                  TupleArgument t2)
Constructs the logic tuple providing the tuple name and two arguments


LogicTuple

public LogicTuple(java.lang.String name,
                  TupleArgument t1,
                  TupleArgument t2,
                  TupleArgument t3)
Constructs the logic tuple providing the tuple name and three arguments


LogicTuple

public LogicTuple(java.lang.String name,
                  TupleArgument t1,
                  TupleArgument t2,
                  TupleArgument t3,
                  TupleArgument t4)
Constructs the logic tuple providing the tuple name and four arguments


LogicTuple

public LogicTuple(java.lang.String name,
                  TupleArgument t1,
                  TupleArgument t2,
                  TupleArgument t3,
                  TupleArgument t4,
                  TupleArgument t5)
Constructs the logic tuple providing the tuple name and five arguments


LogicTuple

public LogicTuple(java.lang.String name,
                  TupleArgument t1,
                  TupleArgument t2,
                  TupleArgument t3,
                  TupleArgument t4,
                  TupleArgument t5,
                  TupleArgument t6)
Constructs the logic tuple providing the tuple name and six arguments


LogicTuple

public LogicTuple(java.lang.String name,
                  TupleArgument t1,
                  TupleArgument t2,
                  TupleArgument t3,
                  TupleArgument t4,
                  TupleArgument t5,
                  TupleArgument t6,
                  TupleArgument t7)
Constructs the logic tuple providing the tuple name and seven arguments


LogicTuple

public LogicTuple(TupleArgument t)
Constructs the logic tuple from a tuple argument (it's the most free form of construction)


LogicTuple

public LogicTuple(alice.tuprolog.Term t)
Constructs the logic tuple from a tuprolog term


LogicTuple

public LogicTuple()
Method Detail

getArity

public int getArity()
Gets the number of argument of the logic tuple


getName

public java.lang.String getName()
Gets the name of the logic tuple


getArg

public TupleArgument getArg(int index)
Gets a argument inside the logic tuple


getString

public java.lang.String getString(int index)
Helper service to get directly a string argument inside the logic tuple


getInt

public int getInt(int index)
Helper service to get directly an integer argument inside the logic tuple


getFloat

public float getFloat(int index)
Helper service to get directly a float argument inside the logic tuple


toTerm

public alice.tuprolog.Term toTerm()
Gets the Term representation of the logic tuple


toString

public java.lang.String toString()
Gets the string representation of the logic tuple


match

public boolean match(alice.tuplemedium.Tuple t)
Specifies if a logic tuple (as a tuple template) matches with a specified tuple, typically an other logic tuple

Specified by:
match in interface alice.tuplemedium.TupleTemplate

propagate

public boolean propagate(alice.tuplemedium.Tuple t)
Tries to unify a logic tuple (as a tuple template) with a specified tuple, typically an other logic tuple

Specified by:
propagate in interface alice.tuplemedium.TupleTemplate

parse

public static LogicTuple parse(java.lang.String st)
                        throws InvalidLogicTupleException
Static service to get a Logic tuple from a textual representation