com.ancientprogramming.fixedformat4j.annotation
Enum Sign

java.lang.Object
  extended by java.lang.Enum<Sign>
      extended by com.ancientprogramming.fixedformat4j.annotation.Sign
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Sign>

public enum Sign
extends java.lang.Enum<Sign>

Sign defines where to place a sign defining a positive or negative number. Is to be used in formatters operating numbers.

Since:
1.1.0
Author:
Jacob von Eyben - http://www.ancientprogramming.com

Enum Constant Summary
APPEND
          Append the sign to the string
NOSIGN
          Doesn't do anything with signs.
PREPEND
          Prepend the sign to the string
 
Method Summary
abstract  java.lang.String apply(java.lang.String value, FormatInstructions instructions)
           
abstract  java.lang.String remove(java.lang.String value, FormatInstructions instructions)
           
static Sign valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Sign[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NOSIGN

public static final Sign NOSIGN
Doesn't do anything with signs. This just delegate to the Align defined in FormatInstructions.


PREPEND

public static final Sign PREPEND
Prepend the sign to the string


APPEND

public static final Sign APPEND
Append the sign to the string

Method Detail

values

public static final Sign[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Sign c : Sign.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Sign valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

apply

public abstract java.lang.String apply(java.lang.String value,
                                       FormatInstructions instructions)

remove

public abstract java.lang.String remove(java.lang.String value,
                                        FormatInstructions instructions)


Copyright © 2008 ancientprogramming.com. All Rights Reserved.