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

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: PassageEvent.java,v 1.9 2005/03/06 20:21:47 dmsmith Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence, Serialized Form

Field Summary
private  Verse lower
          The lowest numbered element to have changed
private static long serialVersionUID
          Serialization ID
private  int type
          The type of change
private  Verse upper
          The highest numbered element to have changed
static Verse VERSE_HIGHEST
          When the upper verse is null
static Verse VERSE_LOWEST
          When the lower verse is null
static int VERSES_ADDED
          Identifies the addition of one or more contiguous items to the list
static int VERSES_CHANGED
          Identifies one or more changes in the lists contents.
static int VERSES_REMOVED
          Identifies the removal of one or more contiguous items from the list
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
PassageEvent(Object source, int type, Verse lower, Verse upper)
          Constructs a PassageEvent object.
 
Method Summary
 Verse getLowerIndex()
          Returns the lower index of the range.
 int 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

VERSES_CHANGED

public static final int VERSES_CHANGED
Identifies one or more changes in the lists contents.

See Also:
Constant Field Values

VERSES_ADDED

public static final int VERSES_ADDED
Identifies the addition of one or more contiguous items to the list

See Also:
Constant Field Values

VERSES_REMOVED

public static final int VERSES_REMOVED
Identifies the removal of one or more contiguous items from the list

See Also:
Constant Field Values

VERSE_LOWEST

public static final Verse VERSE_LOWEST
When the lower verse is null


VERSE_HIGHEST

public static final Verse VERSE_HIGHEST
When the upper verse is null


type

private int 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,
                    int type,
                    Verse lower,
                    Verse upper)
Constructs a PassageEvent object.

Parameters:
source - the source Object (typically this)
type - 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 int 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-2004