@Test public void exactMatch () throws Exception { Matcher matcher = new InitialSubstringMatcher(); assertTrue(matcher.matches("2012", "2012")); }
@Override public boolean matches(String s1, String s2) { if (s1 == null && s2 == null) return true; if ((s1.length() > prefixSize) && (s2.length() > prefixSize )){ return s1.substring(0, prefixSize).equals(s2.substring(0, prefixSize)); } return false; }
InitialSubstringMatcher implements Matcher { @Override public boolean matches(String s1, String s2) { if (s1 == null && s2 == null) return true; if ((s1.length() > prefixSize) && (s2.length() > prefixSize )){ return s1.substring(0, prefixSize).equals(s2.substring(0, prefixSize)); } return false; } }
InitialSubstringMatcher implements Matcher { @Override public boolean matches(String s1, String s2) { if (s1 == null && s2 == null) return true; if ((s1.length() > prefixSize) && (s2.length() > prefixSize )){ return s1.substring(0, prefixSize).equals(s2.substring(0, prefixSize)); } return false; }  }
InitialSubstringMatcher implements Matcher { @Override public boolean matches(String s1, String s2) { if (s1 == null && s2 == null) return true; if ((s1.length() > prefixSize) && (s2.length() > prefixSize )){ return s1.substring(0, prefixSize).equals(s2.substring(0, prefixSize)); } return false; }  @Override int getCost(); @Override boolean matches(String s1, String s2); @Override boolean isExact(); @Override String getExecutionReport(); int getPrefixSize(); void setPrefixSize(int prefixSize); static void main(String[] args); }
InitialSubstringMatcher implements Matcher { @Override public boolean matches(String s1, String s2) { if (s1 == null && s2 == null) return true; if ((s1.length() > prefixSize) && (s2.length() > prefixSize )){ return s1.substring(0, prefixSize).equals(s2.substring(0, prefixSize)); } return false; }  @Override int getCost(); @Override boolean matches(String s1, String s2); @Override boolean isExact(); @Override String getExecutionReport(); int getPrefixSize(); void setPrefixSize(int prefixSize); static void main(String[] args); static int COST; public int prefixSize; }