/* * [Gloss.java] * * Summary: enumeration for the four different glossary indexes. * * Copyright: (c) 2008-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.1 2008-06-17 add egloss */ package com.mindprod.qf; /** * enumeration for the four different glossary indexes. * * @author Roedy Green, Canadian Mind Products * @version 1.1 2008-06-17 add egloss * @since 2008 */ public enum Gloss { BGLOSS( "bgloss" ), DGLOSS( "dgloss" ), EGLOSS( "egloss" ), GGLOSS( "ggloss" ), JGLOSS( "jgloss" ), LGLOSS( "lgloss" ); /** * the letter as cap used to signify this glossary e.g. J = Java glossary. */ private final char signatureLetter; /** * css class to mark a link to that glossary */ private final String cssClass; /** * constructor * * @param cssClass the CSS class for links to this glossary */ Gloss( String cssClass ) { this.cssClass = cssClass; this.signatureLetter = Character.toUpperCase( cssClass.charAt( 0 ) ); } // methods /** * get the corresponding CSS class for links to this glossary , no lead E:/mindprod/ * * @return "jgloss" name of mindprod directory without E:\mindprod */ String getBareDir() { // same as cssClass return cssClass; }// /method /** * get the corresponding CSS class for links to this glossary * * @return "jgloss" name of css class */ String getCSSClass() { return cssClass; }// /method /** * get the letter as cap used to signify this glossary e.g. J = Java glossary. * * @return letter e.g. J */ char getSignatureLetter() { return signatureLetter; }// /method /** * get corresponding enum constant to letter. * * @param c upper case B E G L J to indicate the glossary. * * @return Gloss enum matching that letter, null if no match. */ @SuppressWarnings( { "UnusedDeclaration" } ) public static Gloss valueOfLetter( char c ) { switch ( c ) { case 'B': return BGLOSS; case 'D': return DGLOSS; case 'E': return EGLOSS; case 'G': return GGLOSS; case 'J': return JGLOSS; case 'L': return LGLOSS; default: return null; } }// /method // /methods }