Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## things.common.tools
Class ValidatingStringNumericComparator

    java.lang.Object
      things.common.tools.ValidatingStringNumericComparator

All Implemented Interfaces:
  java.util.Comparator<java.lang.String>

    public class ValidatingStringNumericComparator

extends java.lang.Object
implements java.util.Comparator<java.lang.String>

A validating string numeric compare. Compare the numeric value of two Integer strings. If the numbers cannt be parsed or bigger than an integer, it will throw a ClassCastException.

Version:
  1.0

  Version History

      EPG - Initial - 11 AUG 07

Author:
  Erich P. Gatejen

Constructor Summary
`ValidatingStringNumericComparator()`

Method Summary
`int` | `compare(java.lang.String o1, java.lang.String o2)` Compare two string String that should be integers represented by strings.
`boolean` | `equals(java.lang.Object obj)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ValidatingStringNumericComparator

    public ValidatingStringNumericComparator()

Method Detail

### compare

    public int compare(java.lang.String o1,
                       java.lang.String o2)

  Compare two string String that should be integers represented by strings. If either is not a valid integer, it will throw a exception.

  Specified by:
    `compare` in interface `java.util.Comparator<java.lang.String>`
  Parameters:
    `o1` - the first object to be compared
    `o2` - the second object to be compared
  Returns:
    a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
  Throws:
    `java.lang.ClassCastException` - if either string cannot be resolved to an integer.

### equals

    public boolean equals(java.lang.Object obj)

  Specified by:
    `equals` in interface `java.util.Comparator<java.lang.String>`
  Overrides:
    `equals` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Things.