AbstractTerm.java from Texai at Krugle
Show AbstractTerm.java syntax highlighted
/*
* AbstractTerm.java
*
* Created on March 23, 2007, 2:48 PM
*
* Description: AbstractTerm is a logical term in the Texai logical representation language.
*
* Copyright (C) 2007 Stephen L. Reed.
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program;
* if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.texai.kb.entity;
import com.sleepycat.persist.model.Persistent;
import com.sleepycat.persist.model.PrimaryKey;
import org.texai.kb.ejb.session.shared.KBPartitionFacadeLocal;
/**
*
* @author reed
*/
@Persistent
public abstract class AbstractTerm {
/** the database term ID */
@PrimaryKey
private int termId; // NOPMD
/** Creates a new instance of AbstractTerm. */
public AbstractTerm() {
super();
}
/** Creates a new instance of AbstractTerm.
*
* @param termId the database term ID
*/
public AbstractTerm(final int termId) {
super();
//Preconditions
assert termId != 0 : "termId must not be zero";
this.termId = termId;
}
/** Gets the term type.
*
* @return the term type
*/
public abstract byte getTermType();
/** Gets the term ID of this Term.
*
* @return the term ID
*/
public int getTermId() {
return termId;
}
/** Returns a string representation of this object.
*
* @param kbPartitionFacade the KB partition facade
* @return a string representation of this object
*/
public abstract String toString(final KBPartitionFacadeLocal kbPartitionFacade);
/** Returns a CycL representation of this object.
*
* @param kbPartitionFacade the KB partition facade
* @return a CycL representation of this object
*/
public abstract String toCycLString(final KBPartitionFacadeLocal kbPartitionFacade);
}
See more files for this project here