krysalis-update/src/java/org/krysalis/depot/update/util/regexp RegularExpressionHelper.java,1.1,1.2 RegularExpressionSelector.java,1.1,1.2 RegularExpression.java,1.1,1.2
Nick Chalko <[email protected]> Wed, 08 Dec 2004 09:11:53 +0000
| Newsgroups | gmane.comp.krysalis.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/krysalis/krysalis-update/src/java/org/krysalis/depot/update/util/regexp
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26470/src/java/org/krysalis/depot/update/util/regexp
Modified Files:
RegularExpressionHelper.java RegularExpressionSelector.java
RegularExpression.java
Log Message:
format
Index: RegularExpressionHelper.java
===================================================================
RCS file: /cvsroot/krysalis/krysalis-update/src/java/org/krysalis/depot/update/util/regexp/RegularExpressionHelper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RegularExpressionHelper.java 8 Dec 2004 09:06:31 -0000 1.1
--- RegularExpressionHelper.java 8 Dec 2004 09:11:51 -0000 1.2
***************
*** 17,39 ****
package org.krysalis.depot.update.util.regexp;
-
/**
* @author arb_jack
*
! * Wrapper in case we move to ORO
*/
public class RegularExpressionHelper {
! public final static String START = "^";
! public final static String WILD = ".*";
! public final static String END = "$";
!
public static RegularExpression getIncludes(String pattern) {
return new RegularExpression(START + WILD + pattern + WILD + END);
}
public static RegularExpression endsWith(String pattern) {
! return new RegularExpression(START + WILD + pattern + END);
}
public static RegularExpression startsWith(String pattern) {
! return new RegularExpression(START + pattern + WILD +END);
}
}
--- 17,42 ----
package org.krysalis.depot.update.util.regexp;
/**
* @author arb_jack
*
! * Wrapper in case we move to ORO
*/
public class RegularExpressionHelper {
! public final static String START = "^";
!
! public final static String WILD = ".*";
!
! public final static String END = "$";
!
public static RegularExpression getIncludes(String pattern) {
return new RegularExpression(START + WILD + pattern + WILD + END);
}
+
public static RegularExpression endsWith(String pattern) {
! return new RegularExpression(START + WILD + pattern + END);
}
+
public static RegularExpression startsWith(String pattern) {
! return new RegularExpression(START + pattern + WILD + END);
}
}
Index: RegularExpressionSelector.java
===================================================================
RCS file: /cvsroot/krysalis/krysalis-update/src/java/org/krysalis/depot/update/util/regexp/RegularExpressionSelector.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RegularExpressionSelector.java 8 Dec 2004 09:06:31 -0000 1.1
--- RegularExpressionSelector.java 8 Dec 2004 09:11:51 -0000 1.2
***************
*** 20,24 ****
import org.krysalis.depot.update.util.select.ISelector;
-
/**
* @author arb_jack
--- 20,23 ----
***************
*** 35,39 ****
}
! /* (non-Javadoc)
* @see org.krysalis.depot.update.util.Selector#select(java.lang.Object)
*/
--- 34,40 ----
}
! /*
! * (non-Javadoc)
! *
* @see org.krysalis.depot.update.util.Selector#select(java.lang.Object)
*/
***************
*** 48,52 ****
return m_regexp.match(data);
}
!
public String toString() {
return m_regexp.toString();
--- 49,53 ----
return m_regexp.match(data);
}
!
public String toString() {
return m_regexp.toString();
Index: RegularExpression.java
===================================================================
RCS file: /cvsroot/krysalis/krysalis-update/src/java/org/krysalis/depot/update/util/regexp/RegularExpression.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RegularExpression.java 8 Dec 2004 09:06:31 -0000 1.1
--- RegularExpression.java 8 Dec 2004 09:11:51 -0000 1.2
***************
*** 25,32 ****
* @author arb_jack
*
! * Wrapper in case we move to ORO
*/
public class RegularExpression {
private final String m_expression;
private final RE m_regexp;
--- 25,33 ----
* @author arb_jack
*
! * Wrapper in case we move to ORO
*/
public class RegularExpression {
private final String m_expression;
+
private final RE m_regexp;
***************
*** 38,48 ****
if (m_cached.containsKey(expression)) {
m_regexp = (RE) m_cached.get(expression);
! }
! else {
m_regexp = new RE(expression);
m_cached.put(expression, m_regexp);
}
! }
! catch (RESyntaxException e) {
System.err.println(e.toString());
e.printStackTrace(System.err);
--- 39,47 ----
if (m_cached.containsKey(expression)) {
m_regexp = (RE) m_cached.get(expression);
! } else {
m_regexp = new RE(expression);
m_cached.put(expression, m_regexp);
}
! } catch (RESyntaxException e) {
System.err.println(e.toString());
e.printStackTrace(System.err);
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/