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-2013 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  
  */
 37  
 public final class IconTextDirection
 38  
     implements Serializable
 39  
 {
 40  
     /** Text direction name. */
 41  
     private String name;
 42  
 
 43  
 
 44  
     /**
 45  
      * Create a new text direction with the specified name.
 46  
      *
 47  
      * @param name text direction name
 48  
      */
 49  
     private IconTextDirection(final String name)
 50  2
     {
 51  2
         this.name = name;
 52  2
     }
 53  
 
 54  
 
 55  
     /**
 56  
      * Return the text direction name.
 57  
      *
 58  
      * @return the text direction name
 59  
      */
 60  
     public String toString()
 61  
     {
 62  44
         return name;
 63  
     }
 64  
 
 65  
     /** Left-to-right horizontal text direction. */
 66  1
     public static final IconTextDirection LEFT_TO_RIGHT = new IconTextDirection("ltr");
 67  
 
 68  
     /** Right-to-left horizontal text direction. */
 69  1
     public static final IconTextDirection RIGHT_TO_LEFT = new IconTextDirection("rtl");
 70  
 
 71  
     /**
 72  
      * Private array of enumeration values.
 73  
      */
 74  1
     private static final IconTextDirection[] VALUES_ARRAY = {
 75  
                                                               LEFT_TO_RIGHT,
 76  
                                                               RIGHT_TO_LEFT
 77  
                                                             };
 78  
 
 79  
     /**
 80  
      * Public list of enumeration values.
 81  
      */
 82  1
     public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
 83  
 }