org.nuin.ks.values
Interface KsTerm

All Superinterfaces:
KsIdentifier, KsNamedArgs, KsValue
All Known Subinterfaces:
KsAction, KsEvent, KsMessage
All Known Implementing Classes:
KsActionImp, KsEventImp, KsMessageImp, RDFAction, RDFEvent, RDFMessage, RDFTerm

public interface KsTerm
extends KsNamedArgs, KsIdentifier

Interface that encapsulates an n-ary term from a knowledge source.

Version:
Release 0.4.0 (build 50) ($Id: KsTerm.java,v 1.8 2005/02/14 15:18:36 ian_dickinson Exp $)
Author:
Ian Dickinson, HP Labs (email)

Method Summary
 KsValue getArg(int i)
          Answer the i'th argument of the term
 int getArity()
          Answer the arity for this term.
 KsSymbol getFunctor()
          Answer the functor of the term as a string
 KsList getPositionalArgsList()
          Answer a KsList of the positional arguments of this term.
 java.util.List listArgs()
           Answer a list of the arguments of this term
 
Methods inherited from interface org.nuin.ks.values.KsNamedArgs
asMap, getArg, getArg, getNamedArgsList, hasArg, hasArg, initialise, listNamedArgs, setArg, setArg
 
Methods inherited from interface org.nuin.ks.values.KsValue
canHaveURI, getURI, isAction, isAnonymous, isCollection, isConst, isEvent, isGround, isList, isMessage, isMetaValue, isSymbol, isTerm, isVar, listVariables, substitute
 
Methods inherited from interface org.nuin.ks.values.KsIdentifier
asTerm, getSymbol
 
Methods inherited from interface org.nuin.ks.values.KsValue
canHaveURI, getURI, isAction, isAnonymous, isCollection, isConst, isEvent, isGround, isList, isMessage, isMetaValue, isSymbol, isTerm, isVar, listVariables, substitute
 

Method Detail

getArity

int getArity()
Answer the arity for this term.

Returns:
The number of arguments that this term has

getArg

KsValue getArg(int i)

Answer the i'th argument of the term

Parameters:
i - The index of the required argument.
Returns:
Argument i of the term, starting from zero.
Throws:
Throws - IndexOutOfBoundsException if i is out of range (i < 0 || i >= getArity())

getFunctor

KsSymbol getFunctor()
Answer the functor of the term as a string

Returns:
The term functor

listArgs

java.util.List listArgs()

Answer a list of the arguments of this term

Returns:
The arguments of the term as a list of KsValues

getPositionalArgsList

KsList getPositionalArgsList()

Answer a KsList of the positional arguments of this term.

Returns:
A KsList, whose length is the arity of this term, and whose members are the fixed arguments in order.


Copyright ©2002-2006 Hewlett-Packard Development Company, LP. All Rights Reserved.