org.crosswire.jsword.passage
Enum RestrictionType

java.lang.Object
  extended by java.lang.Enum<RestrictionType>
      extended by org.crosswire.jsword.passage.RestrictionType
All Implemented Interfaces:
Serializable, Comparable<RestrictionType>

public enum RestrictionType
extends Enum<RestrictionType>

Types of Passage Blurring Restrictions.

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

Enum Constant Summary
CHAPTER
          Blurring is restricted to the chapter
NONE
          There is no restriction on blurring.
 
Field Summary
private static RestrictionType defaultBlurRestriction
          A default restriction type for blurring.
 
Method Summary
abstract  VerseRange blur(Versification v11n, Verse verse, int blurDown, int blurUp)
          Blur a verse the specified amount.
abstract  VerseRange blur(Versification v11n, VerseRange range, int blurDown, int blurUp)
          Blur a verse range the specified amount.
static RestrictionType fromInteger(int i)
          Lookup method to convert from an integer
static RestrictionType fromString(String name)
          Lookup method to convert from a String
static int getBlurRestriction()
          The default Blur settings.
static RestrictionType getDefaultBlurRestriction()
          The default Blur settings.
abstract  boolean isSameScope(Versification v11n, Verse start, Verse end)
          Are the two verses in the same scope.
static void setBlurRestriction(int value)
          The default Blur settings.
 int toInteger()
          Get an integer representation for this RestrictionType
abstract  VerseRange toRange(Versification v11n, Verse verse, int count)
          Create a range from the verse having the specified number of verses.
static RestrictionType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static RestrictionType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NONE

public static final RestrictionType NONE
There is no restriction on blurring.


CHAPTER

public static final RestrictionType CHAPTER
Blurring is restricted to the chapter

Field Detail

defaultBlurRestriction

private static RestrictionType defaultBlurRestriction
A default restriction type for blurring.

Method Detail

values

public static RestrictionType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (RestrictionType c : RestrictionType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static RestrictionType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

isSameScope

public abstract boolean isSameScope(Versification v11n,
                                    Verse start,
                                    Verse end)
Are the two verses in the same scope.

Parameters:
start - the first verse
end - the second verse
Returns:
true if the two are in the same scope.

blur

public abstract VerseRange blur(Versification v11n,
                                VerseRange range,
                                int blurDown,
                                int blurUp)
Blur a verse range the specified amount. Since verse ranges are immutable, it creates a new one.

Parameters:
range -
blurDown -
blurUp -
Returns:
a verse range after blurring.

blur

public abstract VerseRange blur(Versification v11n,
                                Verse verse,
                                int blurDown,
                                int blurUp)
Blur a verse the specified amount. Since verse are immutable and refer to a single verse, it creates a verse range.

Parameters:
verse -
blurDown -
blurUp -
Returns:
a verse range after blurring

toRange

public abstract VerseRange toRange(Versification v11n,
                                   Verse verse,
                                   int count)
Create a range from the verse having the specified number of verses.

Parameters:
verse -
count -
Returns:
a verse range created by extending a verse forward.

toInteger

public int toInteger()
Get an integer representation for this RestrictionType


fromString

public static RestrictionType fromString(String name)
Lookup method to convert from a String


fromInteger

public static RestrictionType fromInteger(int i)
Lookup method to convert from an integer


setBlurRestriction

public static void setBlurRestriction(int value)
The default Blur settings. This is used by config to set a default.

Parameters:
value - The new default blur setting

getBlurRestriction

public static int getBlurRestriction()
The default Blur settings. This is used by config to manage a default setting.

Returns:
The current default blurRestriction setting

getDefaultBlurRestriction

public static RestrictionType getDefaultBlurRestriction()
The default Blur settings. This is used by BlurCommandWord

Returns:
The current default blurRestriction setting

Copyright ? 2003-2011