test_class.file: culvert-main/src/test/java/com/bah/culvert/constraints/ConstraintTest.java
test_class.identifier: ConstraintTest
test_case.body: @Test
    public void testCanProgressDoesntExist() {
      List<Result> resList = new ArrayList<Result>();
      for (char c = 'a'; c <= 'z'; c++) {
        List<CKeyValue> ckv = new ArrayList<CKeyValue>();
        for (int i = 1; i < 10; i++) {
          for (char C = 'A'; C <= 'Z'; C++) {
            ckv.add(new CKeyValue(Bytes.toBytes(String.format("%c", c)), Bytes
                .toBytes(String.format("%d", i)), Bytes.toBytes(String.format(
                "%c", C))));
          }
        }
        resList.add(new Result(ckv));
      }
      SeekingCurrentIterator ci = new DecoratingCurrentIterator(
          resList.iterator());
      Assert
          .assertFalse(ExposingConstraint.progressUntil(Bytes.toBytes("~"), ci));
    }
test_case.class_method_signature: ConstraintTest.testCanProgressDoesntExist()
test_case.full_signature: @Test public void testCanProgressDoesntExist()
test_case.identifier: testCanProgressDoesntExist
test_case.invocations: add toBytes format toBytes format toBytes format add iterator assertFalse progressUntil toBytes
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCanProgressDoesntExist()
focal_class.declarator: EMPTY_START_ROW = new byte[0]
focal_class.modifier: private static final
focal_class.original_string: private static final byte[] EMPTY_START_ROW = new byte[0];
focal_class.type: byte[]
focal_class.var_name: EMPTY_START_ROW
focal_class.file: culvert-main/src/main/java/com/bah/culvert/constraints/Constraint.java
focal_class.identifier: Constraint
focal_class.interfaces: implements Writable
focal_class.class_method_signature: Constraint.getResultIterator()
focal_class.full_signature: public abstract SeekingCurrentIterator getResultIterator()
focal_class.identifier: getResultIterator
focal_class.modifiers: public abstract
focal_class.parameters: ()
focal_class.return: SeekingCurrentIterator
focal_class.signature: SeekingCurrentIterator getResultIterator()
focal_class.class_method_signature: Constraint.progressUntil(byte[] key,
        SeekingCurrentIterator resultIterator)
focal_class.full_signature: protected static boolean progressUntil(byte[] key,
        SeekingCurrentIterator resultIterator)
focal_class.identifier: progressUntil
focal_class.modifiers: protected static
focal_class.parameters: (byte[] key,
        SeekingCurrentIterator resultIterator)
focal_class.return: boolean
focal_class.signature: boolean progressUntil(byte[] key,
        SeekingCurrentIterator resultIterator)
focal_class.class_method_signature: Constraint.writeToTable(TableAdapter outputTable)
focal_class.full_signature: public void writeToTable(TableAdapter outputTable)
focal_class.identifier: writeToTable
focal_class.modifiers: public
focal_class.parameters: (TableAdapter outputTable)
focal_class.return: void
focal_class.signature: void writeToTable(TableAdapter outputTable)
focal_class.class_method_signature: Constraint.writeToTable(TableAdapter outputTable, Handler filter)
focal_class.full_signature: public void writeToTable(TableAdapter outputTable, Handler filter)
focal_class.identifier: writeToTable
focal_class.modifiers: public
focal_class.parameters: (TableAdapter outputTable, Handler filter)
focal_class.return: void
focal_class.signature: void writeToTable(TableAdapter outputTable, Handler filter)
focal_class.class_method_signature: Constraint.readFromStream(DataInput in)
focal_class.full_signature: public static Constraint readFromStream(DataInput in)
focal_class.identifier: readFromStream
focal_class.modifiers: public static
focal_class.parameters: (DataInput in)
focal_class.return: Constraint
focal_class.signature: Constraint readFromStream(DataInput in)
focal_class.class_method_signature: Constraint.write(Constraint constraint, DataOutput out)
focal_class.full_signature: public static void write(Constraint constraint, DataOutput out)
focal_class.identifier: write
focal_class.modifiers: public static
focal_class.parameters: (Constraint constraint, DataOutput out)
focal_class.return: void
focal_class.signature: void write(Constraint constraint, DataOutput out)
focal_method.body: protected static boolean progressUntil(byte[] key,
        SeekingCurrentIterator resultIterator) {
      if (!resultIterator.isMarkedDoneWith()) {
        // load up the current result from the iterator
        Result current = resultIterator.current();
        byte[] currentKey = current == null ? EMPTY_START_ROW : current
            .getRecordId();
  
        int comparison = Bytes.compareTo(currentKey, key);
        // first check if we're already there.
        if (comparison == 0) {
          return true;
        } else if (comparison < 0)
        // if not and we're less, then seek and check again
        {
          resultIterator.seek(key);
          Result seeked = resultIterator.current();
          // if we went to the end, we now get a null
          if (seeked == null) {
            return false;
          }
          // if the current key is greater, we overshot
          else if ((comparison = Bytes.compareTo(seeked.getRecordId(), key)) > 0) {
            return false;
          }
          // if its equal we're good (we assume seek works)
          else {
            assert (comparison == 0);
            return true;
          }
        } else
        // otherwise we've overshot it and its not here.
        {
          return false;
        }
      }
  
      return false;
    }
focal_method.class_method_signature: Constraint.progressUntil(byte[] key,
        SeekingCurrentIterator resultIterator)
focal_method.full_signature: protected static boolean progressUntil(byte[] key,
        SeekingCurrentIterator resultIterator)
focal_method.identifier: progressUntil
focal_method.invocations: isMarkedDoneWith current getRecordId compareTo seek current compareTo getRecordId
focal_method.modifiers: protected static
focal_method.parameters: (byte[] key,
        SeekingCurrentIterator resultIterator)
focal_method.return: boolean
focal_method.signature: boolean progressUntil(byte[] key,
        SeekingCurrentIterator resultIterator)