1   /**
2    * Distribution License:
3    * JSword is free software; you can redistribute it and/or modify it under
4    * the terms of the GNU Lesser General Public License, version 2.1 as published by
5    * the Free Software Foundation. This program is distributed in the hope
6    * that it will be useful, but WITHOUT ANY WARRANTY; without even the
7    * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8    * See the GNU Lesser General Public License for more details.
9    *
10   * The License is available on the internet at:
11   *       http://www.gnu.org/copyleft/lgpl.html
12   * or by writing to:
13   *      Free Software Foundation, Inc.
14   *      59 Temple Place - Suite 330
15   *      Boston, MA 02111-1307, USA
16   *
17   * Copyright: 2005
18   *     The copyright to this program is held by it's authors.
19   *
20   * ID: $Id: FeatureType.java 2050 2010-12-09 15:31:45Z dmsmith $
21   */
22  package org.crosswire.jsword.book;
23  
24  
25  
26  /**
27   * An Enumeration of the possible Features a Book may have.
28   * 
29   * @see gnu.lgpl.License for license details.<br>
30   *      The copyright to this program is held by it's authors.
31   * @author Joe Walker [joe at eireneh dot com]
32   */
33  public enum FeatureType {
34      /**
35       * The book is one of Greek Definitions. AKA, Strong's.
36       */
37      GREEK_DEFINITIONS ("GreekDef"),
38  
39      /**
40       * The book is one of Greek word parsings. AKA, Robinson.
41       */
42      GREEK_PARSE ("GreekParse"),
43  
44      /**
45       * The book is one of Hebrew Definitions. AKA, Strong's.
46       */
47      HEBREW_DEFINITIONS ("HebrewDef"),
48  
49      /**
50       * The book is one of Hebrew word parsings. AKA, ???.
51       */
52      HEBREW_PARSE ("HebrewParse"),
53  
54      /**
55       * The book is one of Daily Devotions.
56       */
57      DAILY_DEVOTIONS ("DailyDevotions"),
58  
59      /**
60       * The book is glossary of translations from one language to another.
61       */
62      GLOSSARY ("Glossary"),
63  
64      /**
65       * The book contains Strong's Numbers
66       */
67      STRONGS_NUMBERS ("StrongsNumbers"),
68  
69      /**
70       * The book contains footnotes
71       */
72      FOOTNOTES ("Footnotes"),
73  
74      /**
75       * The book contains Scripture cross references
76       */
77      SCRIPTURE_REFERENCES ("Scripref"),
78  
79      /**
80       * The book marks the Word's of Christ
81       */
82      WORDS_OF_CHRIST ("RedLetterText"),
83  
84      /**
85       * The book contains Morphology info
86       */
87      MORPHOLOGY ("Morph"),
88  
89      /**
90       * The book contains Headings
91       */
92      HEADINGS ("Headings");
93  
94      /**
95       * @param name
96       *            The name of the FeatureType
97       */
98      private FeatureType(String name) {
99          this.name = name;
100     }
101 
102     /**
103      * Lookup method to convert from a String
104      */
105     public static FeatureType fromString(String name) {
106         for (FeatureType v : values()) {
107             if (v.name.equalsIgnoreCase(name)) {
108                 return v;
109             }
110         }
111 
112         // cannot get here
113         assert false;
114         return null;
115     }
116 
117     /* (non-Javadoc)
118      * @see java.lang.Enum#toString()
119      */
120     @Override
121     public String toString() {
122         return name;
123     }
124 
125     /**
126      * The name of the FeatureType
127      */
128     private String name;
129 }
130