|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.topologi.diffx.sequence.EventSequence
public final class EventSequence
A sequence of events used for the Diff-X algorithm.
This class wraps a list of DiffXEvent
s and provide method to
access and modify the content of the list using strongly typed methods.
Nested Class Summary | |
---|---|
class |
EventSequence.EventIterator
An iterator over the event elements in the sequences. |
Constructor Summary | |
---|---|
EventSequence()
Creates a new event sequence. |
|
EventSequence(int size)
Creates a new event sequence of the specified size. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EventSequence()
public EventSequence(int size)
size
- The size of the sequence.Method Detail |
---|
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 int hashCode()
hashCode
in class Object
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
.
equals
in class Object
o
- The sequence of events to compare with this one.
true
if the specified event sequence is equal to this one;
false
otherwise.public String toString()
toString
in class Object
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 null
PrefixMapping.add(String, String)
public PrefixMapping getPrefixMapping()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |