edu.uky.rch.ept.xmlSegmentTree.element
Class TagElement

java.lang.Object
  extended byedu.uky.rch.ept.xmlSegmentTree.element.AbstractElement
      extended byedu.uky.rch.ept.xmlSegmentTree.element.SimpleElement
          extended byedu.uky.rch.ept.xmlSegmentTree.element.TagElement
All Implemented Interfaces:
Element

public class TagElement
extends SimpleElement

Class representing an XML element with attributes. Defers equals to the superclass, meaning equals DOES NOT take attributes into consideration. This is necessary to preserve symmetry of the equals() relation against members of class SimpleElement.


Constructor Summary
TagElement(Position start, Position end, String tag, Map attributes)
          Create a new tagged element at the specified position.
TagElement(Position location, String tag, Map attributes)
          Create a new empty tagged element at the specified position.
 
Method Summary
 List getAttributes()
          Get a list of attribute keys.
 String getAttributeValue(String attr)
          Get the value of an attribute.
 String toString()
           
 
Methods inherited from class edu.uky.rch.ept.xmlSegmentTree.element.SimpleElement
equals, getEnd, getStart, getString, getTag, isEmpty, isString
 
Methods inherited from class edu.uky.rch.ept.xmlSegmentTree.element.AbstractElement
disjoint, endsAfter, endsBefore, endsWithin, getLength, overlaps, startsAfter, startsBefore, startsWithin, within
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TagElement

public TagElement(Position start,
                  Position end,
                  String tag,
                  Map attributes)
Create a new tagged element at the specified position.

Parameters:
start - the location of the element's beginning
end - the location of the element's end
tag - the element's tag
attributes - a map representing the attributes of the element
Throws:
IllegalArgumentException - if start, end, or tag is null.

TagElement

public TagElement(Position location,
                  String tag,
                  Map attributes)
Create a new empty tagged element at the specified position.

Parameters:
location - the location of the element
tag - the element's tag
attributes - a map representing the attributes of the element
Throws:
IllegalArgumentException - if location or tag is null.
Method Detail

getAttributes

public List getAttributes()
Description copied from interface: Element
Get a list of attribute keys.

Specified by:
getAttributes in interface Element
Overrides:
getAttributes in class SimpleElement

getAttributeValue

public String getAttributeValue(String attr)
Description copied from interface: Element
Get the value of an attribute.

Specified by:
getAttributeValue in interface Element
Overrides:
getAttributeValue in class SimpleElement

toString

public String toString()
Overrides:
toString in class SimpleElement