1 11 package org.eclipse.ltk.core.refactoring; 12 13 import org.eclipse.core.runtime.Assert; 14 import org.eclipse.core.runtime.IProgressMonitor; 15 16 23 public class RefactoringTickProvider { 24 25 28 public final static RefactoringTickProvider DEFAULT= new RefactoringTickProvider(4, 40, 22, 11); 29 30 private int[] fValues; 31 32 private static final int CHECK_INITIAL_CONDITIONS= 0; 33 private static final int CHECK_FINAL_CONDITIONS= 1; 34 private static final int CREATE_CHANGE= 2; 35 private static final int INITIALIZE_CHANGE= 3; 36 37 47 public RefactoringTickProvider( 48 int checkInitialConditionsTicks, 49 int checkFinalConditionsTicks, 50 int createChangeTicks, 51 int initializeChangeTicks) { 52 Assert.isTrue(checkInitialConditionsTicks >= 0 && checkFinalConditionsTicks >= 0 && 53 createChangeTicks >= 0 && initializeChangeTicks >= 0); 54 55 fValues= new int[4]; 56 fValues[CHECK_INITIAL_CONDITIONS]= checkInitialConditionsTicks; 57 fValues[CHECK_FINAL_CONDITIONS]= checkFinalConditionsTicks; 58 fValues[CREATE_CHANGE]= createChangeTicks; 59 fValues[INITIALIZE_CHANGE]= initializeChangeTicks; 60 } 61 62 68 public int getAllTicks() { 69 return getCheckAllConditionsTicks() + fValues[CREATE_CHANGE] + fValues[INITIALIZE_CHANGE]; 70 } 71 72 78 public int getCheckAllConditionsTicks() { 79 return fValues[CHECK_INITIAL_CONDITIONS] + fValues[CHECK_FINAL_CONDITIONS]; 80 } 81 82 88 public int getCheckInitialConditionsTicks() { 89 return fValues[CHECK_INITIAL_CONDITIONS]; 90 } 91 92 98 public int getCheckFinalConditionsTicks() { 99 return fValues[CHECK_FINAL_CONDITIONS]; 100 } 101 102 108 public int getCreateChangeTicks() { 109 return fValues[CREATE_CHANGE]; 110 } 111 112 119 public int getInitializeChangeTicks() { 120 return fValues[INITIALIZE_CHANGE]; 121 } 122 } | Popular Tags |