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

Variable Index

 o _content

Constructor Index

 o KifSeq()
Create an empty sequence.
 o KifSeq(KifObj)
Create an instance of KifSeq with only one object in the sequence.
 o 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.
 o KifSeq(KifSeq)
Create a new copy of the given sequence, copy constructor.
 o KifSeq(KifSeq, KifObj)
Create an instance of KifSeq by appending the given object to the given sequence.

Method Index

 o append(KifObj)
Append a given Kif object to this sequence.
 o append(KifSeq)
Append a given Kif sequence to this sequence.
 o car()
Get the first element of this sequence, as in Lisp.
 o cdr()
Get the subsquence(from 2nd element to end) of the sequence, as in Lisp.
 o isEmpty()
Test if this sequence is empty.
 o ithObj(int)
Get the ith object in the sequence.
 o size()
Get the size (# of kif objects in the sequence) of the sequence.
 o toString()
Convert this KIF sequence into String format.

Variables

 o _content
 private Vector _content

Constructors

 o KifSeq
 public KifSeq()
Create an empty sequence.

 o 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.
 o 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.
 o 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.
 o KifSeq
 public KifSeq(KifSeq seq)
Create a new copy of the given sequence, copy constructor.

Parameters:
seq - the given sequence.

Methods

 o 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.
 o append
 public void append(KifObj obj)
Append a given Kif object to this sequence.

Parameters:
obj - the given object to append.
 o append
 public void append(KifSeq seq)
Append a given Kif sequence to this sequence.

Parameters:
seq - the given sequence.
 o isEmpty
 public boolean isEmpty()
Test if this sequence is empty.

Returns:
: true if the sequence is empty; false otherwise.
 o 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.
 o 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.
 o size
 public int size()
Get the size (# of kif objects in the sequence) of the sequence.

Returns:
the size of the sequence.
 o 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