01: /*
02: * Copyright (C) 1999-2004 <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</a>
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18: package org.mandarax.kernel;
19:
20: /**
21: * Constant terms are like individuals in formal logic. A constant term is a kind of wrapper
22: * around a certain object. By default, the class of the object is the type of this constant term.
23: * The type can also be set using the <code>setType()</code> method, e.g. in case the class of the object is
24: * a private implementation class but the type should be the public interface it implements.
25: * If the object and the type are not consistent (i.e., if the object is not an instance of the
26: * type), an illegal argument exception is throws.<p>
27: * Since this objects can also be facts, terms etc., higher level predicate logic
28: * can be expressed.
29: * @see org.mandarax.kernel.VariableTerm
30: * @see org.mandarax.kernel.ComplexTerm
31: * @author <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</A>
32: * @version 3.4 <7 March 05>
33: * @since 1.0
34: */
35: public interface ConstantTerm extends Term {
36:
37: /**
38: * Get the object.
39: * @return the object wrapped by this term
40: */
41: public Object getObject();
42:
43: /**
44: * Set the object.
45: * @param obj the object
46: * @throws an illegal argument exception is thrown if the object is not an instance of
47: * the type previously set using setType()
48: */
49: public void setObject(Object obj);
50:
51: /**
52: * Set the type.
53: * @param type the type
54: * @throws an illegal argument exception is thrown if the object previously set using setObject() is not an instance of
55: * the type
56: */
57: public void setType(Class type);
58: }
|