1// BEGIN LICENSE BLOCK 2// Version: CMPL 1.1 3// 4// The contents of this file are subject to the Cisco-style Mozilla Public 5// License Version 1.1 (the "License"); you may not use this file except 6// in compliance with the License. You may obtain a copy of the License 7// at www.eclipse-clp.org/license. 8// 9// Software distributed under the License is distributed on an "AS IS" 10// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 11// the License for the specific language governing rights and limitations 12// under the License. 13// 14// The Original Code is The ECLiPSe Constraint Logic Programming System. 15// The Initial Developer of the Original Code is Cisco Systems, Inc. 16// Portions created by the Initial Developer are 17// Copyright (C) 2000 - 2006 Cisco Systems, Inc. All Rights Reserved. 18// 19// Contributor(s): Stefano Novello / Josh Singer, Parc Technologies 20// 21// END LICENSE BLOCK 22 23//Title: Java/ECLiPSe interface 24//Version: $Id: CompoundTerm.java,v 1.1 2006/09/23 01:54:08 snovello Exp $ 25//Author: Stefano Novello / Josh Singer 26//Company: Parc Technologies 27//Description: Java interface to represent an ECLiPSe compound term 28package com.parctechnologies.eclipse; 29 30/** 31 * Interface to describe an ECLiPSe compound term. 32 * An object that implements it must be able to supply a functor, an arity, 33 * and arguments. The arguments may be of any Java class which represents an 34 * ECLiPSe data. 35 * Compound terms converted from EXDR format using 36 * {@link EXDRInputStream} implement this 37 * interface. 38 * <p> 39 * A compound term like p(q(2),a,"b") has functor "p" and arity 3, arg(1) is the term q(2) 40 * arg(2) is the term 'a' and arg(3) is the Java String "b". 41 */ 42public interface CompoundTerm 43{ 44 /** 45 * Return the functor of the compound term. 46 */ 47 public String functor(); 48 49 /** 50 * Return the number of arguments. 51 */ 52 public int arity(); 53 54 /** 55 * Return the argument at position <code>i</code>. The returned object will 56 * instantiate the Java class/interface representing the corresponding ECLiPSe 57 * data type. 58 * @param i may vary between 1 and <code>arity()</code> 59 */ 60 public Object arg(int i); 61} 62