| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| Classes |
|
| 1.5;1.5 |
| 1 | /* | |
| 2 | Copyright 2004-2008 Paul R. Holser, Jr. All rights reserved. | |
| 3 | Licensed under the Academic Free License version 3.0 | |
| 4 | */ | |
| 5 | ||
| 6 | package joptsimple.internal; | |
| 7 | ||
| 8 | /** | |
| 9 | * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a> | |
| 10 | * @version $Id: Classes.java,v 1.2 2008/05/22 14:22:33 pholser Exp $ | |
| 11 | */ | |
| 12 | public class Classes { | |
| 13 | /** | |
| 14 | * <p>Do not instantiate -- statics only.</p> | |
| 15 | */ | |
| 16 | 2 | protected Classes() { |
| 17 | 2 | throw new UnsupportedOperationException(); |
| 18 | } | |
| 19 | ||
| 20 | /** | |
| 21 | * Gives the "short name" of the given class. Somewhat naive to inner classes. | |
| 22 | * | |
| 23 | * @param aClass class to query | |
| 24 | * @return the short name of the class | |
| 25 | */ | |
| 26 | public static String shortNameOf( Class aClass ) { | |
| 27 | 14 | String name = aClass.getName(); |
| 28 | 14 | return name.substring( name.lastIndexOf( '.' ) + 1 ); |
| 29 | } | |
| 30 | } |