Codota Logo
Range.getMin
Code IndexAdd Codota to your IDE (free)

How to use
getMin
method
in
org.springframework.batch.item.file.transform.Range

Best Java code snippets using org.springframework.batch.item.file.transform.Range.getMin (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-batch

  @Override
  public int compare(Integer r1, Integer r2) {
    return ranges[r1].getMin()-ranges[r2].getMin();
  }                                
}
origin: spring-projects/spring-batch

  private void verifyRanges(Range[] ranges) {
    //verify that ranges are disjoint		
    for(int i = 1; i < ranges.length;i++) {
      Assert.isTrue(ranges[i-1].getMax() < ranges[i].getMin(),
          "Ranges must be disjoint. Range[" + (i-1) + "]: (" + ranges[i-1] + 
          ") Range[" + i +"]: (" + ranges[i] + ")");
    }
  }
}
origin: spring-projects/spring-batch

private void calculateMaxRange(Range[] ranges) {
  if (ranges == null || ranges.length == 0) {
    maxRange = 0;
    return;
  }
  open = false;
  maxRange = ranges[0].getMin();
  for (int i = 0; i < ranges.length; i++) {
    int upperBound;
    if (ranges[i].hasMaxValue()) {
      upperBound = ranges[i].getMax();
    }
    else {
      upperBound = ranges[i].getMin();
      if (upperBound > maxRange) {
        open = true;
      }
    }
    if (upperBound > maxRange) {
      maxRange = upperBound;
    }
  }
}
origin: spring-projects/spring-batch

private void setMaxValues(final Range[] ranges) {
  
  // Array of integers to track range values by index
  Integer[] c = new Integer[ranges.length];
  for (int i=0; i<c.length; i++) {
    c[i] = i;
  }
  
  //sort array of Ranges
  Arrays.sort(c, new Comparator<Integer>() {
      @Override
      public int compare(Integer r1, Integer r2) {
        return ranges[r1].getMin()-ranges[r2].getMin();
      }                                
    }
  );
  
  //set max values for all unbound ranges (except last range)
  for (int i = 0; i < c.length - 1; i++) {
    if (!ranges[c[i]].hasMaxValue()) {
      //set max value to (min value - 1) of the next range
      ranges[c[i]] = new Range(ranges[c[i]].getMin(),ranges[c[i+1]].getMin() - 1);
    }
  }
  
  if (forceDisjointRanges) {
    verifyRanges(ranges);
  }
}

origin: spring-projects/spring-batch

int startPos = ranges[i].getMin() - 1;
int endPos = ranges[i].getMax();
origin: spring-projects/spring-batch

public void testSetAsText() {
  pe.setAsText("15, 32, 1-10, 33");
  // result should be 15-31, 32-32, 1-10, 33-unbound
  assertEquals(4, ranges.length);
  assertEquals(15, ranges[0].getMin());
  assertEquals(31, ranges[0].getMax());
  assertEquals(32, ranges[1].getMin());
  assertEquals(32, ranges[1].getMax());
  assertEquals(1, ranges[2].getMin());
  assertEquals(10, ranges[2].getMax());
  assertEquals(33, ranges[3].getMin());
  assertFalse(ranges[3].hasMaxValue());
}
origin: spring-projects/spring-batch

public void testSetAsTextWithNoSpaces() {
  pe.setAsText("15,32");
  // result should be 15-31, 32-unbound
  assertEquals(2, ranges.length);
  assertEquals(15, ranges[0].getMin());
  assertEquals(31, ranges[0].getMax());
  assertEquals(32, ranges[1].getMin());
  assertFalse(ranges[1].hasMaxValue());
}
origin: spring-projects/spring-batch

public void testValidOverlappingRanges() {
  // test joint ranges
  pe.setAsText("1-10, 5-15");
  assertEquals(2, ranges.length);
  assertEquals(1, ranges[0].getMin());
  assertEquals(10, ranges[0].getMax());
  assertEquals(5, ranges[1].getMin());
  assertEquals(15, ranges[1].getMax());
}
origin: spring-projects/spring-batch

public void testValidDisjointRanges() {
  pe.setForceDisjointRanges(true);
  // test disjoint ranges
  pe.setAsText("1-5,11-15");
  assertEquals(2, ranges.length);
  assertEquals(1, ranges[0].getMin());
  assertEquals(5, ranges[0].getMax());
  assertEquals(11, ranges[1].getMin());
  assertEquals(15, ranges[1].getMax());
}
origin: apache/servicemix-bundles

  @Override
  public int compare(Integer r1, Integer r2) {
    return ranges[r1].getMin()-ranges[r2].getMin();
  }                                
}
origin: apache/servicemix-bundles

  private void verifyRanges(Range[] ranges) {
    //verify that ranges are disjoint		
    for(int i = 1; i < ranges.length;i++) {
      Assert.isTrue(ranges[i-1].getMax() < ranges[i].getMin(),
          "Ranges must be disjoint. Range[" + (i-1) + "]: (" + ranges[i-1] + 
          ") Range[" + i +"]: (" + ranges[i] + ")");
    }
  }
}
origin: apache/servicemix-bundles

private void calculateMaxRange(Range[] ranges) {
  if (ranges == null || ranges.length == 0) {
    maxRange = 0;
    return;
  }
  open = false;
  maxRange = ranges[0].getMin();
  for (int i = 0; i < ranges.length; i++) {
    int upperBound;
    if (ranges[i].hasMaxValue()) {
      upperBound = ranges[i].getMax();
    }
    else {
      upperBound = ranges[i].getMin();
      if (upperBound > maxRange) {
        open = true;
      }
    }
    if (upperBound > maxRange) {
      maxRange = upperBound;
    }
  }
}
origin: apache/servicemix-bundles

private void setMaxValues(final Range[] ranges) {
  
  // Array of integers to track range values by index
  Integer[] c = new Integer[ranges.length];
  for (int i=0; i<c.length; i++) {
    c[i] = i;
  }
  
  //sort array of Ranges
  Arrays.sort(c, new Comparator<Integer>() {
      @Override
      public int compare(Integer r1, Integer r2) {
        return ranges[r1].getMin()-ranges[r2].getMin();
      }                                
    }
  );
  
  //set max values for all unbound ranges (except last range)
  for (int i = 0; i < c.length - 1; i++) {
    if (!ranges[c[i]].hasMaxValue()) {
      //set max value to (min value - 1) of the next range
      ranges[c[i]] = new Range(ranges[c[i]].getMin(),ranges[c[i+1]].getMin() - 1);
    }
  }
  
  if (forceDisjointRanges) {
    verifyRanges(ranges);
  }
}

origin: apache/servicemix-bundles

int startPos = ranges[i].getMin() - 1;
int endPos = ranges[i].getMax();
org.springframework.batch.item.file.transformRangegetMin

Popular methods of Range

  • <init>
  • getMax
  • hasMaxValue
  • checkMinMaxValues

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • getSystemService (Context)
  • onRequestPermissionsResult (Fragment)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now