org.crosswire.jsword.passage
Class PassageEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.crosswire.jsword.passage.PassageEvent
All Implemented Interfaces:
Serializable

public class PassageEvent
extends EventObject

Defines an event that encapsulates changes to a Passage. For many operations on a Passage, calculating the extent of the changes is hard. In these cases we default the range to Gen 1:1-Rev 22:21

Author:
Joe Walker [joe at eireneh dot com]
See Also:
for license details.
The copyright to this program is held by it's authors.
, Serialized Form

Nested Class Summary
static class PassageEvent.EventType
          Indicates what kind of change happened to a Passage.
 
Field Summary
private  Verse lower
          The lowest numbered element to have changed
private static long serialVersionUID
          Serialization ID
private  PassageEvent.EventType type
          The type of change
private  Verse upper
          The highest numbered element to have changed
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
PassageEvent(Object source, PassageEvent.EventType versesChanged, Verse lower, Verse upper)
          Constructs a PassageEvent object.
 
Method Summary
 Verse getLowerIndex()
          Returns the lower index of the range.
 PassageEvent.EventType getType()
          Returns the event type.
 Verse getUpperIndex()
          Returns the upper index of the range.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

private PassageEvent.EventType type
The type of change


lower

private Verse lower
The lowest numbered element to have changed


upper

private Verse upper
The highest numbered element to have changed


serialVersionUID

private static final long serialVersionUID
Serialization ID

See Also:
Constant Field Values
Constructor Detail

PassageEvent

public PassageEvent(Object source,
                    PassageEvent.EventType versesChanged,
                    Verse lower,
                    Verse upper)
Constructs a PassageEvent object.

Parameters:
source - the source Object (typically this)
versesChanged - an int specifying VERSES_CHANGED, VERSES_ADDED, VERSES_REMOVED
lower - an int specifying the bottom of a range
upper - an int specifying the top of a range
Method Detail

getType

public PassageEvent.EventType getType()
Returns the event type. The possible values are:

Returns:
an int representing the type value

getLowerIndex

public Verse getLowerIndex()
Returns the lower index of the range. For a single element, this value is the same as that returned by getUpperIndex().

Returns:
an int representing the lower index value

getUpperIndex

public Verse getUpperIndex()
Returns the upper index of the range. For a single element, this value is the same as that returned by getLowerIndex().

Returns:
an int representing the upper index value

Copyright ? 2003-2011