Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/row/RowParser.java')
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/row/RowParser.java80
1 files changed, 40 insertions, 40 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/row/RowParser.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/row/RowParser.java
index 14557feee2..e73e8f9b48 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/row/RowParser.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core/src/org/eclipse/linuxtools/systemtap/graphing/core/datasets/row/RowParser.java
@@ -21,53 +21,53 @@ import org.eclipse.linuxtools.systemtap.graphing.core.datasets.IDataSetParser;
public class RowParser implements IDataSetParser {
- public RowParser(String[] regEx) {
- this.regEx = Arrays.copyOf(regEx, regEx.length);
- buildPattern();
- }
+ public RowParser(String[] regEx) {
+ this.regEx = Arrays.copyOf(regEx, regEx.length);
+ buildPattern();
+ }
- private void buildPattern() {
- StringBuilder wholeRegExpr = new StringBuilder();
- for(int i=0; i<regEx.length; i++) {
- wholeRegExpr.append('(' + regEx[i] + ')');
- }
- wholePattern = Pattern.compile(wholeRegExpr.toString());
- }
+ private void buildPattern() {
+ StringBuilder wholeRegExpr = new StringBuilder();
+ for(int i=0; i<regEx.length; i++) {
+ wholeRegExpr.append('(' + regEx[i] + ')');
+ }
+ wholePattern = Pattern.compile(wholeRegExpr.toString());
+ }
- @Override
- public IDataEntry parse(StringBuilder s) {
- if(null == s) {
- return null;
- }
+ @Override
+ public IDataEntry parse(StringBuilder s) {
+ if(null == s) {
+ return null;
+ }
- RowEntry e = null;
- Matcher wholeMatcher = wholePattern.matcher(s);
+ RowEntry e = null;
+ Matcher wholeMatcher = wholePattern.matcher(s);
- if(wholeMatcher.find()) {
- e = new RowEntry();
- Object[] data = new Object[regEx.length>>1];
+ if(wholeMatcher.find()) {
+ e = new RowEntry();
+ Object[] data = new Object[regEx.length>>1];
- int group=0, j;
+ int group=0, j;
- for(int i=0; i<regEx.length; i++) {
- group++;
- for(j=0; j<regEx[i].length(); j++) {
- if(regEx[i].charAt(j) == ')') {
- group++;
- }
- }
+ for(int i=0; i<regEx.length; i++) {
+ group++;
+ for(j=0; j<regEx[i].length(); j++) {
+ if(regEx[i].charAt(j) == ')') {
+ group++;
+ }
+ }
- if(0 == (i&1)) {
- data[i>>1] = wholeMatcher.group(group);
- }
- }
- e.putRow(0, data);
- s.delete(0, wholeMatcher.end());
- }
+ if(0 == (i&1)) {
+ data[i>>1] = wholeMatcher.group(group);
+ }
+ }
+ e.putRow(0, data);
+ s.delete(0, wholeMatcher.end());
+ }
- return e;
- }
+ return e;
+ }
- private String[] regEx;
- private Pattern wholePattern;
+ private String[] regEx;
+ private Pattern wholePattern;
}

Back to the top