uk.ac.essex.malexa.nlp.dp.GuiTAR
Class Segment

java.lang.Object
  extended byuk.ac.essex.malexa.nlp.dp.GuiTAR.Segment
All Implemented Interfaces:
DiscourseSegmentation
Direct Known Subclasses:
Utterance

public class Segment
extends Object
implements DiscourseSegmentation

A class that encapsulates the general functionality of a Segment and provides implementation to the methods defined by the interface DiscourseSegmentation.

Version:
1.1
Author:
Mijail A. Kabadjov

Field Summary
protected  Vector children
           
private  Node domNode
           
private  Segment nextSibling
           
private  Segment parentSegment
           
private  Segment prevSibling
           
private  Object relationWithParent
           
 
Constructor Summary
Segment(Node node, Segment parent)
          Initialises the instance variables.
 
Method Summary
 void addChild(Segment child)
          Adds a new child to the segment and updates children pointers to prev-/nextSibling.
 Vector getChildren()
          Retrieves the list of children of this segment.
 Segment getNextSibling()
          Retrieves the next sibling of this segment, which could be another Segment or an Utterance.
 Node getNode()
          Retrieves the DOM node of this segment.
 Segment getParent()
          Retrieves the parent segment of this segment.
 Segment getPrevSibling()
          Retrieves the previous sibling of this segment, which could be another Segment or an Utterance.
 Object getRelationWithParent()
          Retrieves the relationship holding between this segment and its parent.
 void setNextSibling(Segment sibling)
          Sets the next sibling of this segment.
 void setPreviousSibling(Segment sibling)
          Sets the previous sibling of this segment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

domNode

private Node domNode

relationWithParent

private Object relationWithParent

parentSegment

private Segment parentSegment

prevSibling

private Segment prevSibling

nextSibling

private Segment nextSibling

children

protected Vector children
Constructor Detail

Segment

public Segment(Node node,
               Segment parent)
Initialises the instance variables.

Parameters:
node - The DOM node of this segment
parent - The parent segment
Method Detail

getNode

public Node getNode()
Retrieves the DOM node of this segment.

Specified by:
getNode in interface DiscourseSegmentation
Returns:
Node The node

getRelationWithParent

public Object getRelationWithParent()
Retrieves the relationship holding between this segment and its parent.

Specified by:
getRelationWithParent in interface DiscourseSegmentation
Returns:
Object The relation with parent segment

getParent

public Segment getParent()
Retrieves the parent segment of this segment.

Specified by:
getParent in interface DiscourseSegmentation
Returns:
Segment The parent segment

getPrevSibling

public Segment getPrevSibling()
Retrieves the previous sibling of this segment, which could be another Segment or an Utterance.

Specified by:
getPrevSibling in interface DiscourseSegmentation
Returns:
Segment The left sibling

getNextSibling

public Segment getNextSibling()
Retrieves the next sibling of this segment, which could be another Segment or an Utterance.

Specified by:
getNextSibling in interface DiscourseSegmentation
Returns:
Segment The right sibling

getChildren

public Vector getChildren()
Retrieves the list of children of this segment. Returns a polimoriphic Vector containing objects of class Segment or Utterance.

Specified by:
getChildren in interface DiscourseSegmentation
Returns:
Vector The list of Segments and/or Utterances

addChild

public void addChild(Segment child)
Adds a new child to the segment and updates children pointers to prev-/nextSibling.

Specified by:
addChild in interface DiscourseSegmentation
Parameters:
child - The child (Utterance/Segment) to be added

setPreviousSibling

public void setPreviousSibling(Segment sibling)
Sets the previous sibling of this segment.

Specified by:
setPreviousSibling in interface DiscourseSegmentation
Parameters:
sibling - The sibling

setNextSibling

public void setNextSibling(Segment sibling)
Sets the next sibling of this segment.

Specified by:
setNextSibling in interface DiscourseSegmentation
Parameters:
sibling - The sibling