/** * Creates a new dewey number from this such that its last digit is increased by * one. * * @return A new dewey number derived from this whose last digit is increased by one */ public DeweyNumber increase() { return increase(1); }
outgoingEdges.getTotalIgnoreBranches(), outgoingEdges.getTotalTakeBranches()); version = computationState.getVersion().increase(toIncrease); } else { .increase(totalTakeToSkip + ignoreBranchesToVisit) .addStage(); ignoreBranchesToVisit--; final DeweyNumber currentVersion = computationState.getVersion().increase(takeBranchesToVisit); final DeweyNumber nextVersion = new DeweyNumber(currentVersion).addStage(); takeBranchesToVisit--; outgoingEdges.getTotalTakeBranches()); DeweyNumber startVersion = computationState.getVersion().increase(totalBranches); ComputationState startState = ComputationState.createStartState(computationState.getCurrentStateName(), startVersion); resultingComputationStates.add(startState);
@Test public void testDeweyNumberGeneration() { DeweyNumber start = new DeweyNumber(1); DeweyNumber increased = start.increase(); DeweyNumber increaseAddStage = increased.addStage(); DeweyNumber startAddStage = start.addStage(); DeweyNumber startAddStageIncreased = startAddStage.increase(); DeweyNumber startAddStageIncreasedAddStage = startAddStageIncreased.addStage(); assertEquals(DeweyNumber.fromString("1"), start); assertEquals(DeweyNumber.fromString("2"), increased); assertEquals(DeweyNumber.fromString("2.0"), increaseAddStage); assertEquals(DeweyNumber.fromString("1.0"), startAddStage); assertEquals(DeweyNumber.fromString("1.1"), startAddStageIncreased); assertEquals(DeweyNumber.fromString("1.1.0"), startAddStageIncreasedAddStage); assertTrue(startAddStage.isCompatibleWith(start)); assertTrue(startAddStageIncreased.isCompatibleWith(startAddStage)); assertTrue(startAddStageIncreasedAddStage.isCompatibleWith(startAddStageIncreased)); assertFalse(startAddStageIncreasedAddStage.isCompatibleWith(startAddStage)); assertFalse(increaseAddStage.isCompatibleWith(startAddStage)); assertFalse(startAddStage.isCompatibleWith(increaseAddStage)); assertFalse(startAddStageIncreased.isCompatibleWith(startAddStageIncreasedAddStage)); } }
/** * Creates a new dewey number from this such that its last digit is increased by * one. * * @return A new dewey number derived from this whose last digit is increased by one */ public DeweyNumber increase() { return increase(1); }
/** * Creates a new dewey number from this such that its last digit is increased by * one. * * @return A new dewey number derived from this whose last digit is increased by one */ public DeweyNumber increase() { return increase(1); }
/** * Creates a new dewey number from this such that its last digit is increased by * one. * * @return A new dewey number derived from this whose last digit is increased by one */ public DeweyNumber increase() { return increase(1); }
outgoingEdges.getTotalIgnoreBranches(), outgoingEdges.getTotalTakeBranches()); version = computationState.getVersion().increase(toIncrease); } else { .increase(totalTakeToSkip + ignoreBranchesToVisit) .addStage(); ignoreBranchesToVisit--; final DeweyNumber currentVersion = computationState.getVersion().increase(takeBranchesToVisit); final DeweyNumber nextVersion = new DeweyNumber(currentVersion).addStage(); takeBranchesToVisit--; outgoingEdges.getTotalTakeBranches()); DeweyNumber startVersion = computationState.getVersion().increase(totalBranches); ComputationState startState = ComputationState.createStartState(computationState.getCurrentStateName(), startVersion); resultingComputationStates.add(startState);
outgoingEdges.getTotalIgnoreBranches(), outgoingEdges.getTotalTakeBranches()); version = computationState.getVersion().increase(toIncrease); } else { .increase(totalTakeToSkip + ignoreBranchesToVisit) .addStage(); ignoreBranchesToVisit--; final DeweyNumber currentVersion = computationState.getVersion().increase(takeBranchesToVisit); final DeweyNumber nextVersion = new DeweyNumber(currentVersion).addStage(); takeBranchesToVisit--; outgoingEdges.getTotalTakeBranches()); DeweyNumber startVersion = computationState.getVersion().increase(totalBranches); ComputationState startState = ComputationState.createStartState(computationState.getCurrentStateName(), startVersion); resultingComputationStates.add(startState);
outgoingEdges.getTotalIgnoreBranches(), outgoingEdges.getTotalTakeBranches()); version = computationState.getVersion().increase(toIncrease); } else { .increase(totalTakeToSkip + ignoreBranchesToVisit) .addStage(); ignoreBranchesToVisit--; final DeweyNumber currentVersion = computationState.getVersion().increase(takeBranchesToVisit); final DeweyNumber nextVersion = new DeweyNumber(currentVersion).addStage(); takeBranchesToVisit--; outgoingEdges.getTotalTakeBranches()); DeweyNumber startVersion = computationState.getVersion().increase(totalBranches); ComputationState<T> startState = ComputationState.createStartState(this, computationState.getState(), startVersion); resultingComputationStates.add(startState);