com.epam.fix.message
Class AbstractFIXFieldList

java.lang.Object
  extended by com.epam.fix.message.IndexedStorage
      extended by com.epam.fix.message.ExtendedIndexedStorage
          extended by com.epam.fix.message.AbstractFIXFieldList
All Implemented Interfaces:
Iterable<FIXField>
Direct Known Subclasses:
FIXFieldListAdapter

public abstract class AbstractFIXFieldList
extends ExtendedIndexedStorage
implements Iterable<FIXField>

Created with IntelliJ IDEA. User: wed Date: 19.10.12 Time: 17:55 To change this template use File | Settings | File Templates.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.epam.fix.message.IndexedStorage
IndexedStorage.MISSING_TAG_HANDLING
 
Field Summary
protected  boolean forceCloneOnSend
           
protected  boolean isFree
           
protected  boolean isMessageIncomplete
           
protected  boolean isPreparedMessage
           
protected  com.epam.fix.message.AbstractFIXFieldList.TagValueIterator tagValueIterator
           
 
Fields inherited from class com.epam.fix.message.IndexedStorage
FIELD_SEPARATOR, NOTFOUND
 
Constructor Summary
AbstractFIXFieldList()
          Creates an empty message that is engine owned TBD: protect(hide) the constructor from user access.
AbstractFIXFieldList(boolean isUserOwned)
          Creates an empty message TBD: make with default modificator - all oter should use newInstanceFromPool
AbstractFIXFieldList(FIXFieldList message)
          Deprecated. 
 
Method Summary
 int add(TagValue tagValue)
           
 boolean addAll(FIXFieldList list)
           
 int calculateBodyLength()
          Calculates body length for collection.
 int calculateChecksum()
          Calculates checksum.
protected  boolean canCopyInPlace(int index, int oldLen, int newLen)
           
protected  boolean canCopyInPlaceNumber(int index, int oldLen, int newLen)
           
 void clear()
           
 FIXFieldList deepCopyTo(FIXFieldList cloned)
           
 boolean equals(Object o)
           
 int getTagIndex(int tag)
           
 int getTagLength(int tag)
           
 int getTagNumAtIndex(int index)
           
protected  Iterator<TagValue> getTagValueIterator()
          Calculation based on the number tag and length of the tag value
 boolean isEmpty()
           
 boolean isMessageBufferContinuous()
           
 boolean isMessageIncomplete()
           
 boolean isOriginatingFromPool()
           
 boolean isPreparedMessage()
           
 boolean isUserOwned()
           
protected abstract  FIXFieldList makeStandalone()
           
protected abstract  List<Map<Integer,FIXField>> notifyInvalidMessage(int rgTag, int rgFirstTag)
           
 boolean removeTag(int tag)
          Removes a fix field with specified tag from collection.
 List<FIXFieldList> split(int tag)
          Utility method that splits current message into the repeating groups based on first mandatory tag in the repeating group (always first tag in the repeating group).
protected  void switchToStandalone()
           
 byte[] toByteArray()
          Writes field list to array of bytes.
 int toByteArrayAndReturnNextPosition(byte[] dst, int offset)
          Writes the list of field to the origBuffer, and returns the next index.
 String toString()
          Converts collection of fix fields to string.
 
Methods inherited from class com.epam.fix.message.ExtendedIndexedStorage
addTag, addTag, addTag, addTagAtIndex, addTagAtIndex, addTagAtIndex, getBytes, getMsgSeqNumber, getMsgType, getMsgVersion, getTagValueAsBool, getTagValueAsBool, getTagValueAsByte, getTagValueAsByte, getTagValueAsByte, getTagValueAsByteAtIndex, getTagValueAsBytes, getTagValueAsBytes, getTagValueAsBytes, getTagValueAsBytes, getTagValueAsDateOnly, getTagValueAsDateOnly, getTagValueAsDateOnlyAtIndex, getTagValueAsDouble, getTagValueAsDouble, getTagValueAsLong, getTagValueAsLong, getTagValueAsMonthYear, getTagValueAsMonthYear, getTagValueAsMonthYearAtIndex, getTagValueAsString, getTagValueAsString, getTagValueAsStringBuff, getTagValueAsStringBuff, getTagValueAsTimeOnly, getTagValueAsTimeOnly, getTagValueAsTimeOnlyAtIndex, getTagValueAsTimestamp, getTagValueAsTimestamp, getTagValueAsTimestampAtIndex, getTagValueAsTZTimeOnly, getTagValueAsTZTimeOnly, getTagValueAsTZTimeOnlyAtIndex, getTagValueAsTZTimestamp, getTagValueAsTZTimestamp, getTagValueAsTZTimestampAtIndex, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setAtIndex, setAtIndex, setAtIndex, setAtIndex, setAtIndex, setAtIndex, setAtIndex, setAtIndex, setAtIndex, setAtIndex, setAtIndex, setAtIndex
 
Methods inherited from class com.epam.fix.message.IndexedStorage
addTag, addTag, addTag, addTag, addTag, addTag, addTag, addTagAtIndex, addTagAtIndex, addTagAtIndex, addTagAtIndex, addTagAtIndex, addTagAtIndex, addTagAtIndex, deepCopy, ensureCapacity, ensureCapacityAndEnlarge, ensureCapacityAndEnlarge, fillSubStorage, findOrPrepareToAdd, findOrPrepareToAdd, genericMessageToByteArrayAndReturnNextPosition, getFieldIndexData, getIndexCapacity, getRawLength, getSize, getStorage, getStorageType, getTag, getTag, getTagAtIndex, getTagIdAtIndex, getTagIndex, getTagIndexBetween, getTagIndexStartingFrom, getTagValueAsBoolAtIndex, getTagValueAsByteAtIndex, getTagValueAsBytesAtIndex, getTagValueAsBytesAtIndex, getTagValueAsDoubleAtIndex, getTagValueAsLongAtIndex, getTagValueAsStringAtIndex, getTagValueAsStringBuffAtIndex, getTagValueLength, getTagValueLength, getTagValueLengthAtIndex, getTagValueOffsetAtIndex, hashCode, isAllTagsInOneBuffer, isTagExists, isTagExists, mapTagInOrigStorage, onEnlarge, preparedToByteArrayAndReturnNextPosition, preparedToByteArrayAndReturnNextPosition2, removeTag, removeTagAtIndex, reserveTagAtIndex, setOriginalBuffer, toByteArrayAndReturnNextPosition, transferDataToArena, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue, updateValueAtIndex, updateValueAtIndex, updateValueAtIndex, updateValueAtIndex, updateValueAtIndex, updateValueAtIndex, updateValueAtIndex, updateValueAtIndex
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Iterable
iterator
 

Field Detail

tagValueIterator

protected com.epam.fix.message.AbstractFIXFieldList.TagValueIterator tagValueIterator

forceCloneOnSend

protected boolean forceCloneOnSend

isFree

protected boolean isFree

isPreparedMessage

protected boolean isPreparedMessage

isMessageIncomplete

protected boolean isMessageIncomplete
Constructor Detail

AbstractFIXFieldList

public AbstractFIXFieldList()
Creates an empty message that is engine owned TBD: protect(hide) the constructor from user access. May bee need to have default constructor for user and special - for internal usage TBD: make with default modificator - all oter should use newInstanceFromPool

See Also:
setIsUserOwned(boolean)

AbstractFIXFieldList

public AbstractFIXFieldList(boolean isUserOwned)
Creates an empty message TBD: make with default modificator - all oter should use newInstanceFromPool

See Also:
setIsUserOwned(boolean)

AbstractFIXFieldList

@Deprecated
public AbstractFIXFieldList(FIXFieldList message)
Deprecated. 

Creates FIXFieldList containing the elements of the specified collection.

Parameters:
message - - the collection whose fields are to be placed into this list
Method Detail

isUserOwned

public boolean isUserOwned()
Returns:
See Also:
setIsUserOwned(boolean)

isPreparedMessage

public final boolean isPreparedMessage()

isMessageIncomplete

public final boolean isMessageIncomplete()

isOriginatingFromPool

public final boolean isOriginatingFromPool()

makeStandalone

protected abstract FIXFieldList makeStandalone()

switchToStandalone

protected void switchToStandalone()

add

public final int add(TagValue tagValue)

addAll

public final boolean addAll(FIXFieldList list)

clear

public void clear()
Overrides:
clear in class IndexedStorage

deepCopyTo

public final FIXFieldList deepCopyTo(FIXFieldList cloned)

canCopyInPlace

protected boolean canCopyInPlace(int index,
                                 int oldLen,
                                 int newLen)
Overrides:
canCopyInPlace in class IndexedStorage

canCopyInPlaceNumber

protected boolean canCopyInPlaceNumber(int index,
                                       int oldLen,
                                       int newLen)
Overrides:
canCopyInPlaceNumber in class IndexedStorage

getTagNumAtIndex

public final int getTagNumAtIndex(int index)

getTagLength

public final int getTagLength(int tag)
                       throws FieldNotFoundException
Throws:
FieldNotFoundException

calculateBodyLength

public final int calculateBodyLength()
Calculates body length for collection.

Returns:
body length

calculateChecksum

public final int calculateChecksum()
Calculates checksum.

Returns:
checksum

toString

public final String toString()
Converts collection of fix fields to string.

Overrides:
toString in class Object

toByteArray

public final byte[] toByteArray()
Writes field list to array of bytes.

Returns:
byte origBuffer

isMessageBufferContinuous

public final boolean isMessageBufferContinuous()

toByteArrayAndReturnNextPosition

public final int toByteArrayAndReturnNextPosition(byte[] dst,
                                                  int offset)
Writes the list of field to the origBuffer, and returns the next index.
The SOH symbol is added after each field.

Parameters:
dst - the origBuffer
offset - the offset in origBuffer

split

public final List<FIXFieldList> split(int tag)
Utility method that splits current message into the repeating groups based on first mandatory tag in the repeating group (always first tag in the repeating group).

Parameters:
tag - the tag number
Returns:
List of repeating groups (each one is separate FIXFieldList)

notifyInvalidMessage

protected abstract List<Map<Integer,FIXField>> notifyInvalidMessage(int rgTag,
                                                                    int rgFirstTag)

getTagIndex

public final int getTagIndex(int tag)
Overrides:
getTagIndex in class IndexedStorage

removeTag

public final boolean removeTag(int tag)
Removes a fix field with specified tag from collection.
The methods removes the first occurrence of the specified tag.

Overrides:
removeTag in class IndexedStorage
Parameters:
tag - the fix tag.
Returns:
true if the element was removed.

isEmpty

public boolean isEmpty()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getTagValueIterator

protected Iterator<TagValue> getTagValueIterator()
Calculation based on the number tag and length of the tag value

Returns:
hash code of list fields //


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.