/**
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package redelm.io;

abstract public class RecordConsumer {

  abstract public void startMessage();
  abstract public void endMessage();

  abstract public void startField(String field, int index);
  abstract public void endField(String field, int index);

  abstract public void startGroup();
  abstract public void endGroup();

  abstract public void addInt(int value);
  abstract public void addLong(long value);
  abstract public void addString(String value);
  abstract public void addBoolean(boolean value);
  abstract public void addBinary(byte[] value);
  abstract public void addFloat(float value);
  abstract public void addDouble(double value);

}

@@ -607,16 +607,584 @@
 lm.io;%0A%0A
+/**%0A *%0A * Abstraction for writing or consuming records%0A * It decouples the striping/assembly algorithm from the actual record model%0A * example:%0A * %3Cpre%3E%0A * startMessage()%0A *  startField(%22A%22, 0)%0A *   addValue(1)%0A *   addValue(2)%0A *  endField(%22A%22, 0)%0A *  startField(%22B%22, 1)%0A *   startGroup()%0A *    startField(%22C%22, 0)%0A *     addValue(3)%0A *    endField(%22C%22, 0)%0A *   endGroup()%0A *  endField(%22B%22, 1)%0A * endMessage()%0A * %3C/pre%3E%0A *%0A * would produce the following message:%0A * %3Cpre%3E%0A * %7B%0A *   A: %5B1, 2%5D%0A *   B: %7B%0A *     C: 3%0A *   %7D%0A * %7D%0A * %3C/pre%3E%0A * @author Julien Le Dem%0A *%0A */%0A
 abstract
@@ -1215,16 +1215,52 @@
 umer %7B%0A%0A
+  /**%0A   * start a new record%0A   */%0A
   abstra
@@ -1289,16 +1289,50 @@
 ssage();
+%0A%0A  /**%0A   * end of a record%0A   */
 %0A  abstr
@@ -1368,475 +1368,1491 @@
 %0A%0A  
-abstract public void startField(String field, int index);%0A  abstract public void endField(String field, int index);%0A%0A  abstract public void startGroup();%0A  abstract public void endGroup();%0A%0A  abstract public void addInt(int value);%0A  abstract public void addLong(long value);%0A  abstract public void addString(String value);%0A  abstract public void addBoolean(boolean value);%0A  abstract public void addBinary(byte%5B%5D value);%0A  abstract public void addFloat(float value);
+/**%0A   * start of a field in a group or message%0A   * if the field is repeated the field is started only once and all values added in between start and end%0A   * @param field name of the field%0A   * @param index of the field in the group or message%0A   */%0A  abstract public void startField(String field, int index);%0A%0A  /**%0A   * end of a field in a group or message%0A   * @param field name of the field%0A   * @param index of the field in the group or message%0A   */%0A  abstract public void endField(String field, int index);%0A%0A  /**%0A   * start of a group in a field%0A   */%0A  abstract public void startGroup();%0A%0A  /**%0A   * end of a group in a field%0A   */%0A  abstract public void endGroup();%0A%0A  /**%0A   * add an int value in the current field%0A   * @param value%0A   */%0A  abstract public void addInt(int value);%0A%0A  /**%0A   * add a long value in the current field%0A   * @param value%0A   */%0A  abstract public void addLong(long value);%0A%0A  /**%0A   * add a string value in the current field%0A   * @param value%0A   */%0A  abstract public void addString(String value);%0A%0A  /**%0A   * add a boolean value in the current field%0A   * @param value%0A   */%0A  abstract public void addBoolean(boolean value);%0A%0A  /**%0A   * add a binary value in the current field%0A   * @param value%0A   */%0A  abstract public void addBinary(byte%5B%5D value);%0A%0A  /**%0A   * add a float value in the current field%0A   * @param value%0A   */%0A  abstract public void addFloat(float value);%0A%0A  /**%0A   * add a double value in the current field%0A   * @param value%0A   */
 %0A  a

add javadoc