net.sourceforge.pmd.lang.rule.properties

## Class AbstractNumericProperty<T>

- java.lang.Object
- - net.sourceforge.pmd.lang.rule.properties.AbstractProperty<T>
  - - net.sourceforge.pmd.lang.rule.properties.AbstractScalarProperty<T>
    - - net.sourceforge.pmd.lang.rule.properties.AbstractNumericProperty<T>

- Type Parameters:
    `T` -
  All Implemented Interfaces:
    Comparable<PropertyDescriptor<?>>, NumericPropertyDescriptor<T>, PropertyDescriptor<T>
  Direct Known Subclasses:
    AbstractMultiNumericProperty, DoubleProperty, FloatProperty, IntegerProperty, LongProperty

      public abstract class AbstractNumericProperty<T>
      extends AbstractScalarProperty<T>
      implements NumericPropertyDescriptor<T>

  Maintains a pair of boundary limit values between which all values managed by the subclasses must fit.
  Author:
    Brian Remedios

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Map<String,Boolean>` | `numberFieldTypesByKey`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractNumericProperty(String theName, String theDescription, Number lower, Number upper, T theDefault, float theUIOrder)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addAttributesTo(Map<String,String> attributes)` Method addAttributesTo.
    `protected String` | `defaultAsString()`
    `Number` | `lowerLimit()` Returns the minimum value that instances of the property can have
    `String` | `rangeString()`
    `Number` | `upperLimit()` Returns the maximum value that instances of the property can have
    `protected String` | `valueErrorFor(Object value)` Returns a string describing any error the value may have when characterized by the receiver.

    - ### Methods inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractScalarProperty

      `arrayFor, createFrom, valueFrom`

    - ### Methods inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractProperty

      `areEqual, asDelimitedString, asDelimitedString, asString, attributeValuesById, choices, compareTo, defaultHasNullValue, defaultValue, description, equals, errorFor, hashCode, isArray, isMultiValue, isRequired, multiValueDelimiter, name, preferredRowCount, propertyErrorFor, toString, typeErrorFor, uiOrder, valuesErrorFor`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface net.sourceforge.pmd.PropertyDescriptor

      `asDelimitedString, attributeValuesById, choices, defaultValue, description, errorFor, isMultiValue, isRequired, multiValueDelimiter, name, preferredRowCount, propertyErrorFor, type, uiOrder, valueFrom`

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

- - ### Field Detail

    - #### numberFieldTypesByKey

          public static final Map<String,Boolean> numberFieldTypesByKey

  - ### Constructor Detail

    - #### AbstractNumericProperty

          protected AbstractNumericProperty(String theName,
                                 String theDescription,
                                 Number lower,
                                 Number upper,
                                 T theDefault,
                                 float theUIOrder)

      Parameters:
        `theName` -
        `theDescription` -
        `lower` -
        `upper` -
        `theDefault` -
        `theUIOrder` -
      Throws:
        `IllegalArgumentException`

  - ### Method Detail

    - #### lowerLimit

          public Number lowerLimit()

      Returns the minimum value that instances of the property can have
      Specified by:
        `lowerLimit` in interface `NumericPropertyDescriptor<T>`
      Returns:
        The minimum value.
      See Also:
        `NumericPropertyDescriptor.lowerLimit()`

    - #### defaultAsString

          protected String defaultAsString()

      Specified by:
        `defaultAsString` in class `AbstractProperty<T>`
      Returns:
        String

    - #### upperLimit

          public Number upperLimit()

      Returns the maximum value that instances of the property can have
      Specified by:
        `upperLimit` in interface `NumericPropertyDescriptor<T>`
      Returns:
        The maximum value.
      See Also:
        `NumericPropertyDescriptor.upperLimit()`

    - #### rangeString

          public String rangeString()

      Returns:
        String

    - #### valueErrorFor

          protected String valueErrorFor(Object value)

      Returns a string describing any error the value may have when characterized by the receiver.
      Overrides:
        `valueErrorFor` in class `AbstractProperty<T>`
      Parameters:
        `value` - Object
      Returns:
        String

    - #### addAttributesTo

          protected void addAttributesTo(Map<String,String> attributes)

      Method addAttributesTo.
      Overrides:
        `addAttributesTo` in class `AbstractProperty<T>`
      Parameters:
        `attributes` - Map

Copyright © 2002-2013 InfoEther. All Rights Reserved.