ariba.util.formatter
Class IntegerArrayFormatter

java.lang.Object
  extended by ariba.util.formatter.Formatter
      extended by ariba.util.formatter.IntegerArrayFormatter
All Implemented Interfaces:
Compare, StringParser

public class IntegerArrayFormatter
extends Formatter

IntegerArrayFormatter is a subclass of Formatter which is responsible for formatting int arrays and/or Integer arrays.


Field Summary
static java.lang.String ClassName
          Our Java class name.
 
Fields inherited from interface ariba.util.core.Compare
EqualTo, GreaterThan, LessThan
 
Constructor Summary
IntegerArrayFormatter()
          Creates a new IntegerArrayFormatter.
 
Method Summary
static java.lang.String getStringValue(int[] array)
          Returns a formatted string for the given int array.
static java.lang.String getStringValue(java.lang.Integer[] array)
          Returns a formatted string for the given Integer array.
 java.lang.Object getValue(java.lang.Object object, java.util.Locale locale)
          Returns an object of the appropriate type for this formatter based on the given object.
 
Methods inherited from class ariba.util.formatter.Formatter
canFormatNulls, compare, compare, equal, equal, getFormat, getFormat, getFormatterClassForType, getFormatterForObject, getFormatterForType, getLocale, getStringValue, getStringValue, getValue, handlesNulls, isBidirectional, makeParseException, makeParseException, makeParseException, makeParseExceptionMessage, makeParseExceptionMessage, objectsAreEqual, objectsAreEqual, parse, parse, parseString, parseString, quickCompare, quickCompare, quickCompareValue, registerFormatter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ClassName

public static final java.lang.String ClassName
Our Java class name.

See Also:
Constant Field Values
Constructor Detail

IntegerArrayFormatter

public IntegerArrayFormatter()
Creates a new IntegerArrayFormatter.

Method Detail

getStringValue

public static java.lang.String getStringValue(java.lang.Integer[] array)
Returns a formatted string for the given Integer array. The array is first sorted and then formatted like "5, 1, 7". Ranges of consecutive numbers are also consolidated, so the array "1,3,4,5" would be turned into the string "1, 3-5".

Parameters:
array - the Integer array to format into a string
Returns:
a string representation of the Integer array

getStringValue

public static java.lang.String getStringValue(int[] array)
Returns a formatted string for the given int array. The array is first sorted and then formatted like "5, 1, 7". Ranges of consecutive numbers are also consolidated, so the array "1,3,4,5" would be turned into the string "1, 3-5".

Parameters:
array - the int array to format into a string
Returns:
a string representation of the int array

getValue

public java.lang.Object getValue(java.lang.Object object,
                                 java.util.Locale locale)
Description copied from class: Formatter
Returns an object of the appropriate type for this formatter based on the given object. The given locale is used for any conversion that may be done.

The type of the given object can by anything; it is up to each specific implementation to do the appropriate conversion, parsing, etc. to create a value of the appropriate type.

The return value may be null depending on the specific implementation for a given formatter.

Subclasses must define this method to provide type-specific conversion.

Specified by:
getValue in class Formatter
Parameters:
object - the object to convert to the type for this formatter
locale - the locale used when converting the object
Returns:
an object of the appropriate type for this formatter


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.