home *** CD-ROM | disk | FTP | other *** search
- package com.everyware.tango.jas;
-
- import java.util.Vector;
-
- public abstract class Action {
- private static final int UNSET_VALUE = Integer.MIN_VALUE;
- private Vector result = new Vector();
- private String[] row;
- private int numRows = Integer.MIN_VALUE;
- private int numColumns = Integer.MIN_VALUE;
- private int currentRow;
- private int currentColumn;
-
- protected void setNumColumns(int var1) {
- if (var1 > 0) {
- this.numColumns = var1;
- }
-
- }
-
- private void dumpRow() {
- if (this.numColumns != Integer.MIN_VALUE) {
- if (this.row == null) {
- this.currentRow = 0;
- } else {
- while(this.currentColumn <= this.numColumns) {
- this.newColumn("");
- }
-
- }
- }
- }
-
- protected void newRow() {
- this.dumpRow();
- ++this.currentRow;
- this.row = new String[this.numColumns];
- this.result.addElement(this.row);
- this.currentColumn = 1;
- }
-
- protected void newColumn(String var1) {
- if (this.currentColumn <= this.numColumns) {
- this.row[this.currentColumn - 1] = new String(var1);
- ++this.currentColumn;
- }
- }
-
- public final String[] process(String[] var1) {
- this.customProcessing(var1);
- this.dumpRow();
- String[] var2 = new String[2 + this.result.size() * this.numColumns];
- var2[0] = String.valueOf(this.result.size());
- var2[1] = String.valueOf(this.numColumns);
-
- for(int var3 = 0; var3 < this.result.size(); ++var3) {
- this.row = (String[])this.result.elementAt(var3);
-
- for(int var4 = 0; var4 < this.numColumns; ++var4) {
- var2[2 + var3 * this.numColumns + var4] = this.row[var4];
- }
- }
-
- return var2;
- }
-
- public abstract void customProcessing(String[] var1);
- }
-