org.crosswire.bibledesktop.passage

## Class RangeListModel

- java.lang.Object
- - javax.swing.AbstractListModel
  - - org.crosswire.bibledesktop.passage.RangeListModel

- All Implemented Interfaces:
    Serializable, ListModel

      public class RangeListModel
      extends AbstractListModel

  The RangeListModel class gives access to a Passage as a list of ranges via a ListModel.
  Author:
    DM Smith
  See Also:
    `for license details.`, Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private List<org.crosswire.jsword.passage.Key>` | `ranges` The list of ranges in the passage.
    `private org.crosswire.jsword.passage.Passage` | `ref` The Passage that we are modeling
    `private org.crosswire.jsword.passage.RestrictionType` | `restrict` If we are modeling in groups, do we break at chapter/book boundaries
    `private static long` | `serialVersionUID` Serialization ID

    - ### Fields inherited from class javax.swing.AbstractListModel

      `listenerList`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RangeListModel(org.crosswire.jsword.passage.RestrictionType theRestriction)` Create a RangeListModel specifying whether to list the ranges bounded by Chapter or not at all.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getElementAt(int index)` Returns the value at the specified index.
    `org.crosswire.jsword.passage.Passage` | `getPassage()` Accessor for the current passage
    `org.crosswire.jsword.passage.RestrictionType` | `getRestriction()` Return the current Range Restriction
    `int` | `getSize()` Returns the length of the list.
    `private void` | `refresh()`
    `void` | `setPassage(org.crosswire.jsword.passage.Passage newRef)` Accessor for the current passage
    `void` | `setRestriction(org.crosswire.jsword.passage.RestrictionType restrict)` Change the restrictions we are using.

    - ### Methods inherited from class javax.swing.AbstractListModel

      `addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ref

          private org.crosswire.jsword.passage.Passage ref

      The Passage that we are modeling

    - #### ranges

          private List<org.crosswire.jsword.passage.Key> ranges

      The list of ranges in the passage.

    - #### restrict

          private org.crosswire.jsword.passage.RestrictionType restrict

      If we are modeling in groups, do we break at chapter/book boundaries

    - #### serialVersionUID

          private static final long serialVersionUID

      Serialization ID
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RangeListModel

          public RangeListModel(org.crosswire.jsword.passage.RestrictionType theRestriction)

      Create a RangeListModel specifying whether to list the ranges bounded by Chapter or not at all.
      Parameters:
        `theRestriction` - Do we chop at chapter boundaries

  - ### Method Detail

    - #### setRestriction

          public void setRestriction(org.crosswire.jsword.passage.RestrictionType restrict)

      Change the restrictions we are using. Must be one of: `RestrictType.NONE`, or `RestrictType.CHAPTER`
      Parameters:
        `restrict` - The new restrictions

    - #### getRestriction

          public org.crosswire.jsword.passage.RestrictionType getRestriction()

      Return the current Range Restriction

    - #### getSize

          public int getSize()

      Returns the length of the list.
      Returns:
        The number of verses/ranges in the list

    - #### getElementAt

          public Object getElementAt(int index)

      Returns the value at the specified index.
      Parameters:
        `index` - The index (based at 0) of the element to fetch
      Returns:
        The required verse/range

    - #### setPassage

          public final void setPassage(org.crosswire.jsword.passage.Passage newRef)

      Accessor for the current passage

    - #### getPassage

          public org.crosswire.jsword.passage.Passage getPassage()

      Accessor for the current passage

    - #### refresh

          private void refresh()