biz.onixs.fix.parser
Class Group

java.lang.Object
  extended by biz.onixs.fix.parser.Group

public class Group
extends Object

FIX Repeating Group


Method Summary
 boolean contains(int tag, int index)
          Returns whether the field with the specified tag number is set.
 String get(int tag, int index)
          Returns the field value as string.
 boolean get(int tag, int index, ValuePtr valuePtr)
          Returns the field value.
 byte[] getBytes(int tag, int index)
          Returns the field value as a byte array.
 double getDouble(int tag, int index)
          Returns the field value as double.
 Group getGroup(int tag, int index)
          Returns the nested repeating group.
 int getInteger(int tag, int index)
          Returns the field value as integer.
 long getLong(int tag, int index)
          Returns the field value as long.
Whether the value is set or not can be checked using contains(int, int).
 int getNumberOfInstances()
          Number of instances in the repeating group.
 ValuePtr getValuePtr(int tag, int index)
          Returns the field value.
 boolean remove(int tag, int index)
          Removes the field.
 boolean set(int tag, int index, byte[] value, int valueSize)
          Sets the field value.
 boolean set(int tag, int index, biz.onixs.util.ByteBuffer buffer)
          Sets the field value.
 boolean set(int tag, int index, double value)
          Sets the double field value.
 boolean set(int tag, int index, int value)
          Sets the field value as integer.
 boolean set(int tag, int index, long value)
          Sets the long field value.
 boolean set(int tag, int index, String value)
          Sets the field value as string.
 boolean set(int tag, int index, ValuePtr valuePtr)
          Sets the field value.
 Group setGroup(int numberOfInstancesTag, int index, int numberOfInstances)
          Creates a new repeating group or changes the number of instances in the existing repeating group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public String get(int tag,
                  int index)
Returns the field value as string.

Parameters:
tag - tag number
index - index of the repeating group instance, starts from 0
Returns:
field value as string

getDouble

public double getDouble(int tag,
                        int index)
Returns the field value as double.

Parameters:
tag - tag number
index - index of the repeating group instance, starts from 0
Returns:
field value as double
Throws:
ValueIsIncorrectException - if the value can't be parsed to double

getLong

public long getLong(int tag,
                    int index)
Returns the field value as long.
Whether the value is set or not can be checked using contains(int, int).

Parameters:
tag - tag number
index - repeating group instance index, starts from 0
Returns:
field value as long, Long.MAX_VALUE if it is not set
Throws:
ValueIsIncorrectException - if the value can't be parsed to long

contains

public boolean contains(int tag,
                        int index)
Returns whether the field with the specified tag number is set.

Parameters:
tag - field tag number
index - index of the repeating group instance, starts from 0
Returns:
true if the field is set, false if the field is not set or is not defined for this message

getGroup

public Group getGroup(int tag,
                      int index)
Returns the nested repeating group.

Parameters:
tag - tag number of the field that defines the number of instances in this repeating group (the NoXXX field)
index - index of the repeating group instance, starts from 0
Returns:
nested repeating group
Throws:
ParserException - The tag number does not belong to the group.

getBytes

public byte[] getBytes(int tag,
                       int index)
Returns the field value as a byte array.

Parameters:
tag - tag number
index - index of the repeating group instance, starts from 0
Returns:
field value as a byte array, null if it is not set

getInteger

public int getInteger(int tag,
                      int index)
Returns the field value as integer.

Parameters:
tag - tag number
index - index of the repeating group instance, starts from 0
Returns:
field value as integer
Throws:
ValueIsIncorrectException - if the value can't be parsed to int

getNumberOfInstances

public int getNumberOfInstances()
Number of instances in the repeating group.

Returns:
number of instances
Throws:
ParserException

remove

public boolean remove(int tag,
                      int index)
Removes the field.

Parameters:
tag - tag number
index - index of the repeating group instance, starts from 0
Returns:
true if the field was found and removed, otherwise false

set

public boolean set(int tag,
                   int index,
                   String value)
Sets the field value as string.

Parameters:
tag - tag number
index - index of the repeating group instance, starts from 0
value - field value
Returns:
true if the value was replaced with the new one, and false if a new field was inserted
Throws:
ParserException - The tag number does not belong to the group.

set

public boolean set(int tag,
                   int index,
                   int value)
Sets the field value as integer.

Parameters:
tag - tag number
index - index of the repeating group instance, starts from 0
value - field value
Returns:
true if the value was replaced with the new one, and false if a new field was inserted
Throws:
ParserException - The tag number does not belong to the group.

setGroup

public Group setGroup(int numberOfInstancesTag,
                      int index,
                      int numberOfInstances)
Creates a new repeating group or changes the number of instances in the existing repeating group.

Parameters:
numberOfInstancesTag - tag number of the field that defines the number of instances in this repeating group (the NoXXX field)
index - index of the repeating group instance, starts from 0
numberOfInstances - number of instances in the repeating group
Returns:
repeating group
Throws:
ParserException - The tag number does not belong to the group.

set

public boolean set(int tag,
                   int index,
                   biz.onixs.util.ByteBuffer buffer)
Sets the field value.

Parameters:
tag - tag number
index - index of the repeating group instance, starts from 0
buffer - field value
Returns:
true if the value was replaced with the new one, and false if a new field was inserted
Throws:
ParserException - tag number does not belong to the group.

set

public boolean set(int tag,
                   int index,
                   long value)
Sets the long field value.

Parameters:
tag - tag number
index - index of the repeating group instance, starts from 0
value - field value
Returns:
whether there was a previous value
Throws:
TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this message

set

public boolean set(int tag,
                   int index,
                   double value)
Sets the double field value.

Parameters:
tag - tag number
index - index of the repeating group instance, starts from 0
value - field value
Returns:
whether there was a previous value
Throws:
TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this message

set

public boolean set(int tag,
                   int index,
                   byte[] value,
                   int valueSize)
Sets the field value.

Parameters:
tag - tag number
index - repeating group instance index, starts from 0
value - field value
valueSize - field value size
Returns:
whether there was a previous value
Throws:
TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this message

set

public boolean set(int tag,
                   int index,
                   ValuePtr valuePtr)
Sets the field value.

Parameters:
tag - tag number
index - repeating group instance index, starts from 0
valuePtr - field value
Returns:
whether there was a previous value
Throws:
TagNotDefinedForThisMessageTypeException - if field with the specified tag is not defined for this message

get

public boolean get(int tag,
                   int index,
                   ValuePtr valuePtr)
Returns the field value.

Parameters:
tag - tag number
index - repeating group instance index, starts from 0
valuePtr - pointer to pass value
Returns:
whether value exists or not

getValuePtr

public ValuePtr getValuePtr(int tag,
                            int index)
Returns the field value.

Parameters:
tag - tag number
index - repeating group instance index, starts from 0
Returns:
value pointer, use ValuePtr.isSet() to check whether value is set
Throws:
ParserException - tag number does not belong to the group


Copyright © 2005-2012 Onix Solutions. All Rights Reserved.