target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void test1() { String input = "(1+0*1)"; ParseBoolean tester = new ParseBoolean(input); int testResults = tester.parse(); assertEquals("Result",1, testResults ); }
public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = expression.replac...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
@Test public void test3() { String input = "0"; ParseBooleanOriginal tester = new ParseBooleanOriginal(input); int testResults = tester.process(); assertEquals("Result",0, testResults ); }
public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input); if(m1.find() || m2.f...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
@Test public void test4() { String input = "0 * 1 * 1"; ParseBooleanOriginal tester = new ParseBooleanOriginal(input); int testResults = tester.process(); assertEquals("Result",0, testResults ); }
public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input); if(m1.find() || m2.f...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
@Test public void test5() { String input = "(1+0)"; ParseBooleanOriginal tester = new ParseBooleanOriginal(input); int testResults = tester.process(); assertEquals("Result",1, testResults ); }
public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input); if(m1.find() || m2.f...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
@Test public void test6() { String input = "!0 * 0 + 1"; ParseBooleanOriginal tester = new ParseBooleanOriginal(input); int testResults = tester.process(); assertEquals("Result",1, testResults ); }
public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input); if(m1.find() || m2.f...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
@Test public void test7() { String input = "(0+1) * (1+0)"; ParseBooleanOriginal tester = new ParseBooleanOriginal(input); int testResults = tester.process(); assertEquals("Result",1, testResults ); }
public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input); if(m1.find() || m2.f...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
@Test public void test8() { String input = "((0+0+(1+!1+!(0 + !(0*1+0*1*1+1*0)+1)+0*1)+1*0*0)+0*1)"; ParseBooleanOriginal tester = new ParseBooleanOriginal(input); int testResults = tester.process(); assertEquals("Result",1, testResults ); }
public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input); if(m1.find() || m2.f...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
@Test public void testTooManyInAFamily() { String names = "A Smith, B Smith, C Smith, D Andersen, E Andersen"; String[] nameList = names.split(","); SecretSantaFinder ssf = new SecretSantaFinder(nameList); assertEquals(ssf.pair(), null); }
public Map<String, String> pair() { List<Family> families = new ArrayList<Family>(); if(2*maxFamilyMembers > totalNames){ return null; } for(String key: familyMembers.keySet()) { families.add(familyMembers.get(key)) ; } Collections.sort(families); List<String> receiveList = new ArrayList<String>(totalNames); List<Strin...
SecretSantaFinder { public Map<String, String> pair() { List<Family> families = new ArrayList<Family>(); if(2*maxFamilyMembers > totalNames){ return null; } for(String key: familyMembers.keySet()) { families.add(familyMembers.get(key)) ; } Collections.sort(families); List<String> receiveList = new ArrayList<String>(tot...
SecretSantaFinder { public Map<String, String> pair() { List<Family> families = new ArrayList<Family>(); if(2*maxFamilyMembers > totalNames){ return null; } for(String key: familyMembers.keySet()) { families.add(familyMembers.get(key)) ; } Collections.sort(families); List<String> receiveList = new ArrayList<String>(tot...
SecretSantaFinder { public Map<String, String> pair() { List<Family> families = new ArrayList<Family>(); if(2*maxFamilyMembers > totalNames){ return null; } for(String key: familyMembers.keySet()) { families.add(familyMembers.get(key)) ; } Collections.sort(families); List<String> receiveList = new ArrayList<String>(tot...
SecretSantaFinder { public Map<String, String> pair() { List<Family> families = new ArrayList<Family>(); if(2*maxFamilyMembers > totalNames){ return null; } for(String key: familyMembers.keySet()) { families.add(familyMembers.get(key)) ; } Collections.sort(families); List<String> receiveList = new ArrayList<String>(tot...
@Test public void testUnique() { String names = "A Smith, B Smith, C Smith, D Andersen, E Andersen,F Andersen, G Jackson"; String[] nameList = names.split(","); SecretSantaFinder ssf = new SecretSantaFinder(nameList); Map<String,String> pairs = ssf.pair(); assertEquals(pairs.size(), 7); for(String key: pairs.keySet()) ...
public Map<String, String> pair() { List<Family> families = new ArrayList<Family>(); if(2*maxFamilyMembers > totalNames){ return null; } for(String key: familyMembers.keySet()) { families.add(familyMembers.get(key)) ; } Collections.sort(families); List<String> receiveList = new ArrayList<String>(totalNames); List<Strin...
SecretSantaFinder { public Map<String, String> pair() { List<Family> families = new ArrayList<Family>(); if(2*maxFamilyMembers > totalNames){ return null; } for(String key: familyMembers.keySet()) { families.add(familyMembers.get(key)) ; } Collections.sort(families); List<String> receiveList = new ArrayList<String>(tot...
SecretSantaFinder { public Map<String, String> pair() { List<Family> families = new ArrayList<Family>(); if(2*maxFamilyMembers > totalNames){ return null; } for(String key: familyMembers.keySet()) { families.add(familyMembers.get(key)) ; } Collections.sort(families); List<String> receiveList = new ArrayList<String>(tot...
SecretSantaFinder { public Map<String, String> pair() { List<Family> families = new ArrayList<Family>(); if(2*maxFamilyMembers > totalNames){ return null; } for(String key: familyMembers.keySet()) { families.add(familyMembers.get(key)) ; } Collections.sort(families); List<String> receiveList = new ArrayList<String>(tot...
SecretSantaFinder { public Map<String, String> pair() { List<Family> families = new ArrayList<Family>(); if(2*maxFamilyMembers > totalNames){ return null; } for(String key: familyMembers.keySet()) { families.add(familyMembers.get(key)) ; } Collections.sort(families); List<String> receiveList = new ArrayList<String>(tot...
@Test public void testOneCyclicPair() { String[] input = {"abc","acb", "cab"}; CyclicWordsKata tester = new CyclicWordsKata(input); List<List<String>> results = tester.process(); assertEquals("Result", 2, results.size()); }
public List<List<String>> process() { List<List<String>> processed = new ArrayList<List<String>>(); Map<Integer,List<String>> buckets ; List<List<String>> returnArray ; buckets = separateInputBySize(_input); if(buckets == null) return processed; for(int size: buckets.keySet()) { List<String> elements = buckets.get(size...
CyclicWordsKata { public List<List<String>> process() { List<List<String>> processed = new ArrayList<List<String>>(); Map<Integer,List<String>> buckets ; List<List<String>> returnArray ; buckets = separateInputBySize(_input); if(buckets == null) return processed; for(int size: buckets.keySet()) { List<String> elements ...
CyclicWordsKata { public List<List<String>> process() { List<List<String>> processed = new ArrayList<List<String>>(); Map<Integer,List<String>> buckets ; List<List<String>> returnArray ; buckets = separateInputBySize(_input); if(buckets == null) return processed; for(int size: buckets.keySet()) { List<String> elements ...
CyclicWordsKata { public List<List<String>> process() { List<List<String>> processed = new ArrayList<List<String>>(); Map<Integer,List<String>> buckets ; List<List<String>> returnArray ; buckets = separateInputBySize(_input); if(buckets == null) return processed; for(int size: buckets.keySet()) { List<String> elements ...
CyclicWordsKata { public List<List<String>> process() { List<List<String>> processed = new ArrayList<List<String>>(); Map<Integer,List<String>> buckets ; List<List<String>> returnArray ; buckets = separateInputBySize(_input); if(buckets == null) return processed; for(int size: buckets.keySet()) { List<String> elements ...
@Test public void testNull() { String[] input = null; CyclicWordsKata tester = new CyclicWordsKata(input); List<List<String>> results = tester.process(); assertNull("results", results); }
public List<List<String>> process() { List<List<String>> processed = new ArrayList<List<String>>(); Map<Integer,List<String>> buckets ; List<List<String>> returnArray ; buckets = separateInputBySize(_input); if(buckets == null) return processed; for(int size: buckets.keySet()) { List<String> elements = buckets.get(size...
CyclicWordsKata { public List<List<String>> process() { List<List<String>> processed = new ArrayList<List<String>>(); Map<Integer,List<String>> buckets ; List<List<String>> returnArray ; buckets = separateInputBySize(_input); if(buckets == null) return processed; for(int size: buckets.keySet()) { List<String> elements ...
CyclicWordsKata { public List<List<String>> process() { List<List<String>> processed = new ArrayList<List<String>>(); Map<Integer,List<String>> buckets ; List<List<String>> returnArray ; buckets = separateInputBySize(_input); if(buckets == null) return processed; for(int size: buckets.keySet()) { List<String> elements ...
CyclicWordsKata { public List<List<String>> process() { List<List<String>> processed = new ArrayList<List<String>>(); Map<Integer,List<String>> buckets ; List<List<String>> returnArray ; buckets = separateInputBySize(_input); if(buckets == null) return processed; for(int size: buckets.keySet()) { List<String> elements ...
CyclicWordsKata { public List<List<String>> process() { List<List<String>> processed = new ArrayList<List<String>>(); Map<Integer,List<String>> buckets ; List<List<String>> returnArray ; buckets = separateInputBySize(_input); if(buckets == null) return processed; for(int size: buckets.keySet()) { List<String> elements ...
@Test public void test2() { String input = "(!0)"; ParseBoolean tester = new ParseBoolean(input); int testResults = tester.parse(); assertEquals("Result",1, testResults ); }
public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = expression.replac...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
@Test public void test1() { int input = 1879; ParseRomanNumerals tester = new ParseRomanNumerals(input); String testResults = tester.parse(); assertEquals("Result","MDCCCLXXIX", testResults ); }
public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } returnValue = prefix + p...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
@Test public void test2() { int input = 1; ParseRomanNumerals tester = new ParseRomanNumerals(input); String testResults = tester.parse(); assertEquals("Result","I", testResults ); }
public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } returnValue = prefix + p...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
@Test public void test3() { int input = 2010; ParseRomanNumerals tester = new ParseRomanNumerals(input); String testResults = tester.parse(); assertEquals("Result","MMX", testResults ); }
public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } returnValue = prefix + p...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
@Test public void test4() { int input = 47; ParseRomanNumerals tester = new ParseRomanNumerals(input); String testResults = tester.parse(); assertEquals("Result","XLVII", testResults ); }
public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } returnValue = prefix + p...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
@Test public void test5() { int input = 3888; ParseRomanNumerals tester = new ParseRomanNumerals(input); String testResults = tester.parse(); assertEquals("Result","MMMDCCCLXXXVIII", testResults ); }
public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } returnValue = prefix + p...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
ParseRomanNumerals { public String parse() { String returnValue = ""; String prefix = ""; String suffix = ""; while(_input/1000 > 0 ) { int current = _input/1000; int toBeParsed = _input%1000; returnValue = prefix + parseUnder1000(toBeParsed) + suffix + returnValue; _input = current; prefix += "("; suffix += ")"; } ret...
@Test public void test1 () { StateMachine fsm = new StateMachine("0,1", "EVEN:pass,ODD:fail,BAD:fail", "EVEN:ODD:1,ODD:EVEN:1,ODD:BAD:0"); assertEquals("pass", fsm.execute("00110")); assertEquals("fail", fsm.execute("00111")); assertEquals("fail", fsm.execute("001110000110011")); assertEquals("fail", null,fsm.execute("...
public String execute(String input) { String startState = entryState; for(int i = 0; i < input.length();i++){ char event = input.charAt(i) ; if(_symbols.indexOf(event) < 0) { return null; } String key = startState + "_" + event; if (endStates.containsKey(key)) { startState = endStates.get(key); } } if (states.containsK...
StateMachine { public String execute(String input) { String startState = entryState; for(int i = 0; i < input.length();i++){ char event = input.charAt(i) ; if(_symbols.indexOf(event) < 0) { return null; } String key = startState + "_" + event; if (endStates.containsKey(key)) { startState = endStates.get(key); } } if (s...
StateMachine { public String execute(String input) { String startState = entryState; for(int i = 0; i < input.length();i++){ char event = input.charAt(i) ; if(_symbols.indexOf(event) < 0) { return null; } String key = startState + "_" + event; if (endStates.containsKey(key)) { startState = endStates.get(key); } } if (s...
StateMachine { public String execute(String input) { String startState = entryState; for(int i = 0; i < input.length();i++){ char event = input.charAt(i) ; if(_symbols.indexOf(event) < 0) { return null; } String key = startState + "_" + event; if (endStates.containsKey(key)) { startState = endStates.get(key); } } if (s...
StateMachine { public String execute(String input) { String startState = entryState; for(int i = 0; i < input.length();i++){ char event = input.charAt(i) ; if(_symbols.indexOf(event) < 0) { return null; } String key = startState + "_" + event; if (endStates.containsKey(key)) { startState = endStates.get(key); } } if (s...
@Test public void test3() { String input = "0"; ParseBoolean tester = new ParseBoolean(input); int testResults = tester.parse(); assertEquals("Result",0, testResults ); }
public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = expression.replac...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
@Test public void test4() { String input = "0 * 1 * 1"; ParseBoolean tester = new ParseBoolean(input); int testResults = tester.parse(); assertEquals("Result",0, testResults ); }
public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = expression.replac...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
@Test public void test5() { String input = "(1+0)"; ParseBoolean tester = new ParseBoolean(input); int testResults = tester.parse(); assertEquals("Result",1, testResults ); }
public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = expression.replac...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
@Test public void test6() { String input = "!0 * 0 + 1"; ParseBoolean tester = new ParseBoolean(input); int testResults = tester.parse(); assertEquals("Result",1, testResults ); }
public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = expression.replac...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
@Test public void test7() { String input = "(0+1) * (1+0)"; ParseBoolean tester = new ParseBoolean(input); int testResults = tester.parse(); assertEquals("Result",1, testResults ); }
public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = expression.replac...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
@Test public void test8() { String input = "((0+0+(1+!1+!(0 + !(0*1+0*1*1+1*0)+1)+0*1)+1*0*0)+0*1)"; ParseBoolean tester = new ParseBoolean(input); int testResults = tester.parse(); assertEquals("Result",1, testResults ); }
public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = expression.replac...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
ParseBoolean { public int parse() { String expression = " if(" + _input + "){" + "returnValue = VALUEA;" + "}" + " else { returnValue = VALUEB; }"; expression = expression.replaceAll("0", " false " ); expression = expression.replaceAll("1", " true " ); expression = expression.replaceAll("\\*", " && " ); expression = ex...
@Test public void test1() { String input = "(1+0*1)"; ParseBooleanOriginal tester = new ParseBooleanOriginal(input); int testResults = tester.process(); assertEquals("Result",1, testResults ); }
public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input); if(m1.find() || m2.f...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
@Test public void test2() { String input = "(!0)"; ParseBooleanOriginal tester = new ParseBooleanOriginal(input); int testResults = tester.process(); assertEquals("Result",1, testResults ); }
public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input); if(m1.find() || m2.f...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
ParseBooleanOriginal { public int process() { _input = _input.replaceAll(" ", ""); _input = _input.replaceAll("!1", "0"); _input = _input.replaceAll("!0", "1"); Matcher m = p.matcher(_input); if(m.find()) { _input = _input.substring(1,_input.length()-1); } Matcher m1 = p1.matcher(_input); Matcher m2 = p2.matcher(_input...
@Test(expected = IllegalArgumentException.class) public void illegalFlagsShouldBeDetected() { ShellMode mode = ShellMode.from("--interactive --foo"); }
public static ShellMode from(String... arguments) { if (runInBatchMode(arguments)) { return new BatchMode(extractCommand(arguments)); } return new InteractiveMode(); }
ShellMode { public static ShellMode from(String... arguments) { if (runInBatchMode(arguments)) { return new BatchMode(extractCommand(arguments)); } return new InteractiveMode(); } }
ShellMode { public static ShellMode from(String... arguments) { if (runInBatchMode(arguments)) { return new BatchMode(extractCommand(arguments)); } return new InteractiveMode(); } }
ShellMode { public static ShellMode from(String... arguments) { if (runInBatchMode(arguments)) { return new BatchMode(extractCommand(arguments)); } return new InteractiveMode(); } static String usage(); static ShellMode from(String... arguments); static ShellMode batch(String command); static ShellMode interactive(); ...
ShellMode { public static ShellMode from(String... arguments) { if (runInBatchMode(arguments)) { return new BatchMode(extractCommand(arguments)); } return new InteractiveMode(); } static String usage(); static ShellMode from(String... arguments); static ShellMode batch(String command); static ShellMode interactive(); ...
@Test public void toFileShouldCreateANonEmptyFile() throws FileNotFoundException { final ShellCommand script = script(history(), version(), exit()); final String destination = "test.txt"; script.toFile(destination); File file = new File(destination); assertThat("no file generated!", file.exists()); assertThat("empty fi...
public Script(List<ShellCommand> commands) { this.commands = new ArrayList<ShellCommand>(commands); }
Script extends ShellCommand implements Iterable<ShellCommand> { public Script(List<ShellCommand> commands) { this.commands = new ArrayList<ShellCommand>(commands); } }
Script extends ShellCommand implements Iterable<ShellCommand> { public Script(List<ShellCommand> commands) { this.commands = new ArrayList<ShellCommand>(commands); } Script(List<ShellCommand> commands); }
Script extends ShellCommand implements Iterable<ShellCommand> { public Script(List<ShellCommand> commands) { this.commands = new ArrayList<ShellCommand>(commands); } Script(List<ShellCommand> commands); @Override void execute(ShellCommandHandler handler); Iterator<ShellCommand> iterator(); @Override int hashCode(); @Ov...
Script extends ShellCommand implements Iterable<ShellCommand> { public Script(List<ShellCommand> commands) { this.commands = new ArrayList<ShellCommand>(commands); } Script(List<ShellCommand> commands); @Override void execute(ShellCommandHandler handler); Iterator<ShellCommand> iterator(); @Override int hashCode(); @Ov...
@Test public void generatedScriptsShouldBeReadble() throws Exception { final String destination = "test.txt"; final ShellCommand script = script(history(), version(), exit()); try { script.toFile(destination); final ShellCommand script2 = fromFile(destination); assertThat("Different files", script2, is(equalTo(script))...
public Script(List<ShellCommand> commands) { this.commands = new ArrayList<ShellCommand>(commands); }
Script extends ShellCommand implements Iterable<ShellCommand> { public Script(List<ShellCommand> commands) { this.commands = new ArrayList<ShellCommand>(commands); } }
Script extends ShellCommand implements Iterable<ShellCommand> { public Script(List<ShellCommand> commands) { this.commands = new ArrayList<ShellCommand>(commands); } Script(List<ShellCommand> commands); }
Script extends ShellCommand implements Iterable<ShellCommand> { public Script(List<ShellCommand> commands) { this.commands = new ArrayList<ShellCommand>(commands); } Script(List<ShellCommand> commands); @Override void execute(ShellCommandHandler handler); Iterator<ShellCommand> iterator(); @Override int hashCode(); @Ov...
Script extends ShellCommand implements Iterable<ShellCommand> { public Script(List<ShellCommand> commands) { this.commands = new ArrayList<ShellCommand>(commands); } Script(List<ShellCommand> commands); @Override void execute(ShellCommandHandler handler); Iterator<ShellCommand> iterator(); @Override int hashCode(); @Ov...
@Test public void temporaryAuthToken() throws Exception { SessionManager mockManager = mock(SessionManager.class); when(mockManager.storeNewTempToken()).thenReturn("dummyToken"); AuthResource resource = new AuthResource(mockManager, null, "localhost"); TempTokenResponse response = resource.temporaryAuthToken("doc"); as...
public TempTokenResponse temporaryAuthToken(String scope) throws StorageException, UnsupportedEncodingException { if (Strings.isNullOrEmpty(scope)) { scope = "all"; } String tempToken = sessionManager.storeNewTempToken(); String xanauthURL = "xanauth: + URLEncoder.encode(scope, "UTF-8"); TempTokenResponse tempTokenResp...
AuthResource { public TempTokenResponse temporaryAuthToken(String scope) throws StorageException, UnsupportedEncodingException { if (Strings.isNullOrEmpty(scope)) { scope = "all"; } String tempToken = sessionManager.storeNewTempToken(); String xanauthURL = "xanauth: + URLEncoder.encode(scope, "UTF-8"); TempTokenRespons...
AuthResource { public TempTokenResponse temporaryAuthToken(String scope) throws StorageException, UnsupportedEncodingException { if (Strings.isNullOrEmpty(scope)) { scope = "all"; } String tempToken = sessionManager.storeNewTempToken(); String xanauthURL = "xanauth: + URLEncoder.encode(scope, "UTF-8"); TempTokenRespons...
AuthResource { public TempTokenResponse temporaryAuthToken(String scope) throws StorageException, UnsupportedEncodingException { if (Strings.isNullOrEmpty(scope)) { scope = "all"; } String tempToken = sessionManager.storeNewTempToken(); String xanauthURL = "xanauth: + URLEncoder.encode(scope, "UTF-8"); TempTokenRespons...
AuthResource { public TempTokenResponse temporaryAuthToken(String scope) throws StorageException, UnsupportedEncodingException { if (Strings.isNullOrEmpty(scope)) { scope = "all"; } String tempToken = sessionManager.storeNewTempToken(); String xanauthURL = "xanauth: + URLEncoder.encode(scope, "UTF-8"); TempTokenRespons...
@Test public void addWeightsOfRightLeaningChildNodesNoChildren() throws Exception { Node<InvariantSpan> x = new Node<>(new InvariantSpan(1, 1, documentHash)); assertEquals(0, RopeUtils.addWeightsOfRightLeaningChildNodes(x)); }
public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); }
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); } }
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); } }
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static long addWeightsOfRightLeaning...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static long addWeightsOfRightLeaning...
@Test public void addWeightsOfRightLeaningChildNodesNullNode() throws Exception { assertEquals(0, RopeUtils.addWeightsOfRightLeaningChildNodes(null)); }
public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); }
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); } }
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); } }
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static long addWeightsOfRightLeaning...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static long addWeightsOfRightLeaning...
@Test public void addWeightsOfRightLeaningChildNodesSimple() throws Exception { Node<InvariantSpan> right = new Node<>(new InvariantSpan(1, 10, documentHash)); Node<InvariantSpan> x = new Node.Builder<InvariantSpan>(0).right(right).build(); assertEquals(10, RopeUtils.addWeightsOfRightLeaningChildNodes(x)); }
public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); }
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); } }
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); } }
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static long addWeightsOfRightLeaning...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningChildNodes(Node<T> x) { if (x == null || x.right == null) { return 0; } return x.right.weight + addWeightsOfRightLeaningChildNodes(x.right); } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static long addWeightsOfRightLeaning...
@Test public void addWeightsOfRightLeaningParentNodesChainedRight() throws Exception { Node<InvariantSpan> right2 = new Node<>(new InvariantSpan(1, 3, documentHash)); Node<InvariantSpan> right = new Node.Builder<InvariantSpan>(1).right(right2).build(); new Node.Builder<InvariantSpan>(1).right(right).build(); assertEqua...
public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParentNodes(child...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
@Test public void addWeightsOfRightLeaningParentNodesLeftNodeChild() throws Exception { Node<InvariantSpan> left = new Node<>(new InvariantSpan(1, 1, documentHash)); new Node.Builder<InvariantSpan>(1).left(left).build(); assertEquals(0, RopeUtils.addWeightsOfRightLeaningParentNodes(left)); }
public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParentNodes(child...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
@Test(expected = IllegalStateException.class) public void addWeightsOfRightLeaningParentNodesNull() throws Exception { RopeUtils.addWeightsOfRightLeaningParentNodes(null); }
public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParentNodes(child...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
@Test public void addWeightsOfRightLeaningParentNodesNullParent() throws Exception { Node<InvariantSpan> x = new Node<>(new InvariantSpan(1, 1, documentHash)); assertEquals(0, RopeUtils.addWeightsOfRightLeaningParentNodes(x)); }
public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParentNodes(child...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
@Test public void addWeightsOfRightLeaningParentNodesRightNodeChild() throws Exception { Node<InvariantSpan> right = new Node<>(new InvariantSpan(1, 1, documentHash)); new Node.Builder<InvariantSpan>(1).right(right).build(); assertEquals(1, RopeUtils.addWeightsOfRightLeaningParentNodes(right)); }
public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParentNodes(child...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
RopeUtils { public static <T extends StreamElement> long addWeightsOfRightLeaningParentNodes(Node<T> child) { if (child == null) { throw new IllegalStateException("child node can't be null"); } if (child.parent == null) { return 0; } return (child.isRightNode() ? child.parent.weight : 0) + addWeightsOfRightLeaningParen...
@Test public void characterCount() throws Exception { Node<InvariantSpan> right = new Node<>(new InvariantSpan(1, 10, documentHash)); Node<InvariantSpan> right2 = new Node<>(new InvariantSpan(1, 20, documentHash)); right.right = right2; Node<InvariantSpan> x = new Node.Builder<InvariantSpan>(10).right(right).build(); a...
public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); }
RopeUtils { public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); } }
RopeUtils { public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); } }
RopeUtils { public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static long addWeightsOfRightLeaningPare...
RopeUtils { public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static long addWeightsOfRightLeaningPare...
@Test public void characterCountLeafNode() throws Exception { assertEquals(3, RopeUtils.characterCount(new Node<>(new InvariantSpan(1, 3, documentHash)))); }
public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); }
RopeUtils { public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); } }
RopeUtils { public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); } }
RopeUtils { public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static long addWeightsOfRightLeaningPare...
RopeUtils { public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static long addWeightsOfRightLeaningPare...
@Test public void equalsTrue() throws Exception { ApplyOverlayOp op1 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); ApplyOverlayOp op2 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); assertTrue(op1.equals(op2)); assertTrue(op2.equals(op1)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ApplyOverlayOp other = (ApplyOverlayOp) obj; if (!linkTypes.equals(other.linkTypes)) return false; if (!variantSpan.equals(other.variantSpan)) return false; r...
ApplyOverlayOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ApplyOverlayOp other = (ApplyOverlayOp) obj; if (!linkTypes.equals(other.linkTypes)) return false; if (!variantSpan.equals(other.v...
ApplyOverlayOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ApplyOverlayOp other = (ApplyOverlayOp) obj; if (!linkTypes.equals(other.linkTypes)) return false; if (!variantSpan.equals(other.v...
ApplyOverlayOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ApplyOverlayOp other = (ApplyOverlayOp) obj; if (!linkTypes.equals(other.linkTypes)) return false; if (!variantSpan.equals(other.v...
ApplyOverlayOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ApplyOverlayOp other = (ApplyOverlayOp) obj; if (!linkTypes.equals(other.linkTypes)) return false; if (!variantSpan.equals(other.v...
@Test public void characterCountNullNode() throws Exception { assertEquals(0, RopeUtils.characterCount(null)); }
public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); }
RopeUtils { public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); } }
RopeUtils { public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); } }
RopeUtils { public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static long addWeightsOfRightLeaningPare...
RopeUtils { public static <T extends StreamElement> long characterCount(Node<T> x) { if (x == null) { return 0; } if (x.isLeaf()) { return x.value.getWidth(); } return x.weight + addWeightsOfRightLeaningChildNodes(x); } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static long addWeightsOfRightLeaningPare...
@Test public void concatLeft() throws Exception { Node<InvariantSpan> left = new Node<>(new InvariantSpan(1, 10, documentHash)); Node<InvariantSpan> parent = RopeUtils.concat(left, null); assertEquals(10, parent.weight); assertNotNull(left.parent); }
public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; }
RopeUtils { public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; } }
RopeUtils { public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; } }
RopeUtils { public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static lo...
RopeUtils { public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static lo...
@Test public void concatNullLeftNullRight() throws Exception { assertEquals(0, RopeUtils.concat(null, null).weight); }
public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; }
RopeUtils { public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; } }
RopeUtils { public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; } }
RopeUtils { public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static lo...
RopeUtils { public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static lo...
@Test public void concatRight() throws Exception { Node<InvariantSpan> right = new Node<>(new InvariantSpan(1, 10, documentHash)); Node<InvariantSpan> parent = RopeUtils.concat(null, right); assertEquals(0, parent.weight); assertNotNull(right.parent); }
public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; }
RopeUtils { public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; } }
RopeUtils { public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; } }
RopeUtils { public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static lo...
RopeUtils { public static <T extends StreamElement> Node<T> concat(List<Node<T>> orphans) { Iterator<Node<T>> it = orphans.iterator(); Node<T> orphan = it.next(); while (it.hasNext()) { orphan = RopeUtils.concat(orphan, it.next()); } return orphan; } static long addWeightsOfRightLeaningChildNodes(Node<T> x); static lo...
@Test public void findSearchNode() throws Exception { }
public static <T extends StreamElement> Node<T> findSearchNode(Node<T> x, long weight, Node<T> root) { if (root == null) { throw new IllegalArgumentException("root is null"); } if (x == null) { return root; } if (x.weight > weight) { return x; } return findSearchNode(x.parent, weight, root); }
RopeUtils { public static <T extends StreamElement> Node<T> findSearchNode(Node<T> x, long weight, Node<T> root) { if (root == null) { throw new IllegalArgumentException("root is null"); } if (x == null) { return root; } if (x.weight > weight) { return x; } return findSearchNode(x.parent, weight, root); } }
RopeUtils { public static <T extends StreamElement> Node<T> findSearchNode(Node<T> x, long weight, Node<T> root) { if (root == null) { throw new IllegalArgumentException("root is null"); } if (x == null) { return root; } if (x.weight > weight) { return x; } return findSearchNode(x.parent, weight, root); } }
RopeUtils { public static <T extends StreamElement> Node<T> findSearchNode(Node<T> x, long weight, Node<T> root) { if (root == null) { throw new IllegalArgumentException("root is null"); } if (x == null) { return root; } if (x.weight > weight) { return x; } return findSearchNode(x.parent, weight, root); } static long ...
RopeUtils { public static <T extends StreamElement> Node<T> findSearchNode(Node<T> x, long weight, Node<T> root) { if (root == null) { throw new IllegalArgumentException("root is null"); } if (x == null) { return root; } if (x.weight > weight) { return x; } return findSearchNode(x.parent, weight, root); } static long ...
@Test public void indexDisplacement() throws Exception { Node<InvariantSpan> left = new Node<>(new InvariantSpan(1, 1, documentHash)); Node<InvariantSpan> right = new Node<>(new InvariantSpan(2, 3, documentHash)); Node<InvariantSpan> root = new Node.Builder<InvariantSpan>(1).left(left).right(right).build(); NodeIndex<I...
public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { return new N...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
@Test public void indexLeft() throws Exception { Node<InvariantSpan> left = new Node<>(new InvariantSpan(1, 10, documentHash)); Node<InvariantSpan> root = new Node.Builder<InvariantSpan>(10).left(left).build(); NodeIndex<InvariantSpan> index = RopeUtils.index(5, root, 0); assertEquals(new InvariantSpan(1, 10, documentH...
public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { return new N...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
@Test public void indexLeftLeftChain() throws Exception { Node<InvariantSpan> left2 = new Node<>(new InvariantSpan(100, 10, documentHash)); Node<InvariantSpan> right2 = new Node<>(new InvariantSpan(200, 5, documentHash)); Node<InvariantSpan> left1 = new Node.Builder<InvariantSpan>(10).left(left2).right(right2).build();...
public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { return new N...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
@Test public void indexLeftLower() throws Exception { Node<InvariantSpan> left = new Node<>(new InvariantSpan(1, 10, documentHash)); Node<InvariantSpan> root = new Node.Builder<InvariantSpan>(10).left(left).build(); NodeIndex<InvariantSpan> index = RopeUtils.index(1, root, 0); assertEquals(new InvariantSpan(1, 10, docu...
public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { return new N...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
@Test public void indexLeftRightChain() throws Exception { Node<InvariantSpan> left2 = new Node<>(new InvariantSpan(100, 10, documentHash)); Node<InvariantSpan> right2 = new Node<>(new InvariantSpan(200, 5, documentHash)); Node<InvariantSpan> left1 = new Node.Builder<InvariantSpan>(10).left(left2).right(right2).build()...
public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { return new N...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
@Test public void equalsVariantsFalse() throws Exception { ApplyOverlayOp op1 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); ApplyOverlayOp op2 = new ApplyOverlayOp(new VariantSpan(2, 100), Sets.newHashSet(1, 10)); assertFalse(op1.equals(op2)); assertFalse(op2.equals(op1)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ApplyOverlayOp other = (ApplyOverlayOp) obj; if (!linkTypes.equals(other.linkTypes)) return false; if (!variantSpan.equals(other.variantSpan)) return false; r...
ApplyOverlayOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ApplyOverlayOp other = (ApplyOverlayOp) obj; if (!linkTypes.equals(other.linkTypes)) return false; if (!variantSpan.equals(other.v...
ApplyOverlayOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ApplyOverlayOp other = (ApplyOverlayOp) obj; if (!linkTypes.equals(other.linkTypes)) return false; if (!variantSpan.equals(other.v...
ApplyOverlayOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ApplyOverlayOp other = (ApplyOverlayOp) obj; if (!linkTypes.equals(other.linkTypes)) return false; if (!variantSpan.equals(other.v...
ApplyOverlayOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ApplyOverlayOp other = (ApplyOverlayOp) obj; if (!linkTypes.equals(other.linkTypes)) return false; if (!variantSpan.equals(other.v...
@Test(expected = IndexOutOfBoundsException.class) public void indexLeftTooHigh() throws Exception { Node<InvariantSpan> left = new Node<>(new InvariantSpan(1, 10, documentHash)); Node<InvariantSpan> root = new Node.Builder<InvariantSpan>(10).left(left).build(); RopeUtils.index(11, root, 0); }
public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { return new N...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
@Test(expected = IndexOutOfBoundsException.class) public void indexLeftTooLow() throws Exception { Node<InvariantSpan> left = new Node<>(new InvariantSpan(1, 10, documentHash)); Node<InvariantSpan> root = new Node.Builder<InvariantSpan>(10).left(left).build(); RopeUtils.index(0, root, 0); }
public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { return new N...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
@Test public void indexLeftUpper() throws Exception { Node<InvariantSpan> left = new Node<>(new InvariantSpan(1, 10, documentHash)); Node<InvariantSpan> root = new Node.Builder<InvariantSpan>(10).left(left).build(); NodeIndex<InvariantSpan> index = RopeUtils.index(10, root, 0); assertEquals(new InvariantSpan(1, 10, doc...
public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { return new N...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
@Test(expected = IndexOutOfBoundsException.class) public void indexOutOutBoundsRight() throws Exception { Node<InvariantSpan> left2 = new Node<>(new InvariantSpan(100, 10, documentHash)); Node<InvariantSpan> right2 = new Node<>(new InvariantSpan(200, 5, documentHash)); Node<InvariantSpan> left1 = new Node.Builder<Invar...
public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { return new N...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
@Test public void indexRight() throws Exception { Node<InvariantSpan> left = new Node<>(new InvariantSpan(1, 10, documentHash)); Node<InvariantSpan> right = new Node<>(new InvariantSpan(1, 20, documentHash)); Node<InvariantSpan> root = new Node.Builder<InvariantSpan>(10).left(left).right(right).build(); NodeIndex<Invar...
public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { return new N...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
RopeUtils { public static <T extends StreamElement> NodeIndex<T> index(long characterPosition, Node<T> x, long disp) { if (x == null) { throw new IllegalArgumentException("node is null"); } if (characterPosition < 1) { throw new IndexOutOfBoundsException("characterPosition must be greater than 0"); } if (x.isLeaf()) { ...
@Test public void append() throws Exception { DefaultOulipoMachine som = DefaultOulipoMachine.createWritableMachine(streamLoader, new MockRemoteFileManager(), documentHash); InvariantSpan span = som.append("Hello"); assertEquals(span.getStart(), 1); assertEquals(span.getWidth(), 5); span = som.append("World"); assertEq...
@Override public InvariantSpan append(String text) throws IOException, MalformedSpanException { return iStream.append(text); }
DefaultOulipoMachine implements OulipoMachine { @Override public InvariantSpan append(String text) throws IOException, MalformedSpanException { return iStream.append(text); } }
DefaultOulipoMachine implements OulipoMachine { @Override public InvariantSpan append(String text) throws IOException, MalformedSpanException { return iStream.append(text); } DefaultOulipoMachine(StreamLoader stream, RemoteFileManager remoteFileManager, String documentHash, Key privateKey); }
DefaultOulipoMachine implements OulipoMachine { @Override public InvariantSpan append(String text) throws IOException, MalformedSpanException { return iStream.append(text); } DefaultOulipoMachine(StreamLoader stream, RemoteFileManager remoteFileManager, String documentHash, Key privateKey); static DefaultOulipoMachi...
DefaultOulipoMachine implements OulipoMachine { @Override public InvariantSpan append(String text) throws IOException, MalformedSpanException { return iStream.append(text); } DefaultOulipoMachine(StreamLoader stream, RemoteFileManager remoteFileManager, String documentHash, Key privateKey); static DefaultOulipoMachi...
@Test public void getText() throws Exception { DefaultOulipoMachine som = DefaultOulipoMachine.createWritableMachine(streamLoader, new MockRemoteFileManager(), documentHash); som.append("Hello"); som.append("World"); String result = som.getText(new InvariantSpan(5, 5, documentHash)); assertEquals("oWorl", result); }
@Override public String getText(InvariantSpan invariantSpan) throws IOException { assertSpanNotNull(invariantSpan); return iStream.getText(invariantSpan); }
DefaultOulipoMachine implements OulipoMachine { @Override public String getText(InvariantSpan invariantSpan) throws IOException { assertSpanNotNull(invariantSpan); return iStream.getText(invariantSpan); } }
DefaultOulipoMachine implements OulipoMachine { @Override public String getText(InvariantSpan invariantSpan) throws IOException { assertSpanNotNull(invariantSpan); return iStream.getText(invariantSpan); } DefaultOulipoMachine(StreamLoader stream, RemoteFileManager remoteFileManager, String documentHash, Key privateK...
DefaultOulipoMachine implements OulipoMachine { @Override public String getText(InvariantSpan invariantSpan) throws IOException { assertSpanNotNull(invariantSpan); return iStream.getText(invariantSpan); } DefaultOulipoMachine(StreamLoader stream, RemoteFileManager remoteFileManager, String documentHash, Key privateK...
DefaultOulipoMachine implements OulipoMachine { @Override public String getText(InvariantSpan invariantSpan) throws IOException { assertSpanNotNull(invariantSpan); return iStream.getText(invariantSpan); } DefaultOulipoMachine(StreamLoader stream, RemoteFileManager remoteFileManager, String documentHash, Key privateK...
@Test public void moveVariant() throws Exception { DefaultOulipoMachine machine = DefaultOulipoMachine.createWritableMachine(streamLoader, new MockRemoteFileManager(), documentHash); machine.insert(1, "My first document"); assertEquals("My first document", getText(machine)); machine.moveVariant(1, new VariantSpan(4, 6)...
@Override public void moveVariant(long to, VariantSpan variantSpan) throws MalformedSpanException, IOException { assertGreaterThanZero(to); assertSpanNotNull(variantSpan); vStream.move(to, variantSpan); oStream.move(to, variantSpan); if (writeDocFile) { documentBuilder.moveVariant(to, variantSpan); } }
DefaultOulipoMachine implements OulipoMachine { @Override public void moveVariant(long to, VariantSpan variantSpan) throws MalformedSpanException, IOException { assertGreaterThanZero(to); assertSpanNotNull(variantSpan); vStream.move(to, variantSpan); oStream.move(to, variantSpan); if (writeDocFile) { documentBuilder.mo...
DefaultOulipoMachine implements OulipoMachine { @Override public void moveVariant(long to, VariantSpan variantSpan) throws MalformedSpanException, IOException { assertGreaterThanZero(to); assertSpanNotNull(variantSpan); vStream.move(to, variantSpan); oStream.move(to, variantSpan); if (writeDocFile) { documentBuilder.mo...
DefaultOulipoMachine implements OulipoMachine { @Override public void moveVariant(long to, VariantSpan variantSpan) throws MalformedSpanException, IOException { assertGreaterThanZero(to); assertSpanNotNull(variantSpan); vStream.move(to, variantSpan); oStream.move(to, variantSpan); if (writeDocFile) { documentBuilder.mo...
DefaultOulipoMachine implements OulipoMachine { @Override public void moveVariant(long to, VariantSpan variantSpan) throws MalformedSpanException, IOException { assertGreaterThanZero(to); assertSpanNotNull(variantSpan); vStream.move(to, variantSpan); oStream.move(to, variantSpan); if (writeDocFile) { documentBuilder.mo...
@Test public void hashTrue() throws Exception { ApplyOverlayOp op1 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); ApplyOverlayOp op2 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); assertEquals(op1.hashCode(), op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + linkTypes.hashCode(); result = prime * result + variantSpan.hashCode(); return result; }
ApplyOverlayOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + linkTypes.hashCode(); result = prime * result + variantSpan.hashCode(); return result; } }
ApplyOverlayOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + linkTypes.hashCode(); result = prime * result + variantSpan.hashCode(); return result; } ApplyOverlayOp(DataInputStream dis); ApplyOverlayOp(VariantSpan variantSpan, Set<Integer>...
ApplyOverlayOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + linkTypes.hashCode(); result = prime * result + variantSpan.hashCode(); return result; } ApplyOverlayOp(DataInputStream dis); ApplyOverlayOp(VariantSpan variantSpan, Set<Integer>...
ApplyOverlayOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + linkTypes.hashCode(); result = prime * result + variantSpan.hashCode(); return result; } ApplyOverlayOp(DataInputStream dis); ApplyOverlayOp(VariantSpan variantSpan, Set<Integer>...
@Test public void encodeDecode() throws Exception { SwapVariantOp op = new SwapVariantOp(new VariantSpan(100, 1), new VariantSpan(200, 1)); byte[] data = op.encode(); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); assertEquals(Op.SWAP, dis.readByte()); SwapVariantOp decoded = new SwapVariant...
@Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.SWAP); dos.writeLong(v1.start); dos.writeLong(v1.width); dos.writeLong(v2.start); dos.writeLong(v2.width); } os.flush(); return os.toByte...
SwapVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.SWAP); dos.writeLong(v1.start); dos.writeLong(v1.width); dos.writeLong(v2.start); dos.writeLong(v2.width); } o...
SwapVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.SWAP); dos.writeLong(v1.start); dos.writeLong(v1.width); dos.writeLong(v2.start); dos.writeLong(v2.width); } o...
SwapVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.SWAP); dos.writeLong(v1.start); dos.writeLong(v1.width); dos.writeLong(v2.start); dos.writeLong(v2.width); } o...
SwapVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.SWAP); dos.writeLong(v1.start); dos.writeLong(v1.width); dos.writeLong(v2.start); dos.writeLong(v2.width); } o...
@Test public void equalsFalse() throws Exception { SwapVariantOp op1 = new SwapVariantOp(new VariantSpan(100, 1), new VariantSpan(200, 1)); SwapVariantOp op2 = new SwapVariantOp(new VariantSpan(100, 10), new VariantSpan(200, 1)); assertFalse(op1.equals(op2)); assertFalse(op2.equals(op1)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; SwapVariantOp other = (SwapVariantOp) obj; if (!v1.equals(other.v1)) return false; if (!v2.equals(other.v2)) return false; return true; }
SwapVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; SwapVariantOp other = (SwapVariantOp) obj; if (!v1.equals(other.v1)) return false; if (!v2.equals(other.v2)) return false; return t...
SwapVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; SwapVariantOp other = (SwapVariantOp) obj; if (!v1.equals(other.v1)) return false; if (!v2.equals(other.v2)) return false; return t...
SwapVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; SwapVariantOp other = (SwapVariantOp) obj; if (!v1.equals(other.v1)) return false; if (!v2.equals(other.v2)) return false; return t...
SwapVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; SwapVariantOp other = (SwapVariantOp) obj; if (!v1.equals(other.v1)) return false; if (!v2.equals(other.v2)) return false; return t...
@Test public void hashFalse() throws Exception { SwapVariantOp op1 = new SwapVariantOp(new VariantSpan(100, 10), new VariantSpan(200, 1)); SwapVariantOp op2 = new SwapVariantOp(new VariantSpan(100, 1), new VariantSpan(200, 1)); assertFalse(op1.hashCode() == op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + v1.hashCode(); result = prime * result + v2.hashCode(); return result; }
SwapVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + v1.hashCode(); result = prime * result + v2.hashCode(); return result; } }
SwapVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + v1.hashCode(); result = prime * result + v2.hashCode(); return result; } SwapVariantOp(DataInputStream dis); SwapVariantOp(VariantSpan v1, VariantSpan v2); }
SwapVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + v1.hashCode(); result = prime * result + v2.hashCode(); return result; } SwapVariantOp(DataInputStream dis); SwapVariantOp(VariantSpan v1, VariantSpan v2); @Override byte[] encode...
SwapVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + v1.hashCode(); result = prime * result + v2.hashCode(); return result; } SwapVariantOp(DataInputStream dis); SwapVariantOp(VariantSpan v1, VariantSpan v2); @Override byte[] encode...
@Test public void hashTrue() throws Exception { SwapVariantOp op1 = new SwapVariantOp(new VariantSpan(100, 1), new VariantSpan(200, 1)); SwapVariantOp op2 = new SwapVariantOp(new VariantSpan(100, 1), new VariantSpan(200, 1)); assertEquals(op1.hashCode(), op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + v1.hashCode(); result = prime * result + v2.hashCode(); return result; }
SwapVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + v1.hashCode(); result = prime * result + v2.hashCode(); return result; } }
SwapVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + v1.hashCode(); result = prime * result + v2.hashCode(); return result; } SwapVariantOp(DataInputStream dis); SwapVariantOp(VariantSpan v1, VariantSpan v2); }
SwapVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + v1.hashCode(); result = prime * result + v2.hashCode(); return result; } SwapVariantOp(DataInputStream dis); SwapVariantOp(VariantSpan v1, VariantSpan v2); @Override byte[] encode...
SwapVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + v1.hashCode(); result = prime * result + v2.hashCode(); return result; } SwapVariantOp(DataInputStream dis); SwapVariantOp(VariantSpan v1, VariantSpan v2); @Override byte[] encode...
@Test public void encodeDecode() throws Exception { PutOverlayMediaOp op = new PutOverlayMediaOp(1, 1, Sets.newSet(10, 5)); byte[] data = op.encode(); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); assertEquals(Op.PUT_OVERLAY_MEDIA, dis.readByte()); PutOverlayMediaOp decoded = new PutOverlay...
@Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_OVERLAY_MEDIA); dos.writeLong(to); dos.writeInt(hash); dos.writeInt(linkTypes.size()); for (Integer i : linkTypes) { dos.writeInt(i);...
PutOverlayMediaOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_OVERLAY_MEDIA); dos.writeLong(to); dos.writeInt(hash); dos.writeInt(linkTypes.size()); for (Integer i ...
PutOverlayMediaOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_OVERLAY_MEDIA); dos.writeLong(to); dos.writeInt(hash); dos.writeInt(linkTypes.size()); for (Integer i ...
PutOverlayMediaOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_OVERLAY_MEDIA); dos.writeLong(to); dos.writeInt(hash); dos.writeInt(linkTypes.size()); for (Integer i ...
PutOverlayMediaOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_OVERLAY_MEDIA); dos.writeLong(to); dos.writeInt(hash); dos.writeInt(linkTypes.size()); for (Integer i ...
@Test public void equalsFalse() throws Exception { PutOverlayMediaOp op1 = new PutOverlayMediaOp(1, 1, Sets.newSet(10, 5)); PutOverlayMediaOp op2 = new PutOverlayMediaOp(2, 1, Sets.newSet(10, 5)); assertFalse(op1.equals(op2)); assertFalse(op2.equals(op1)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutOverlayMediaOp other = (PutOverlayMediaOp) obj; if (hash != other.hash) return false; if (!linkTypes.equals(other.linkTypes)) return false; if (to != other...
PutOverlayMediaOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutOverlayMediaOp other = (PutOverlayMediaOp) obj; if (hash != other.hash) return false; if (!linkTypes.equals(other.linkTypes)...
PutOverlayMediaOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutOverlayMediaOp other = (PutOverlayMediaOp) obj; if (hash != other.hash) return false; if (!linkTypes.equals(other.linkTypes)...
PutOverlayMediaOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutOverlayMediaOp other = (PutOverlayMediaOp) obj; if (hash != other.hash) return false; if (!linkTypes.equals(other.linkTypes)...
PutOverlayMediaOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutOverlayMediaOp other = (PutOverlayMediaOp) obj; if (hash != other.hash) return false; if (!linkTypes.equals(other.linkTypes)...
@Test public void hashFalse() throws Exception { PutOverlayMediaOp op1 = new PutOverlayMediaOp(1, 1, Sets.newSet(10, 5)); PutOverlayMediaOp op2 = new PutOverlayMediaOp(2, 1, Sets.newSet(10, 5)); assertFalse(op1.hashCode() == op2.hashCode()); }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + hash; result = prime * result + ((linkTypes == null) ? 0 : linkTypes.hashCode()); result = prime * result + (int) (to ^ (to >>> 32)); return result; }
PutOverlayMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + hash; result = prime * result + ((linkTypes == null) ? 0 : linkTypes.hashCode()); result = prime * result + (int) (to ^ (to >>> 32)); return result; } }
PutOverlayMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + hash; result = prime * result + ((linkTypes == null) ? 0 : linkTypes.hashCode()); result = prime * result + (int) (to ^ (to >>> 32)); return result; } PutOverlayMediaOp(DataInp...
PutOverlayMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + hash; result = prime * result + ((linkTypes == null) ? 0 : linkTypes.hashCode()); result = prime * result + (int) (to ^ (to >>> 32)); return result; } PutOverlayMediaOp(DataInp...
PutOverlayMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + hash; result = prime * result + ((linkTypes == null) ? 0 : linkTypes.hashCode()); result = prime * result + (int) (to ^ (to >>> 32)); return result; } PutOverlayMediaOp(DataInp...
@Test public void delete() throws Exception { TestObject to1 = new TestObject("1", "456"); TestObject to2 = new TestObject("2", "abc"); TestObject to3 = new TestObject("3", "xyz"); service.save(to1); service.save(to2); service.save(to3); service.delete("1", TestObject.class); service.delete("3", TestObject.class); Coll...
public <T> void delete(String id, Class<T> clazz) throws StorageException { if (Strings.isNullOrEmpty(id)) { throw new IllegalArgumentException("Id is null"); } if (clazz == null) { throw new IllegalArgumentException("Class is null"); } String key = id + "!" + clazz.getName(); Field[] fields = clazz.getDeclaredFields()...
StorageService { public <T> void delete(String id, Class<T> clazz) throws StorageException { if (Strings.isNullOrEmpty(id)) { throw new IllegalArgumentException("Id is null"); } if (clazz == null) { throw new IllegalArgumentException("Class is null"); } String key = id + "!" + clazz.getName(); Field[] fields = clazz.ge...
StorageService { public <T> void delete(String id, Class<T> clazz) throws StorageException { if (Strings.isNullOrEmpty(id)) { throw new IllegalArgumentException("Id is null"); } if (clazz == null) { throw new IllegalArgumentException("Class is null"); } String key = id + "!" + clazz.getName(); Field[] fields = clazz.ge...
StorageService { public <T> void delete(String id, Class<T> clazz) throws StorageException { if (Strings.isNullOrEmpty(id)) { throw new IllegalArgumentException("Id is null"); } if (clazz == null) { throw new IllegalArgumentException("Class is null"); } String key = id + "!" + clazz.getName(); Field[] fields = clazz.ge...
StorageService { public <T> void delete(String id, Class<T> clazz) throws StorageException { if (Strings.isNullOrEmpty(id)) { throw new IllegalArgumentException("Id is null"); } if (clazz == null) { throw new IllegalArgumentException("Class is null"); } String key = id + "!" + clazz.getName(); Field[] fields = clazz.ge...
@Test public void hashTrue() throws Exception { PutOverlayMediaOp op1 = new PutOverlayMediaOp(1, 0, Sets.newSet(10, 5)); PutOverlayMediaOp op2 = new PutOverlayMediaOp(1, 0, Sets.newSet(10, 5)); assertEquals(op1.hashCode(), op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + hash; result = prime * result + ((linkTypes == null) ? 0 : linkTypes.hashCode()); result = prime * result + (int) (to ^ (to >>> 32)); return result; }
PutOverlayMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + hash; result = prime * result + ((linkTypes == null) ? 0 : linkTypes.hashCode()); result = prime * result + (int) (to ^ (to >>> 32)); return result; } }
PutOverlayMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + hash; result = prime * result + ((linkTypes == null) ? 0 : linkTypes.hashCode()); result = prime * result + (int) (to ^ (to >>> 32)); return result; } PutOverlayMediaOp(DataInp...
PutOverlayMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + hash; result = prime * result + ((linkTypes == null) ? 0 : linkTypes.hashCode()); result = prime * result + (int) (to ^ (to >>> 32)); return result; } PutOverlayMediaOp(DataInp...
PutOverlayMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + hash; result = prime * result + ((linkTypes == null) ? 0 : linkTypes.hashCode()); result = prime * result + (int) (to ^ (to >>> 32)); return result; } PutOverlayMediaOp(DataInp...
@Test public void encode() throws Exception { DeleteVariantOp op = new DeleteVariantOp(new VariantSpan(1, 100)); byte[] data = op.encode(); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); assertEquals(Op.DELETE, dis.read()); assertEquals(1, dis.readLong()); assertEquals(100, dis.readLong()); ...
@Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.DELETE); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); return os.toByteArray(); }
DeleteVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.DELETE); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); return os.toByteA...
DeleteVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.DELETE); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); return os.toByteA...
DeleteVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.DELETE); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); return os.toByteA...
DeleteVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.DELETE); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); return os.toByteA...
@Test public void equalsVariantsFalse() throws Exception { DeleteVariantOp op1 = new DeleteVariantOp(new VariantSpan(1, 100)); DeleteVariantOp op2 = new DeleteVariantOp(new VariantSpan(2, 100)); assertFalse(op1.equals(op2)); assertFalse(op2.equals(op1)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; DeleteVariantOp other = (DeleteVariantOp) obj; if (!variantSpan.equals(other.variantSpan)) return false; return true; }
DeleteVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; DeleteVariantOp other = (DeleteVariantOp) obj; if (!variantSpan.equals(other.variantSpan)) return false; return true; } }
DeleteVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; DeleteVariantOp other = (DeleteVariantOp) obj; if (!variantSpan.equals(other.variantSpan)) return false; return true; } DeleteVar...
DeleteVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; DeleteVariantOp other = (DeleteVariantOp) obj; if (!variantSpan.equals(other.variantSpan)) return false; return true; } DeleteVar...
DeleteVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; DeleteVariantOp other = (DeleteVariantOp) obj; if (!variantSpan.equals(other.variantSpan)) return false; return true; } DeleteVar...
@Test public void hashFalse() throws Exception { DeleteVariantOp op1 = new DeleteVariantOp(new VariantSpan(1, 100)); DeleteVariantOp op2 = new DeleteVariantOp(new VariantSpan(2, 100)); assertFalse(op1.hashCode() == op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + variantSpan.hashCode(); return result; }
DeleteVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + variantSpan.hashCode(); return result; } }
DeleteVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + variantSpan.hashCode(); return result; } DeleteVariantOp(DataInputStream dis); DeleteVariantOp(VariantSpan variantSpan); }
DeleteVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + variantSpan.hashCode(); return result; } DeleteVariantOp(DataInputStream dis); DeleteVariantOp(VariantSpan variantSpan); @Override byte[] encode(); @Override boolean equals(Obje...
DeleteVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + variantSpan.hashCode(); return result; } DeleteVariantOp(DataInputStream dis); DeleteVariantOp(VariantSpan variantSpan); @Override byte[] encode(); @Override boolean equals(Obje...
@Test public void hashTrue() throws Exception { DeleteVariantOp op1 = new DeleteVariantOp(new VariantSpan(1, 100)); DeleteVariantOp op2 = new DeleteVariantOp(new VariantSpan(1, 100)); assertEquals(op1.hashCode(), op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + variantSpan.hashCode(); return result; }
DeleteVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + variantSpan.hashCode(); return result; } }
DeleteVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + variantSpan.hashCode(); return result; } DeleteVariantOp(DataInputStream dis); DeleteVariantOp(VariantSpan variantSpan); }
DeleteVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + variantSpan.hashCode(); return result; } DeleteVariantOp(DataInputStream dis); DeleteVariantOp(VariantSpan variantSpan); @Override byte[] encode(); @Override boolean equals(Obje...
DeleteVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + variantSpan.hashCode(); return result; } DeleteVariantOp(DataInputStream dis); DeleteVariantOp(VariantSpan variantSpan); @Override byte[] encode(); @Override boolean equals(Obje...
@Test public void encodeDecode() throws Exception { CopyVariantOp op = new CopyVariantOp(100, new VariantSpan(50, 75)); byte[] data = op.encode(); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); assertEquals(Op.COPY, dis.readByte()); CopyVariantOp decoded = new CopyVariantOp(dis); assertEqual...
@Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.COPY); dos.writeLong(to); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); return os.toByteArray(); }
CopyVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.COPY); dos.writeLong(to); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); re...
CopyVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.COPY); dos.writeLong(to); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); re...
CopyVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.COPY); dos.writeLong(to); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); re...
CopyVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.COPY); dos.writeLong(to); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); re...
@Test public void equalsPositionsFalse() throws Exception { CopyVariantOp op1 = new CopyVariantOp(1, new VariantSpan(1, 100)); CopyVariantOp op2 = new CopyVariantOp(2, new VariantSpan(1, 100)); assertFalse(op1.equals(op2)); assertFalse(op2.equals(op1)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; CopyVariantOp other = (CopyVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return false; return true; }
CopyVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; CopyVariantOp other = (CopyVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return fal...
CopyVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; CopyVariantOp other = (CopyVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return fal...
CopyVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; CopyVariantOp other = (CopyVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return fal...
CopyVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; CopyVariantOp other = (CopyVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return fal...
@Test public void equalsVariantsFalse() throws Exception { CopyVariantOp op1 = new CopyVariantOp(1, new VariantSpan(1, 100)); CopyVariantOp op2 = new CopyVariantOp(1, new VariantSpan(2, 100)); assertFalse(op1.equals(op2)); assertFalse(op2.equals(op1)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; CopyVariantOp other = (CopyVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return false; return true; }
CopyVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; CopyVariantOp other = (CopyVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return fal...
CopyVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; CopyVariantOp other = (CopyVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return fal...
CopyVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; CopyVariantOp other = (CopyVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return fal...
CopyVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; CopyVariantOp other = (CopyVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return fal...
@Test public void hashTrue() throws Exception { CopyVariantOp op1 = new CopyVariantOp(1, new VariantSpan(1, 100)); CopyVariantOp op2 = new CopyVariantOp(1, new VariantSpan(1, 100)); assertEquals(op1.hashCode(), op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; }
CopyVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } }
CopyVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } CopyVariantOp(DataInputStream dis); CopyVariantOp(long to, VariantSpan variantSpan); }
CopyVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } CopyVariantOp(DataInputStream dis); CopyVariantOp(long to, VariantSpan variantSpan); @...
CopyVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } CopyVariantOp(DataInputStream dis); CopyVariantOp(long to, VariantSpan variantSpan); @...
@Test public void encodeDecode() throws Exception { MoveVariantOp op = new MoveVariantOp(100, new VariantSpan(50, 75)); byte[] data = op.encode(); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); assertEquals(Op.MOVE, dis.readByte()); MoveVariantOp decoded = new MoveVariantOp(dis); assertEqual...
@Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.MOVE); dos.writeLong(to); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); return os.toByteArray(); }
MoveVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.MOVE); dos.writeLong(to); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); re...
MoveVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.MOVE); dos.writeLong(to); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); re...
MoveVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.MOVE); dos.writeLong(to); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); re...
MoveVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.MOVE); dos.writeLong(to); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); re...
@Test public void getAll() throws Exception { TestObject to1 = new TestObject("1", "456"); TestObject to2 = new TestObject("2", "abc"); TestObject to3 = new TestObject("3", "xyz"); service.save(to1); service.save(to2); service.save(to3); Collection<TestObject> results = service.getAll(TestObject.class); assertEquals(3,...
public <T> Collection<T> getAll(Class<T> clazz) throws ClassNotFoundException, StorageException, IOException { List<T> c = new ArrayList<>(); Map<String, String> ids = new HashMap<>(); try (DBIterator it = db.iterator()) { it.seekToFirst(); String prevId = null; while (it.hasNext()) { String key = new String(it.next()....
StorageService { public <T> Collection<T> getAll(Class<T> clazz) throws ClassNotFoundException, StorageException, IOException { List<T> c = new ArrayList<>(); Map<String, String> ids = new HashMap<>(); try (DBIterator it = db.iterator()) { it.seekToFirst(); String prevId = null; while (it.hasNext()) { String key = new ...
StorageService { public <T> Collection<T> getAll(Class<T> clazz) throws ClassNotFoundException, StorageException, IOException { List<T> c = new ArrayList<>(); Map<String, String> ids = new HashMap<>(); try (DBIterator it = db.iterator()) { it.seekToFirst(); String prevId = null; while (it.hasNext()) { String key = new ...
StorageService { public <T> Collection<T> getAll(Class<T> clazz) throws ClassNotFoundException, StorageException, IOException { List<T> c = new ArrayList<>(); Map<String, String> ids = new HashMap<>(); try (DBIterator it = db.iterator()) { it.seekToFirst(); String prevId = null; while (it.hasNext()) { String key = new ...
StorageService { public <T> Collection<T> getAll(Class<T> clazz) throws ClassNotFoundException, StorageException, IOException { List<T> c = new ArrayList<>(); Map<String, String> ids = new HashMap<>(); try (DBIterator it = db.iterator()) { it.seekToFirst(); String prevId = null; while (it.hasNext()) { String key = new ...
@Test public void equalsVariantsFalse() throws Exception { MoveVariantOp op1 = new MoveVariantOp(1, new VariantSpan(1, 100)); MoveVariantOp op2 = new MoveVariantOp(1, new VariantSpan(2, 100)); assertFalse(op1.equals(op2)); assertFalse(op2.equals(op1)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; MoveVariantOp other = (MoveVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return false; return true; }
MoveVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; MoveVariantOp other = (MoveVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return fal...
MoveVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; MoveVariantOp other = (MoveVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return fal...
MoveVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; MoveVariantOp other = (MoveVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return fal...
MoveVariantOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; MoveVariantOp other = (MoveVariantOp) obj; if (to != other.to) return false; if (!variantSpan.equals(other.variantSpan)) return fal...
@Test public void hashFalse() throws Exception { MoveVariantOp op1 = new MoveVariantOp(1, new VariantSpan(1, 100)); MoveVariantOp op2 = new MoveVariantOp(1, new VariantSpan(2, 100)); assertFalse(op1.hashCode() == op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; }
MoveVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } }
MoveVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } MoveVariantOp(DataInputStream dis); MoveVariantOp(long to, VariantSpan variantSpan); }
MoveVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } MoveVariantOp(DataInputStream dis); MoveVariantOp(long to, VariantSpan variantSpan); @...
MoveVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } MoveVariantOp(DataInputStream dis); MoveVariantOp(long to, VariantSpan variantSpan); @...
@Test public void hashFalse2() throws Exception { MoveVariantOp op1 = new MoveVariantOp(1, new VariantSpan(1, 100)); MoveVariantOp op2 = new MoveVariantOp(2, new VariantSpan(1, 100)); assertFalse(op1.hashCode() == op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; }
MoveVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } }
MoveVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } MoveVariantOp(DataInputStream dis); MoveVariantOp(long to, VariantSpan variantSpan); }
MoveVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } MoveVariantOp(DataInputStream dis); MoveVariantOp(long to, VariantSpan variantSpan); @...
MoveVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } MoveVariantOp(DataInputStream dis); MoveVariantOp(long to, VariantSpan variantSpan); @...
@Test public void hashTrue() throws Exception { MoveVariantOp op1 = new MoveVariantOp(1, new VariantSpan(1, 100)); MoveVariantOp op2 = new MoveVariantOp(1, new VariantSpan(1, 100)); assertEquals(op1.hashCode(), op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; }
MoveVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } }
MoveVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } MoveVariantOp(DataInputStream dis); MoveVariantOp(long to, VariantSpan variantSpan); }
MoveVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } MoveVariantOp(DataInputStream dis); MoveVariantOp(long to, VariantSpan variantSpan); @...
MoveVariantOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + variantSpan.hashCode(); return result; } MoveVariantOp(DataInputStream dis); MoveVariantOp(long to, VariantSpan variantSpan); @...
@Test public void encodeDecode() throws Exception { PutInvariantSpanOp op = new PutInvariantSpanOp(100, 50, 1, 0); byte[] data = op.encode(); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); assertEquals(Op.PUT_INVARIANT_SPAN, dis.readByte()); PutInvariantSpanOp decoded = new PutInvariantSpanO...
@Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_INVARIANT_SPAN); dos.writeLong(to); dos.writeLong(invariantStart); dos.writeLong(width); dos.writeInt(ripIndex); } os.flush(); return...
PutInvariantSpanOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_INVARIANT_SPAN); dos.writeLong(to); dos.writeLong(invariantStart); dos.writeLong(width); dos.writeInt...
PutInvariantSpanOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_INVARIANT_SPAN); dos.writeLong(to); dos.writeLong(invariantStart); dos.writeLong(width); dos.writeInt...
PutInvariantSpanOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_INVARIANT_SPAN); dos.writeLong(to); dos.writeLong(invariantStart); dos.writeLong(width); dos.writeInt...
PutInvariantSpanOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_INVARIANT_SPAN); dos.writeLong(to); dos.writeLong(invariantStart); dos.writeLong(width); dos.writeInt...
@Test public void equalsFalse() throws Exception { PutInvariantSpanOp op1 = new PutInvariantSpanOp(100, 50, 1, 0); PutInvariantSpanOp op2 = new PutInvariantSpanOp(101, 50, 1, 0); assertFalse(op1.equals(op2)); assertFalse(op2.equals(op1)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutInvariantSpanOp other = (PutInvariantSpanOp) obj; if (ripIndex != other.ripIndex) return false; if (invariantStart != other.invariantStart) return false; i...
PutInvariantSpanOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutInvariantSpanOp other = (PutInvariantSpanOp) obj; if (ripIndex != other.ripIndex) return false; if (invariantStart != other...
PutInvariantSpanOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutInvariantSpanOp other = (PutInvariantSpanOp) obj; if (ripIndex != other.ripIndex) return false; if (invariantStart != other...
PutInvariantSpanOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutInvariantSpanOp other = (PutInvariantSpanOp) obj; if (ripIndex != other.ripIndex) return false; if (invariantStart != other...
PutInvariantSpanOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutInvariantSpanOp other = (PutInvariantSpanOp) obj; if (ripIndex != other.ripIndex) return false; if (invariantStart != other...
@Test public void hashFalse() throws Exception { PutInvariantSpanOp op1 = new PutInvariantSpanOp(100, 50, 1, 0); PutInvariantSpanOp op2 = new PutInvariantSpanOp(101, 50, 1, 0); assertFalse(op1.hashCode() == op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (invariantStart ^ (invariantStart >>> 32)); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + (int) (width ^ (width >>> 32)); return resu...
PutInvariantSpanOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (invariantStart ^ (invariantStart >>> 32)); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + (int) (widt...
PutInvariantSpanOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (invariantStart ^ (invariantStart >>> 32)); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + (int) (widt...
PutInvariantSpanOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (invariantStart ^ (invariantStart >>> 32)); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + (int) (widt...
PutInvariantSpanOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (invariantStart ^ (invariantStart >>> 32)); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + (int) (widt...
@Test public void hashTrue() throws Exception { PutInvariantSpanOp op1 = new PutInvariantSpanOp(100, 50, 1, 0); PutInvariantSpanOp op2 = new PutInvariantSpanOp(100, 50, 1, 0); assertEquals(op1.hashCode(), op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (invariantStart ^ (invariantStart >>> 32)); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + (int) (width ^ (width >>> 32)); return resu...
PutInvariantSpanOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (invariantStart ^ (invariantStart >>> 32)); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + (int) (widt...
PutInvariantSpanOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (invariantStart ^ (invariantStart >>> 32)); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + (int) (widt...
PutInvariantSpanOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (invariantStart ^ (invariantStart >>> 32)); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + (int) (widt...
PutInvariantSpanOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (invariantStart ^ (invariantStart >>> 32)); result = prime * result + (int) (to ^ (to >>> 32)); result = prime * result + (int) (widt...
@Test public void encodeDecode() throws Exception { PutInvariantMediaOp op = new PutInvariantMediaOp(100, 1); byte[] data = op.encode(); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); assertEquals(Op.PUT_INVARIANT_MEDIA, dis.readByte()); PutInvariantMediaOp decoded = new PutInvariantMediaOp(...
@Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_INVARIANT_MEDIA); dos.writeLong(to); dos.writeInt(ripIndex); } os.flush(); return os.toByteArray(); }
PutInvariantMediaOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_INVARIANT_MEDIA); dos.writeLong(to); dos.writeInt(ripIndex); } os.flush(); return os.toByteArray(); ...
PutInvariantMediaOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_INVARIANT_MEDIA); dos.writeLong(to); dos.writeInt(ripIndex); } os.flush(); return os.toByteArray(); ...
PutInvariantMediaOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_INVARIANT_MEDIA); dos.writeLong(to); dos.writeInt(ripIndex); } os.flush(); return os.toByteArray(); ...
PutInvariantMediaOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_INVARIANT_MEDIA); dos.writeLong(to); dos.writeInt(ripIndex); } os.flush(); return os.toByteArray(); ...
@Test public void equalsFalse() throws Exception { PutInvariantMediaOp op1 = new PutInvariantMediaOp(1, 2); PutInvariantMediaOp op2 = new PutInvariantMediaOp(2, 2); assertFalse(op1.equals(op2)); assertFalse(op2.equals(op1)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutInvariantMediaOp other = (PutInvariantMediaOp) obj; if (ripIndex != other.ripIndex) return false; if (to != other.to) return false; return true; }
PutInvariantMediaOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutInvariantMediaOp other = (PutInvariantMediaOp) obj; if (ripIndex != other.ripIndex) return false; if (to != other.to) retu...
PutInvariantMediaOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutInvariantMediaOp other = (PutInvariantMediaOp) obj; if (ripIndex != other.ripIndex) return false; if (to != other.to) retu...
PutInvariantMediaOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutInvariantMediaOp other = (PutInvariantMediaOp) obj; if (ripIndex != other.ripIndex) return false; if (to != other.to) retu...
PutInvariantMediaOp extends Op { @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PutInvariantMediaOp other = (PutInvariantMediaOp) obj; if (ripIndex != other.ripIndex) return false; if (to != other.to) retu...
@Test public void addText() throws Exception { DocumentFile.Builder builder = new DocumentFile.Builder("fakeHash"); builder.appendText("Xanadu"); builder.appendText("Green"); DocumentFile file = builder.build(); assertEquals("XanaduGreen", file.getInvariantStream()); }
public String getInvariantStream() { return invariantStream; }
DocumentFile { public String getInvariantStream() { return invariantStream; } }
DocumentFile { public String getInvariantStream() { return invariantStream; } private DocumentFile(); }
DocumentFile { public String getInvariantStream() { return invariantStream; } private DocumentFile(); static org.oulipo.streams.Compiler<DocumentFile> compiler(); static Decompiler<DocumentFile> decompiler(); Map<Integer, String> get(); String getDocumentHash(); String getEncyptedInvariantStream(); String getGenesisHa...
DocumentFile { public String getInvariantStream() { return invariantStream; } private DocumentFile(); static org.oulipo.streams.Compiler<DocumentFile> compiler(); static Decompiler<DocumentFile> decompiler(); Map<Integer, String> get(); String getDocumentHash(); String getEncyptedInvariantStream(); String getGenesisHa...
@Test public void hashFalse() throws Exception { PutInvariantMediaOp op1 = new PutInvariantMediaOp(1, 2); PutInvariantMediaOp op2 = new PutInvariantMediaOp(2, 2); assertFalse(op1.hashCode() == op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (to ^ (to >>> 32)); return result; }
PutInvariantMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (to ^ (to >>> 32)); return result; } }
PutInvariantMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (to ^ (to >>> 32)); return result; } PutInvariantMediaOp(DataInputStream dis); PutInvariantMediaOp(long to, int ripIndex); }
PutInvariantMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (to ^ (to >>> 32)); return result; } PutInvariantMediaOp(DataInputStream dis); PutInvariantMediaOp(long to, int ripIndex); @Overrid...
PutInvariantMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (to ^ (to >>> 32)); return result; } PutInvariantMediaOp(DataInputStream dis); PutInvariantMediaOp(long to, int ripIndex); @Overrid...
@Test public void hashTrue() throws Exception { PutInvariantMediaOp op1 = new PutInvariantMediaOp(1, 2); PutInvariantMediaOp op2 = new PutInvariantMediaOp(1, 2); assertEquals(op1.hashCode(), op2.hashCode()); ; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (to ^ (to >>> 32)); return result; }
PutInvariantMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (to ^ (to >>> 32)); return result; } }
PutInvariantMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (to ^ (to >>> 32)); return result; } PutInvariantMediaOp(DataInputStream dis); PutInvariantMediaOp(long to, int ripIndex); }
PutInvariantMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (to ^ (to >>> 32)); return result; } PutInvariantMediaOp(DataInputStream dis); PutInvariantMediaOp(long to, int ripIndex); @Overrid...
PutInvariantMediaOp extends Op { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ripIndex; result = prime * result + (int) (to ^ (to >>> 32)); return result; } PutInvariantMediaOp(DataInputStream dis); PutInvariantMediaOp(long to, int ripIndex); @Overrid...
@Test public void encodeDecode() throws Exception { PutOverlayOp op = new PutOverlayOp(new VariantSpan(100, 1), Sets.newSet(10, 5)); byte[] data = op.encode(); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); assertEquals(Op.PUT_OVERLAY, dis.readByte()); PutOverlayOp decoded = new PutOverlayOp...
@Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_OVERLAY); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); dos.writeInt(linkTypes.size()); for (Integer i : linkTy...
PutOverlayOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_OVERLAY); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); dos.writeInt(linkTypes.size()...
PutOverlayOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_OVERLAY); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); dos.writeInt(linkTypes.size()...
PutOverlayOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_OVERLAY); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); dos.writeInt(linkTypes.size()...
PutOverlayOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.PUT_OVERLAY); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); dos.writeInt(linkTypes.size()...
@Test public void homeNoMatch() throws Exception { assertFalse(new VariantSpan(1, 9, "fakeHash").equals(new VariantSpan(1, 10))); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other.documentHash))...
VariantSpan { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other....
VariantSpan { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other....
VariantSpan { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other....
VariantSpan { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other....
@Test public void startNoMatch() throws MalformedSpanException { assertFalse(new VariantSpan(1, 10).equals(new VariantSpan(2, 10))); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other.documentHash))...
VariantSpan { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other....
VariantSpan { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other....
VariantSpan { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other....
VariantSpan { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other....
@Test public void widthNoMatch() throws MalformedSpanException { assertFalse(new VariantSpan(1, 9).equals(new VariantSpan(1, 10))); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other.documentHash))...
VariantSpan { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other....
VariantSpan { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other....
VariantSpan { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other....
VariantSpan { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VariantSpan other = (VariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other....
@Test public void inequality() throws Exception { InvariantSpan s1 = new InvariantSpan(10, 60, "ted: InvariantSpan s2 = new InvariantSpan(10, 50, "ted: assertFalse(s1.equals(s2)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; InvariantSpan other = (InvariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (!documentHash.equals(other.documentHa...
InvariantSpan implements Invariant { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; InvariantSpan other = (InvariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (...
InvariantSpan implements Invariant { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; InvariantSpan other = (InvariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (...
InvariantSpan implements Invariant { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; InvariantSpan other = (InvariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (...
InvariantSpan implements Invariant { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; InvariantSpan other = (InvariantSpan) obj; if (documentHash == null) { if (other.documentHash != null) return false; } else if (...
@Test public void split() throws Exception { InvariantSpan span = new InvariantSpan(1, 4, documentHash); StreamElementPartition<InvariantSpan> result = span.split(1); assertEquals(new InvariantSpan(1, 1, documentHash), result.getLeft()); assertEquals(new InvariantSpan(2, 3, documentHash), result.getRight()); }
@Override public StreamElementPartition<InvariantSpan> split(long leftPartitionWidth) throws MalformedSpanException { if (leftPartitionWidth < 1) { throw new IndexOutOfBoundsException( "Partition width must be greater than 0, partitionWidth = " + leftPartitionWidth); } if (width <= leftPartitionWidth) { throw new Index...
InvariantSpan implements Invariant { @Override public StreamElementPartition<InvariantSpan> split(long leftPartitionWidth) throws MalformedSpanException { if (leftPartitionWidth < 1) { throw new IndexOutOfBoundsException( "Partition width must be greater than 0, partitionWidth = " + leftPartitionWidth); } if (width <= ...
InvariantSpan implements Invariant { @Override public StreamElementPartition<InvariantSpan> split(long leftPartitionWidth) throws MalformedSpanException { if (leftPartitionWidth < 1) { throw new IndexOutOfBoundsException( "Partition width must be greater than 0, partitionWidth = " + leftPartitionWidth); } if (width <= ...
InvariantSpan implements Invariant { @Override public StreamElementPartition<InvariantSpan> split(long leftPartitionWidth) throws MalformedSpanException { if (leftPartitionWidth < 1) { throw new IndexOutOfBoundsException( "Partition width must be greater than 0, partitionWidth = " + leftPartitionWidth); } if (width <= ...
InvariantSpan implements Invariant { @Override public StreamElementPartition<InvariantSpan> split(long leftPartitionWidth) throws MalformedSpanException { if (leftPartitionWidth < 1) { throw new IndexOutOfBoundsException( "Partition width must be greater than 0, partitionWidth = " + leftPartitionWidth); } if (width <= ...
@Test public void splitEnd() throws Exception { InvariantSpan span = new InvariantSpan(1, 4, documentHash); StreamElementPartition<InvariantSpan> part = span.split(3); assertEquals(new InvariantSpan(1, 3, documentHash), part.getLeft()); assertEquals(new InvariantSpan(4, 1, documentHash), part.getRight()); }
@Override public StreamElementPartition<InvariantSpan> split(long leftPartitionWidth) throws MalformedSpanException { if (leftPartitionWidth < 1) { throw new IndexOutOfBoundsException( "Partition width must be greater than 0, partitionWidth = " + leftPartitionWidth); } if (width <= leftPartitionWidth) { throw new Index...
InvariantSpan implements Invariant { @Override public StreamElementPartition<InvariantSpan> split(long leftPartitionWidth) throws MalformedSpanException { if (leftPartitionWidth < 1) { throw new IndexOutOfBoundsException( "Partition width must be greater than 0, partitionWidth = " + leftPartitionWidth); } if (width <= ...
InvariantSpan implements Invariant { @Override public StreamElementPartition<InvariantSpan> split(long leftPartitionWidth) throws MalformedSpanException { if (leftPartitionWidth < 1) { throw new IndexOutOfBoundsException( "Partition width must be greater than 0, partitionWidth = " + leftPartitionWidth); } if (width <= ...
InvariantSpan implements Invariant { @Override public StreamElementPartition<InvariantSpan> split(long leftPartitionWidth) throws MalformedSpanException { if (leftPartitionWidth < 1) { throw new IndexOutOfBoundsException( "Partition width must be greater than 0, partitionWidth = " + leftPartitionWidth); } if (width <= ...
InvariantSpan implements Invariant { @Override public StreamElementPartition<InvariantSpan> split(long leftPartitionWidth) throws MalformedSpanException { if (leftPartitionWidth < 1) { throw new IndexOutOfBoundsException( "Partition width must be greater than 0, partitionWidth = " + leftPartitionWidth); } if (width <= ...