Commons Lang
  1. Commons Lang
  2. LANG-386

LeftOf/RightOfNumber in Range convenience methods necessary

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 3.0
    • Component/s: lang.*
    • Labels:
      None

      Description

      I've using Ranges recently and found then insufficent in methods.
      I cand check if my numbers is in the Range or not but I cant check on which side of the Range it is.
      This is my idea:

      Range range = new Range(0,5);

      boolean outsided = range.leftOfInteger(-5);
      outsided equals true
      boolean outsided = range.leftOfInteger(5);
      outsided equals tfase

      same applies for rightOf

      another convenience method would be:

      create 3 final static int field:

      Range.LEFT_OF = -1;
      Range.INSIDE = 0;
      Range.RIGHT_OF = 1;

      range.positionOfInteger(-2) returns LEFT_OF
      and so forth

      it is some refactoring of contains and the upper methods.

      it would increase functionality

        Issue Links

          Activity

          Mark Thomas made changes -
          Reporter Michael Osipov [ michaelo ] Michael Osipov [ michael-o ]
          Mark Thomas made changes -
          Workflow jira [ 12419821 ] Default workflow, editable Closed status [ 12602597 ]
          Henri Yandell made changes -
          Component/s lang.* [ 12313203 ]
          Henri Yandell made changes -
          Link This issue relates to LANG-551 [ LANG-551 ]
          Henri Yandell made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Henri Yandell made changes -
          Field Original Value New Value
          Fix Version/s 3.0 [ 12311714 ]
          michaelo created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Michael Osipov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development