de.fu_berlin.ties.xml
Class XMLConstituent

java.lang.Object
  extended by de.fu_berlin.ties.util.ListEntry
      extended by de.fu_berlin.ties.xml.XMLConstituent
Direct Known Subclasses:
OtherConstituent, TagConstituent

public abstract class XMLConstituent
extends ListEntry

A constituent in an XML document.

Version:
$Revision: 1.1 $, $Date: 2004/02/02 18:50:17 $, $Author: siefkes $
Author:
Christian Siefkes

Constructor Summary
XMLConstituent(short constType, String rep)
          Creates a new instance, without setting a reference to a next constituent.
XMLConstituent(short constType, String rep, XMLConstituent prevEntry, XMLConstituent nextEntry)
          Creates a new instance.
 
Method Summary
 String getRepresentantion()
          Returns the representation of this tag within the XML document.
 short getType()
          Returns the type of this constituent.
 XMLConstituent nextConstituent()
          Returns the next constituent in the list, if any.
 XMLConstituent previousConstituent()
          Returns the previous constituent in the list, if any.
 void setRepresentantion(String string)
          Sets the representation of this tag within the XML document.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class de.fu_berlin.ties.util.ListEntry
hasNext, hasPrevious, insertAfter, insertBefore, next, previous, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLConstituent

public XMLConstituent(short constType,
                      String rep)
Creates a new instance, without setting a reference to a next constituent.

Parameters:
constType - the typ of this constituent (one of the type constants defined in subclasses of this type)
rep - the representation of this constituent within the XML document, i.e. the string fragment from the document representing this constituent

XMLConstituent

public XMLConstituent(short constType,
                      String rep,
                      XMLConstituent prevEntry,
                      XMLConstituent nextEntry)
Creates a new instance.

Parameters:
constType - the typ of this constituent (one of the type constants defined in subclasses of this type)
rep - the representation of this constituent within the XML document, i.e. the string fragment from the document representing this constituent
prevEntry - a reference to the next constituent
nextEntry - a reference to the next constituent
Method Detail

getRepresentantion

public String getRepresentantion()
Returns the representation of this tag within the XML document.

Returns:
the representation, i.e. the string fragment from the document representing this constituent

getType

public short getType()
Returns the type of this constituent. Suitable type constants are defined in subclasses of this class.

Returns:
the constituent type

nextConstituent

public XMLConstituent nextConstituent()
Returns the next constituent in the list, if any. A convience alternative to calling ListEntry.next() and casting the result to an XMLConstituent.

Returns:
the next constituent in the file

previousConstituent

public XMLConstituent previousConstituent()
Returns the previous constituent in the list, if any. A convience alternative to calling ListEntry.previous() and casting the result to an XMLConstituent.

Returns:
the previous constituent in the file

setRepresentantion

public void setRepresentantion(String string)
Sets the representation of this tag within the XML document.

Parameters:
string - the representation, i.e. the string fragment from the document representing this constituent

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class ListEntry
Returns:
a textual representation


Copyright © 2003-2004 Christian Siefkes. All Rights Reserved.