litesoft
@ 939
litesoft / trunk / Java / core / Anywhere / src / org / litesoft / commonfoundation / stringmatching / StartsAndEndsWithStringMatcher.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
// This Source Code is in the Public Domain per: http://litesoft.org/License.txt package org.litesoft.commonfoundation.stringmatching; public class StartsAndEndsWithStringMatcher extends AbstractStringMatcher { private String mStartsWith, mEndsWith; // Package Friendly StartsAndEndsWithStringMatcher( int pMinLength, boolean pIgnoreCase, String pStartsWith, String pEndsWith ) { super( pMinLength, pIgnoreCase ); mStartsWith = pStartsWith; mEndsWith = pEndsWith; } @Override protected boolean LLmatches( String pInQuestion ) { return pInQuestion.startsWith( mStartsWith ) && pInQuestion.endsWith( mEndsWith ); } @Override public String toString() { return "StartsAndEndsWith( '" + mStartsWith + "', '" + mEndsWith + "' )"; } } |