edu.utexas.its.eis.tools.qwicap.template.xml.structure
Interface Range

All Superinterfaces:
Cloneable
All Known Subinterfaces:
Attribute, CDATA, Comment, Content, Declaration, EmptyTag, EndTag, Item, NamedItem, StartTag, Tag, TagWithAttributes, Whitespace, XMLDeclaration

public interface Range
extends Cloneable

Super-interface of a hierarchy of interfaces that provide for the classification, and manipulation, of the complete contents of any XML markup. The hierarchy of interfaces looks like this:

The name "Range" comes from the idea that this represents a segment, an area, a span of consecutive characters, or, in other words, a range of characters, within an XML document. It makes no assertion about what the characters in its range of the document represent - that's what the sub-interfaces are for.

Author:
Chris W. Johnson

Method Summary
 Object clone()
           
 boolean isEmptyTag()
          Returns true if this range of characters constitutes an "empty" tag, for example: "<br/>".
 boolean isEndTag()
          Returns true if this range of characters constitutes an "end" tag, for example: "</body>".
 boolean isStartTag()
          Returns true if this range of characters constitutes a "start" tag, for example: "<body>".
 boolean isTagWithAttributes()
          Returns true if this range of characters constitutes a "start" or an "empty" tag; in other words, if this is a tag that can possess attributes.
 boolean rangeEquals(Characters Chars)
          Test this range of characters for equality with another set of characters.
 String toString()
          Returns a String representation of this range of characters.
 void write(PrintWriter Out)
          Write this range of characters to the specified PrintWriter.
 

Method Detail

rangeEquals

boolean rangeEquals(Characters Chars)
Test this range of characters for equality with another set of characters. The comparison is sensitive to case.

Parameters:
Chars - The set of characters to be tested for equality with this range of characters.
Returns:
true if the characters in this range exactly match the characters in the Chars parameter, false otherwise.

toString

String toString()
Returns a String representation of this range of characters.

Overrides:
toString in class Object
Returns:
A String representation of this range of characters.

clone

Object clone()

write

void write(PrintWriter Out)
           throws IOException
Write this range of characters to the specified PrintWriter.

Parameters:
Out - This range of characters is written to this PrintWriter.
Throws:
IOException - If anything goes wrong while writing.

isStartTag

boolean isStartTag()
Returns true if this range of characters constitutes a "start" tag, for example: "<body>". The same determination can be made with the test "instanceof StartTag", but using this method is faster.

Returns:
true if this range of characters constitutes a "start" tag, false otherwise.

isEndTag

boolean isEndTag()
Returns true if this range of characters constitutes an "end" tag, for example: "</body>". The same determination can be made with the test "instanceof EndTag", but using this method is faster.

Returns:
true if this range of characters constitutes an "end" tag, false otherwise.

isEmptyTag

boolean isEmptyTag()
Returns true if this range of characters constitutes an "empty" tag, for example: "<br/>". The same determination can be made with the test "instanceof EmptyTag", but using this method is faster.

Returns:
true if this range of characters constitutes an "empty" tag, false otherwise.

isTagWithAttributes

boolean isTagWithAttributes()
Returns true if this range of characters constitutes a "start" or an "empty" tag; in other words, if this is a tag that can possess attributes. The same determination can be made with the test "instanceof TagWithAttributes", but using this method is faster. Note that this method returns true for all "start" and "empty" tags; whether or not they actually do possess attributes is irrelevant.

Returns:
true if this range of characters constitutes a "start" or an "empty" tag, false otherwise.