Revision: 15293
http://gate.svn.sourceforge.net/gate/?rev=15293&view=rev
Author: valyt
Date: 2012-02-01 13:49:36 +0000 (Wed, 01 Feb 2012)
Log Message:
-----------
Added an informative toString() method, which can be useful when debugging.
Modified Paths:
--------------
gate/trunk/plugins/JAPE_Plus/src/gate/jape/plus/Predicate.java
Modified: gate/trunk/plugins/JAPE_Plus/src/gate/jape/plus/Predicate.java
===================================================================
--- gate/trunk/plugins/JAPE_Plus/src/gate/jape/plus/Predicate.java
2012-02-01 13:48:32 UTC (rev 15292)
+++ gate/trunk/plugins/JAPE_Plus/src/gate/jape/plus/Predicate.java
2012-02-01 13:49:36 UTC (rev 15293)
@@ -128,4 +128,25 @@
} else if(!type.equals(other.type)) return false;
return true;
}
+
+ @Override
+ public String toString() {
+ StringBuilder str = new StringBuilder();
+ str.append("[").append(annotationAccessor).append("
<").append(type).append("> ");
+ if(type == PredicateType.CONTAINS || type == PredicateType.WITHIN) {
+ // feature value is an int array
+ int[] constraint = (int[])featureValue;
+ str.append("[");
+ str.append(constraint[0]);
+ for(int i = 1; i < constraint.length; i++){
+ str.append(", ");
+ str.append(constraint[i]);
+ }
+ str.append("]");
+ } else {
+ str.append(featureValue);
+ }
+ str.append("]");
+ return str.toString();
+ }
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs