net.trialpc.sticktools.model
クラス BaseSentence

java.lang.Object
  上位を拡張 net.trialpc.sticktools.model.AbstractLangModel
      上位を拡張 net.trialpc.sticktools.model.BaseModel
          上位を拡張 net.trialpc.sticktools.model.BaseSentence
すべての実装されたインタフェース:
java.io.Serializable, java.lang.Comparable<SentenceModel>, LangModel, SentenceModel, StateChangeObservable

public class BaseSentence
extends BaseModel
implements SentenceModel, StateChangeObservable, java.lang.Comparable<SentenceModel>, java.io.Serializable

基本となる文モデルのクラスです。

作成者:
tetsu
関連項目:
SentenceModel, 直列化された形式

フィールドの概要
 
クラス net.trialpc.sticktools.model.BaseModel から継承されたフィールド
listeners
 
コンストラクタの概要
BaseSentence(java.lang.String id)
          文 ID を指定して BaseSentence インスタンスを生成します。
 
メソッドの概要
 int compareTo(SentenceModel o)
          文 ID に対して昇順になるような自然順序付けを提供します。
 boolean equals(java.lang.Object o)
          言語モデルが同一であるかを返します。
 java.lang.String getSentenceId()
          文の ID を返します。
 int hashCode()
          ハッシュコードを返します。
static BaseSentence unmodifiableSentence(BaseSentence s)
          変更不可能な BaseSentence インスタンスを返します。
 
クラス net.trialpc.sticktools.model.BaseModel から継承されたメソッド
addListener, addTerm, addTerms, castCollection, castMap, getTerms, getVocabulary, isEmpty, notify, numOfTerms, numOfVocabulary, setTerms, termCount, toString
 
クラス net.trialpc.sticktools.model.AbstractLangModel から継承されたメソッド
containsTerm, containsTerms, contaisQueries, isModifiable, termFrequency
 
クラス java.lang.Object から継承されたメソッド
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
インタフェース net.trialpc.sticktools.model.LangModel から継承されたメソッド
containsTerm, containsTerms, getVocabulary, isModifiable, numOfTerms, numOfVocabulary, termCount, termFrequency
 
インタフェース net.trialpc.sticktools.model.StateChangeObservable から継承されたメソッド
addListener
 

コンストラクタの詳細

BaseSentence

public BaseSentence(java.lang.String id)
文 ID を指定して BaseSentence インスタンスを生成します。

パラメータ:
id - 文 ID
メソッドの詳細

getSentenceId

public java.lang.String getSentenceId()
インタフェース SentenceModel の記述:
文の ID を返します。

定義:
インタフェース SentenceModel 内の getSentenceId
戻り値:
文 ID

unmodifiableSentence

public static BaseSentence unmodifiableSentence(BaseSentence s)
変更不可能な BaseSentence インスタンスを返します。

パラメータ:
s - 変更不可能なインスタンスの基となるインスタンス
戻り値:
変更不可能なインスタンス
例外:
java.lang.NullPointerException - s が null の場合

hashCode

public int hashCode()
クラス BaseModel の記述:
ハッシュコードを返します。

オーバーライド:
クラス BaseModel 内の hashCode
戻り値:
ハッシュコード

equals

public boolean equals(java.lang.Object o)
クラス BaseModel の記述:
言語モデルが同一であるかを返します。

オーバーライド:
クラス BaseModel 内の equals
パラメータ:
o - 比較対象のインスタンス
戻り値:
同一の言語モデルであれば true

compareTo

public int compareTo(SentenceModel o)

文 ID に対して昇順になるような自然順序付けを提供します。

この実装では、this.equals(another) が true となるインスタンス another に対しては this.compareTo(another) == 0 となりますが、その逆は必ずしも成り立ちません。 ただし、文 ID が必ず一意であると保障されているならば、常に逆も成り立ちます。

定義:
インタフェース java.lang.Comparable<SentenceModel> 内の compareTo
パラメータ:
o - 比較対象のオブジェクト
戻り値:
比較結果