public final class EventSequence extends Object
This class wraps a list of DiffXEvents and provide method to
access and modify the content of the list using strongly typed methods.
| Modifier and Type | Class and Description |
|---|---|
class |
EventSequence.EventIterator
An iterator over the event elements in the sequences.
|
| Constructor and Description |
|---|
EventSequence()
Creates a new event sequence.
|
EventSequence(int size)
Creates a new event sequence of the specified size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEvent(DiffXEvent e)
Adds an event to this sequence.
|
void |
addEvent(int i,
DiffXEvent e)
Inserts an event to this sequence at the specified position.
|
void |
addSequence(EventSequence seq)
Adds a sequence of events to this sequence.
|
boolean |
equals(EventSequence seq)
Returns
true if the specified event sequence is the same as this one. |
boolean |
equals(Object o)
Returns
true if the specified event sequence is the same as this one. |
EventSequence.EventIterator |
eventIterator()
Returns a event iterator for this list.
|
List<DiffXEvent> |
events()
Returns the sequence of events.
|
void |
export(PrintWriter w)
Export the sequence.
|
DiffXEvent |
getEvent(int i)
Returns the event at position i.
|
PrefixMapping |
getPrefixMapping()
Returns the prefix mapping for the namespace URIs in this sequence.
|
int |
hashCode() |
void |
mapPrefix(String uri,
String prefix)
Maps a namespace URI to a prefix.
|
DiffXEvent |
removeEvent(int index)
Removes an event from this sequence at the specified position.
|
DiffXEvent |
setEvent(int index,
DiffXEvent e)
Replaces an event of this sequence at the specified position.
|
int |
size()
The size of the sequence.
|
String |
toString()
Returns the string representation of this sequence.
|
public EventSequence()
public EventSequence(int size)
size - The size of the sequence.public void addSequence(EventSequence seq)
seq - The sequence of events to be added.public void addEvent(DiffXEvent e)
e - The event to be added.public void addEvent(int i,
DiffXEvent e)
i - The position of the event.e - The event to be added.public DiffXEvent getEvent(int i)
i - The position of the event.public DiffXEvent setEvent(int index, DiffXEvent e)
index - The 0-based index of the position.e - The event to be inserted.public DiffXEvent removeEvent(int index)
index - The 0-based index of the position.public int size()
public EventSequence.EventIterator eventIterator()
public List<DiffXEvent> events()
public boolean equals(EventSequence seq)
true if the specified event sequence is the same as this one.seq - The sequence of events to compare with this one.true if the specified event sequence is equal to this one;
false otherwise.public boolean equals(Object o)
true if the specified event sequence is the same as this one.
This method will redirect to the equals(EventSequence) method if the
specified object is an instance of EventSequence.
public String toString()
public void export(PrintWriter w)
w - The print writer receiving the SAX events.public void mapPrefix(String uri, String prefix) throws NullPointerException
uri - The namespace URI to map.prefix - The prefix to use.NullPointerException - if the URI or prefix is nullPrefixMapping.add(String, String)public PrefixMapping getPrefixMapping()
Copyright © 2007-2022. All Rights Reserved.