|
From: <rga...@us...> - 2002-10-21 21:42:22
|
Update of /cvsroot/csms/csms-core/src/java/org/fanfoot/scoring
In directory usw-pr-cvs1:/tmp/cvs-serv8464
Modified Files:
EventPattern.java
Log Message:
Refactoring
Index: EventPattern.java
===================================================================
RCS file: /cvsroot/csms/csms-core/src/java/org/fanfoot/scoring/EventPattern.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** EventPattern.java 21 Oct 2002 12:01:14 -0000 1.2
--- EventPattern.java 21 Oct 2002 21:42:19 -0000 1.3
***************
*** 47,52 ****
* scores in a textual commentary or set of statistics.
*
! *@author rgardler
! *@created 21 October 2002
*/
public class EventPattern {
--- 47,52 ----
* scores in a textual commentary or set of statistics.
*
! *@author rgardler
! *@created 21 October 2002
*/
public class EventPattern {
***************
*** 74,79 ****
* Creates a new instance of Pattern
*
! *@param node a DOM node taken from a configuration file
! * describing an event pattern
*/
public EventPattern(Node node) {
--- 74,79 ----
* Creates a new instance of Pattern
*
! *@param node a DOM node taken from a configuration file describing
! * an event pattern
*/
public EventPattern(Node node) {
***************
*** 95,121 ****
if(childNode.getNodeType() == node.TEXT_NODE) {
strRE = childNode.getNodeValue();
- sb.append('(');
- sb.append(strRE);
- sb.append(')');
- atts = curNode.getAttributes();
- strGroupName = atts.getNamedItem("name").getNodeValue();
- this.setCapturingGroup(idxGroup, strGroupName);
- idxGroup = idxGroup + 1;
- logger.fine(
- "Added capturing group " + strGroupName
- + " with RE " + strRE);
} else {
strRE = childNode.getFirstChild().getNodeValue();
- sb.append('(');
- sb.append(strRE);
- sb.append(')');
- atts = curNode.getAttributes();
- strGroupName = atts.getNamedItem("name").getNodeValue();
- this.setCapturingGroup(idxGroup, strGroupName);
- idxGroup = idxGroup + 1;
- logger.fine(
- "Added capturing group " + strGroupName
- + " with RE " + strRE);
}
} else if(curNode.getNodeName().equals("unwantedPart")) {
strRE = curNode.getFirstChild().getNodeValue();
--- 95,108 ----
if(childNode.getNodeType() == node.TEXT_NODE) {
strRE = childNode.getNodeValue();
} else {
strRE = childNode.getFirstChild().getNodeValue();
}
+ sb.append('(');
+ sb.append(strRE);
+ sb.append(')');
+ atts = curNode.getAttributes();
+ strGroupName = atts.getNamedItem("name").getNodeValue();
+ this.setCapturingGroup(idxGroup, strGroupName);
+ idxGroup = idxGroup + 1;
} else if(curNode.getNodeName().equals("unwantedPart")) {
strRE = curNode.getFirstChild().getNodeValue();
***************
*** 138,144 ****
/**
* Getter for property regexPattern.
*
! *@return Value of property regexPattern.
*/
public Pattern getRegexPattern() {
--- 125,144 ----
/**
+ * Private add the supplied Regular Expression as a capturing group
+ * with the index number indicated
+ *
+ *@param strRE the Regular Expression for the group
+ *@param idxGroup The feature to be added to the CapturingGroup
+ * attribute
+ *@parm idxGroup the index number of the group
+ */
+ private void addCapturingGroup(String strRE, int idxGroup) {
+ }
+
+
+ /**
* Getter for property regexPattern.
*
! *@return Value of property regexPattern.
*/
public Pattern getRegexPattern() {
***************
*** 151,155 ****
* Setter for property regexPattern.
*
! *@param regexPattern New value of property regexPattern.
*/
public void setRegexPattern(Pattern regexPattern) {
--- 151,155 ----
* Setter for property regexPattern.
*
! *@param regexPattern New value of property regexPattern.
*/
public void setRegexPattern(Pattern regexPattern) {
***************
*** 161,166 ****
* Indexed getter for property capturingGroup.
*
! *@param index Index of the property.
! *@return Value of the property at <CODE>index</CODE>.
*/
public String getCapturingGroup(int index) {
--- 161,166 ----
* Indexed getter for property capturingGroup.
*
! *@param index Index of the property.
! *@return Value of the property at <CODE>index</CODE>.
*/
public String getCapturingGroup(int index) {
***************
*** 173,178 ****
* Get the part name for the indicate capturing group
*
! *@param index Index of the property.
! *@return Value of the property at <CODE>index</CODE>.
*/
public String getPartName(int index) {
--- 173,178 ----
* Get the part name for the indicate capturing group
*
! *@param index Index of the property.
! *@return Value of the property at <CODE>index</CODE>.
*/
public String getPartName(int index) {
***************
*** 185,190 ****
* Indexed setter for property capturingGroup.
*
! *@param index Index of the property.
! *@param capturingGroupName New value of the property at <CODE>index</CODE>
* .
*/
--- 185,190 ----
* Indexed setter for property capturingGroup.
*
! *@param index Index of the property.
! *@param capturingGroupName New value of the property at <CODE>index</CODE>
* .
*/
***************
*** 199,203 ****
* Getter for property type.
*
! *@return Value of property type.
*/
public String getType() {
--- 199,203 ----
* Getter for property type.
*
! *@return Value of property type.
*/
public String getType() {
***************
*** 210,214 ****
* Setter for property type.
*
! *@param type New value of property type.
*/
public void setType(String type) {
--- 210,214 ----
* Setter for property type.
*
! *@param type New value of property type.
*/
public void setType(String type) {
|