Coverage Report - org.dishevelled.iconbundle.IconTextDirection
 
Classes in this File Line Coverage Branch Coverage Complexity
IconTextDirection
100%
8/8
N/A
1
 
 1  
 /*
 2  
 
 3  
     dsh-iconbundle  Bundles of variants for icon images.
 4  
     Copyright (c) 2003-2011 held jointly by the individual authors.
 5  
 
 6  
     This library is free software; you can redistribute it and/or modify it
 7  
     under the terms of the GNU Lesser General Public License as published
 8  
     by the Free Software Foundation; either version 3 of the License, or (at
 9  
     your option) any later version.
 10  
 
 11  
     This library is distributed in the hope that it will be useful, but WITHOUT
 12  
     ANY WARRANTY; with out even the implied warranty of MERCHANTABILITY or
 13  
     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
 14  
     License for more details.
 15  
 
 16  
     You should have received a copy of the GNU Lesser General Public License
 17  
     along with this library;  if not, write to the Free Software Foundation,
 18  
     Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
 19  
 
 20  
     > http://www.fsf.org/licensing/licenses/lgpl.html
 21  
     > http://www.opensource.org/licenses/lgpl-license.php
 22  
 
 23  
 */
 24  
 package org.dishevelled.iconbundle;
 25  
 
 26  
 import java.util.List;
 27  
 import java.util.Arrays;
 28  
 import java.util.Collections;
 29  
 
 30  
 import java.io.Serializable;
 31  
 
 32  
 /**
 33  
  * Typesafe enumeration of icon text directions.
 34  
  *
 35  
  * @author  Michael Heuer
 36  
  * @version $Revision: 974 $ $Date: 2011-01-04 21:40:23 -0600 (Tue, 04 Jan 2011) $
 37  
  */
 38  
 public final class IconTextDirection
 39  
     implements Serializable
 40  
 {
 41  
     /** Text direction name. */
 42  
     private String name;
 43  
 
 44  
 
 45  
     /**
 46  
      * Create a new text direction with the specified name.
 47  
      *
 48  
      * @param name text direction name
 49  
      */
 50  
     private IconTextDirection(final String name)
 51  2
     {
 52  2
         this.name = name;
 53  2
     }
 54  
 
 55  
 
 56  
     /**
 57  
      * Return the text direction name.
 58  
      *
 59  
      * @return the text direction name
 60  
      */
 61  
     public String toString()
 62  
     {
 63  44
         return name;
 64  
     }
 65  
 
 66  
     /** Left-to-right horizontal text direction. */
 67  1
     public static final IconTextDirection LEFT_TO_RIGHT = new IconTextDirection("ltr");
 68  
 
 69  
     /** Right-to-left horizontal text direction. */
 70  1
     public static final IconTextDirection RIGHT_TO_LEFT = new IconTextDirection("rtl");
 71  
 
 72  
     /**
 73  
      * Private array of enumeration values.
 74  
      */
 75  1
     private static final IconTextDirection[] VALUES_ARRAY = {
 76  
                                                               LEFT_TO_RIGHT,
 77  
                                                               RIGHT_TO_LEFT
 78  
                                                             };
 79  
 
 80  
     /**
 81  
      * Public list of enumeration values.
 82  
      */
 83  1
     public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
 84  
 }