类 RangeArrayPropertyEditor

  • 所有已实现的接口:
    java.beans.PropertyEditor

    public class RangeArrayPropertyEditor
    extends java.beans.PropertyEditorSupport
    Property editor implementation which parses string and creates array of ranges. Ranges can be provided in any order.
    Input string should be provided in following format: 'range1, range2, range3,...' where range is specified as:
    • 'X-Y', where X is minimum value and Y is maximum value (condition X<=Y is verified)
    • or 'Z', where Z is minimum and maximum is calculated as (minimum of adjacent range - 1). Maximum of the last range is never calculated. Range stays unbound at maximum side if maximum value is not provided.
    Minimum and maximum values can be from interval <1, Integer.MAX_VALUE-1>

    Examples:
    '1, 15, 25, 38, 55-60' is equal to '1-14, 15-24, 25-37, 38-54, 55-60'
    '36, 14, 1-10, 15, 49-57' is equal to '36-48, 14-14, 1-10, 15-35, 49-57'

    Property editor also allows to validate whether ranges are disjoint. Validation can be turned on/off by using setForceDisjointRanges(boolean). By default validation is turned off.

    作者:
    peter.zozom
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      java.lang.StringgetAsText() 
      voidsetAsText​(java.lang.String text) 
      voidsetForceDisjointRanges​(boolean forceDisjointRanges)
      Set force disjoint ranges.
      • 从类继承的方法 java.beans.PropertyEditorSupport

        addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • setForceDisjointRanges

        public void setForceDisjointRanges​(boolean forceDisjointRanges)
        Set force disjoint ranges. If set to TRUE, ranges are validated to be disjoint. For example: defining ranges '1-10, 5-15' will cause IllegalArgumentException in case of forceDisjointRanges=TRUE.
        参数:
        forceDisjointRanges - true to force disjoint ranges.
      • setAsText

        public void setAsText​(java.lang.String text)
                       throws java.lang.IllegalArgumentException
        指定者:
        setAsText 在接口中 java.beans.PropertyEditor
        覆盖:
        setAsText 在类中 java.beans.PropertyEditorSupport
        抛出:
        java.lang.IllegalArgumentException
      • getAsText

        public java.lang.String getAsText()
        指定者:
        getAsText 在接口中 java.beans.PropertyEditor
        覆盖:
        getAsText 在类中 java.beans.PropertyEditorSupport