Code Search for Developers
 
 
  

TimePointInfo.java from Texai at Krugle


Show TimePointInfo.java syntax highlighted

/*
 * TimePointInfo.java
 *
 * Created on October 24, 2006, 1:44 PM
 *
 * Description: Contains the specialized fields for TimePoint.
 *
 * 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.io.Serializable;
import java.sql.Timestamp;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Transient;

/**
 * Entity class TimePointInfo
 *
 * @author reed
 */
@Entity
public class TimePointInfo implements Serializable {

  /**
   * 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 id */
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private Long timePointInfoId;           // NOPMD

  /** the time point */
  @OneToOne
  private TimePoint timePoint;            // NOPMD

  /** the time point value*/
  @Basic
  private Timestamp timePointValue;       // NOPMD

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

  /** Creates a new instance of TimePointInfo.
   *
   * @param timePoint the time point
   * @param timePointValue the time point value
   */
  public TimePointInfo(final TimePoint timePoint, final Timestamp timePointValue) {
    super();
    //Preconditions
    assert timePoint != null : "timePoint must not be null";
    assert timePointValue != null : "timePointValue must not be null";

    this.timePoint = timePoint;
    this.timePointValue = timePointValue;
  }

  /**
   * Gets the id of this TimePointInfo.
   *
   * @return the id
   */
  public Long getTimePointInfoId() {
    return this.timePointInfoId;
  }

  /** Gets the time point
   *
   * @return the time point
   */
  public Timestamp getTimePointValue() {
    return timePointValue;
  }

  /**
   * Returns a hash code value for the object.  This implementation computes
   * a hash code value based on the unchanging timePointValue.
   *
   * @return a hash code value for this object
   */
  @Override
  public int hashCode() {
    return timePointValue.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 TimePointInfo)) {
      return false;
    }
    final TimePointInfo that = (TimePointInfo) object;
    return this.timePointValue.equals(that.timePointValue);
  }

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

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

  /** gets the time point
   *
   * @return the time point
   */
  public TimePoint getTimePoint() {
    return timePoint;
  }

}




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