All Packages Class Hierarchy This Package Previous Next Index
Class jkp.KifSeq
java.lang.Object
|
+----jkp.KifObj
|
+----jkp.KifSeq
- public class KifSeq
- extends KifObj
The class for KIF object sequence, such as term sequence(in a relational
sentence), sentence sequence(in conjuction/disjunction), etc.
A very important class in this parser.
Copyright (c) 1996, Xiaocheng Luan.
All rights reserved.
- Author:
- Xiaocheng Luan
-
_content
-
-
KifSeq()
- Create an empty sequence.
-
KifSeq(KifObj)
- Create an instance of KifSeq with only one object in the sequence.
-
KifSeq(KifObj, KifSeq)
- Create an instance of KifSeq with the given object as the first
object in the sequence, and objects in the given sequence as the
rest of the created sequence.
-
KifSeq(KifSeq)
- Create a new copy of the given sequence, copy constructor.
-
KifSeq(KifSeq, KifObj)
- Create an instance of KifSeq by appending the given object to the
given sequence.
-
append(KifObj)
- Append a given Kif object to this sequence.
-
append(KifSeq)
- Append a given Kif sequence to this sequence.
-
car()
- Get the first element of this sequence, as in Lisp.
-
cdr()
- Get the subsquence(from 2nd element to end) of the sequence, as in Lisp.
-
isEmpty()
- Test if this sequence is empty.
-
ithObj(int)
- Get the ith object in the sequence.
-
size()
- Get the size (# of kif objects in the sequence) of the sequence.
-
toString()
- Convert this KIF sequence into String format.
_content
private Vector _content
KifSeq
public KifSeq()
- Create an empty sequence.
KifSeq
public KifSeq(KifObj obj)
- Create an instance of KifSeq with only one object in the sequence.
- Parameters:
- obj - The only one object in the sequence.
KifSeq
public KifSeq(KifObj obj,
KifSeq seq)
- Create an instance of KifSeq with the given object as the first
object in the sequence, and objects in the given sequence as the
rest of the created sequence.
- Parameters:
- obj - the first object in the created sequence.
- seq - the objects of which will be the second part of the new
sequence.
KifSeq
public KifSeq(KifSeq seq,
KifObj obj)
- Create an instance of KifSeq by appending the given object to the
given sequence.
- Parameters:
- seq - the given sequence.
- obj - the given object.
KifSeq
public KifSeq(KifSeq seq)
- Create a new copy of the given sequence, copy constructor.
- Parameters:
- seq - the given sequence.
ithObj
public KifObj ithObj(int i) throws KifRTException
- Get the ith object in the sequence.
- Parameters:
- i - the object index, indicating which object to get.
- Returns:
- the ith Kif object in the sequence.
append
public void append(KifObj obj)
- Append a given Kif object to this sequence.
- Parameters:
- obj - the given object to append.
append
public void append(KifSeq seq)
- Append a given Kif sequence to this sequence.
- Parameters:
- seq - the given sequence.
isEmpty
public boolean isEmpty()
- Test if this sequence is empty.
- Returns:
- : true if the sequence is empty; false otherwise.
car
public KifObj car()
- Get the first element of this sequence, as in Lisp.
- Returns:
- the first element of the sequence; return null if empty.
cdr
public KifSeq cdr()
- Get the subsquence(from 2nd element to end) of the sequence, as in Lisp.
- Returns:
- the subsquence(from 2nd element to end) of the sequence;
return null if there is less than 2 elements in the sequence.
size
public int size()
- Get the size (# of kif objects in the sequence) of the sequence.
- Returns:
- the size of the sequence.
toString
public String toString()
- Convert this KIF sequence into String format.
- Returns:
- this KIF sequence in String format.
- Overrides:
- toString in class KifObj
All Packages Class Hierarchy This Package Previous Next Index