test_class.declarator: regionSmall = new Region(0,11)
test_class.original_string: Region regionSmall = new Region(0,11);
test_class.type: Region
test_class.var_name: regionSmall
test_class.declarator: regionBig = new Region(-111,420)
test_class.original_string: Region regionBig = new Region(-111,420);
test_class.type: Region
test_class.var_name: regionBig
test_class.declarator: regionZero = new Region(0, 0)
test_class.original_string: Region regionZero = new Region(0, 0);
test_class.type: Region
test_class.var_name: regionZero
test_class.declarator: regionUndef = new Region(0, null)
test_class.original_string: Region regionUndef = new Region(0, null);
test_class.type: Region
test_class.var_name: regionUndef
test_class.declarator: stpSmall = {1,2,5}
test_class.original_string: double[] stpSmall = {1,2,5}, stpBig = {1,10,100}, nonsense = {0};
test_class.type: double[]
test_class.var_name: stpSmall
test_class.file: androidplot-core/src/test/java/com/androidplot/xy/StepModelFitTest.java
test_class.identifier: StepModelFitTest
test_case.body: @Test
      public void getValue() throws Exception {
  
          StepModelFit model = new StepModelFit(regionSmall,stpSmall,3);
  
          assertEquals(5.0, model.getValue(), 0.0);
          model.setValue(5.0);
          assertEquals(2.0, model.getValue(), 0.0);
          model.setValue(7.0);
          assertEquals(2.0, model.getValue(), 0.0);
  
          model.setSteps(stpBig);
          assertEquals(1.0, model.getValue(), 0.0);
  
          model.setScale(regionBig);
          assertEquals(100.0, model.getValue(), 0.0);
          model.setValue(1000.0);
          assertEquals(1.0, model.getValue(), 0.0);
  
          // bad parameters
          model.setSteps(nonsense);
          assertArrayEquals(stpBig,model.getSteps(), 0.0);
  
          model.setScale(regionZero);
          assertEquals(stpBig[0], model.getValue(), 0.0);
  
          model.setScale(regionUndef);
          model.setValue(1.1);
          assertEquals(1.1, model.getValue(), 0.0);
      }
test_case.class_method_signature: StepModelFitTest.getValue()
test_case.full_signature: @Test public void getValue()
test_case.identifier: getValue
test_case.invocations: assertEquals getValue setValue assertEquals getValue setValue assertEquals getValue setSteps assertEquals getValue setScale assertEquals getValue setValue assertEquals getValue setSteps assertArrayEquals getSteps setScale assertEquals getValue setScale setValue assertEquals getValue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getValue()
focal_class.declarator: steps
focal_class.modifier: private
focal_class.original_string: private double[] steps;
focal_class.type: double[]
focal_class.var_name: steps
focal_class.declarator: scale
focal_class.modifier: private
focal_class.original_string: private Region scale;
focal_class.type: Region
focal_class.var_name: scale
focal_class.file: androidplot-core/src/main/java/com/androidplot/xy/StepModelFit.java
focal_class.identifier: StepModelFit
focal_class.class_method_signature: StepModelFit.StepModelFit(Region axisRegion, double[] increments, double numLines)
focal_class.full_signature: public  StepModelFit(Region axisRegion, double[] increments, double numLines)
focal_class.identifier: StepModelFit
focal_class.modifiers: public
focal_class.parameters: (Region axisRegion, double[] increments, double numLines)
focal_class.signature:  StepModelFit(Region axisRegion, double[] increments, double numLines)
focal_class.class_method_signature: StepModelFit.getSteps()
focal_class.full_signature: public double[] getSteps()
focal_class.identifier: getSteps
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: double[]
focal_class.signature: double[] getSteps()
focal_class.class_method_signature: StepModelFit.setSteps(double[] steps)
focal_class.full_signature: public void setSteps(double[] steps)
focal_class.identifier: setSteps
focal_class.modifiers: public
focal_class.parameters: (double[] steps)
focal_class.return: void
focal_class.signature: void setSteps(double[] steps)
focal_class.class_method_signature: StepModelFit.getScale()
focal_class.full_signature: public Region getScale()
focal_class.identifier: getScale
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Region
focal_class.signature: Region getScale()
focal_class.class_method_signature: StepModelFit.setScale(Region scale)
focal_class.full_signature: public void setScale(Region scale)
focal_class.identifier: setScale
focal_class.modifiers: public
focal_class.parameters: (Region scale)
focal_class.return: void
focal_class.signature: void setScale(Region scale)
focal_class.class_method_signature: StepModelFit.getValue()
focal_class.full_signature: @Override public double getValue()
focal_class.identifier: getValue
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: double
focal_class.signature: double getValue()
focal_class.class_method_signature: StepModelFit.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.superclass: extends StepModel
focal_method.body: @Override
      public double getValue() {
  
          // no possible increments where supplied
          // or no region defined
          if (steps == null || scale == null || !scale.isDefined())
              return super.getValue();
  
          double curStep = steps[0];
          double oldDistance = Math.abs((scale.length().doubleValue() / curStep)-super.getValue() );
  
          // determine which step size comes closest to the desired number of steps
          // since steps[] is a small array brute force search is ok
          for (double step : steps) {
  
              double newDistance = Math.abs((scale.length().doubleValue() / step)-super.getValue() );
  
              // closer than previous stepping?
              if (newDistance < oldDistance){
                  curStep = step;
                  oldDistance = newDistance;
              }
          }
          return curStep;
      }
focal_method.class_method_signature: StepModelFit.getValue()
focal_method.full_signature: @Override public double getValue()
focal_method.identifier: getValue
focal_method.invocations: isDefined getValue abs doubleValue length getValue abs doubleValue length getValue
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: double
focal_method.signature: double getValue()