Code Search for Developers
 
 
  

QuintaryGAF.java from Texai at Krugle


Show QuintaryGAF.java syntax highlighted

/*
 * QuintaryGAF.java
 *
 * Created on October 16, 2006, 1:13 AM
 *
 * Description: QuintaryGAF is an ground atomic formula having five arguments in the Texai logical representation language.
 *
 *
 * Copyright (C) 2006 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.ejb.entity;

import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Transient;
import org.texai.kb.Constants;

/**
 * Entity class QuintaryGAF
 *
 *
 * @author reed
 */
@Entity
@NamedQuery(name=Constants.QUERY_FIND_QUINTARY_GAF_BY_CONSTITUENTS,
 query="SELECT g FROM QuintaryGAF g, QuintaryGAFInfo gi WHERE gi.predicate = :predicate AND "
  + "gi.context = :context AND gi.arg1 = :arg1 AND gi.arg2 = :arg2 AND gi.arg3 = :arg3 AND gi.arg4 = :arg4 AND gi.arg5 = :arg5 AND "
  + "gi.quintaryGAF = g")
public class QuintaryGAF extends AbstractGAF {

  /**
   * Determines if a de-serialized file is compatible with this class.
   *
   * Maintainers must change this value if and only if the new version
   * of this class is not compatible with old versions. See Sun docs
   * for <a href=http://java.sun.com/products/jdk/1.1/docs/guide
   * /serialization/spec/version.doc.html> details. </a>
   *
   * Not necessary to include in first version of the class, but
   * included here as a reminder of its importance.
   */
  @Transient
  private static final long serialVersionUID = 1L;

  /** the quintary ground atomic formula information */
  @OneToOne(fetch=FetchType.LAZY, mappedBy = "quintaryGAF", cascade=CascadeType.ALL)
  private QuintaryGAFInfo quintaryGAFInfo;          // NOPMD

  /**
   * Creates a new instance of QuintaryGAF
   */
  public QuintaryGAF() {
    super();
  }

  /**
   * Creates a new instance of QuintaryGAF.
   *
   * @param predicate the predicate
   * @param args the arguments
   * @param context the context
   * @param strength the assertion strength
   * @param generatedPhrase the generated phrase for this ground atomic formula
   * @param creator the creator 
   * @param creationPurpose the creation purpose
   * @param creationTimePoint the creation time point
   */
  public QuintaryGAF(
          final AtomicTerm predicate,
          final List<AbstractTerm> args,
          final AbstractReifiedTerm context,
          final Double strength,
          final String generatedPhrase,
          final AbstractReifiedTerm creator,
          final AbstractReifiedTerm creationPurpose,
          final TimePoint creationTimePoint) {
    super();
    //Preconditions
    assert args != null : "args must not be null";
    assert args.size() == Constants.QUINTARY_ARGS_SIZE : "quintary GAF must have five arguments " + args.toString();

    quintaryGAFInfo = new QuintaryGAFInfo(
            this, 
            predicate, 
            args, 
            context, 
            strength, 
            generatedPhrase, 
            creator, 
            creationPurpose, 
            creationTimePoint);
  }

  /** Gets the quintary ground atomic formula information.
   *
   * @return quintary ground atomic formula information
   */
  public QuintaryGAFInfo getQuintaryGAFInfo() {
    return quintaryGAFInfo;
  }

  /** Gets the first argument
   *
   * @return the first argument
   */
  public AbstractTerm getArg1() {
    return getQuintaryGAFInfo().getArg1();
  }

  /** Gets the second argument
   *
   * @return the second argument
   */
  public AbstractTerm getArg2() {
    return getQuintaryGAFInfo().getArg2();
  }

  /** Gets the third argument
   *
   * @return the third argument
   */
  public AbstractTerm getArg3() {
    return getQuintaryGAFInfo().getArg3();
  }

  /** Gets the fourth argument
   *
   * @return the fourth argument
   */
  public AbstractTerm getArg4() {
    return getQuintaryGAFInfo().getArg4();
  }

  /** Gets the fifth argument
   *
   * @return the fifth argument
   */
  public AbstractTerm getArg5() {
    return getQuintaryGAFInfo().getArg5();
  }

  /** Gets the predicate.
   *
   * @return the predicate
   */
  public AtomicTerm getPredicate() {
    return getQuintaryGAFInfo().getPredicate();
  }

  /** Returns the arguments.
   *
   * @return the arguments
   */
  public List<AbstractTerm> getArgs() {
    return getQuintaryGAFInfo().getArgs();
  }

  /** Returns the assertion context (i.e. Cyc microtheory).
   *
   * @return the assertion context (i.e. Cyc microtheory)
   */
  public AbstractReifiedTerm getContext() {
    return getQuintaryGAFInfo().getContext();
  }

  /** Returns the generated phrase for this ground atomic formula.
   *
   * @return the generated phrase for this ground atomic formula
   */
  public String getGeneratedPhrase() {
    return getQuintaryGAFInfo().getGeneratedPhrase();
  }

  /** Sets the generated phrase for this ground atomic formula.
   *
   * @param generatedPhrase the generated natural language phrase
   */
  public void setGeneratedPhrase(final String generatedPhrase) {
    getQuintaryGAFInfo().setGeneratedPhrase(generatedPhrase);
  }

  /** Gets the assertion strength
   *
   * @return the assertion strength
   */
  public Double getStrength() {
    return getQuintaryGAFInfo().getStrength();
  }

  /** Sets the assertion strength.
   *
   * @param strength the assertion strength
   */
  public void setStrength(final Double strength) {
    getQuintaryGAFInfo().setStrength(strength);
  }

  /** Gets the creator.
   *
   * @return the creator
   */
  public AbstractReifiedTerm getCreator() {
    return getQuintaryGAFInfo().getCreator();
  }

  /** Gets the creation purpose.
   *
   * @return the creation purpose
   */
  public AbstractReifiedTerm getCreationPurpose() {
    return getQuintaryGAFInfo().getCreationPurpose();
  }

  /** Gets the creation time point.
   *
   * @return the creation time point
   */
  public TimePoint getCreationTimePoint() {
    return getQuintaryGAFInfo().getCreationTimePoint();
  }

  /** Returns a hash code value for the object.
   *
   * @return a hash code value for this object
   */
  @Override
  public int hashCode() {
    return getQuintaryGAFInfo().hashCode();
  }

  /**
   * Determines whether another object is equal to this object.
   *
   * @param object the reference object with which to compare
   * @return <code>true</code> if this object is the same as the argument;
   * <code>false</code> otherwise.
   */
  @Override
  public boolean equals(final Object object) {
    if (!(object instanceof QuintaryGAF)) {
      return false;
    }
    final QuintaryGAF that = (QuintaryGAF) object;
    return this.getQuintaryGAFInfo().equals(that.getQuintaryGAFInfo());
  }

  /** Returns a string representation of this object.
   *
   * @return a string representation of this object
   */
  @Override
  public String toString() {
    return getQuintaryGAFInfo().toString();
  }

  /** Returns a CycL representation of this object.
   *
   * @return a CycL representation of this object
   */
  public String toCycLString() {
    return getQuintaryGAFInfo().toCycLString();
  }
}




See more files for this project here

Texai

Texai is an chatbot that intelligently seeks to acquire knowledge and friendly behaviors.

Project homepage: http://sourceforge.net/projects/texai
Programming language(s): Java,Shell Script,XML
License: other

  AbstractGAF.java
  AbstractGAFInfo.java
  AbstractReifiedTerm.java
  AbstractTerm.java
  AtomicTerm.java
  AtomicTermInfo.java
  BinaryGAF.java
  BinaryGAFInfo.java
  Formula.java
  FormulaArgument.java
  FormulaInfo.java
  NonAtomicTerm.java
  NonAtomicTermInfo.java
  PBlob.java
  PBlobInfo.java
  PCharacter.java
  PCharacterInfo.java
  PClob.java
  PClobInfo.java
  PDate.java
  PDateInfo.java
  PDouble.java
  PDoubleInfo.java
  PLong.java
  PLongInfo.java
  PString.java
  PStringInfo.java
  PVariable.java
  PVariableInfo.java
  QuaternaryGAF.java
  QuaternaryGAFInfo.java
  QuintaryGAF.java
  QuintaryGAFInfo.java
  Rule.java
  RuleInfo.java
  Symbol.java
  SymbolInfo.java
  TernaryGAF.java
  TernaryGAFInfo.java
  TimePoint.java
  TimePointInfo.java
  UnaryGAF.java
  UnaryGAFInfo.java
  package.html