All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.thomsonreuters.ema.access.Vector Maven / Gradle / Ivy

There is a newer version: 3.5.1.0
Show newest version
///*|-----------------------------------------------------------------------------
// *|            This source code is provided under the Apache 2.0 license      --
// *|  and is provided AS IS with no warranty or guarantee of fit for purpose.  --
// *|                See the project's LICENSE.md for details.                  --
// *|           Copyright (C) 2019 Refinitiv. All rights reserved.            --
///*|-----------------------------------------------------------------------------

package com.thomsonreuters.ema.access;

import java.util.Collection;

/**
 * Vector is a homogeneous container of complex data type entries.
* Vector is a collection which provides iterator over the elements in this collection.
* * Vector entries are identified by index. * * The following code snippet shows addition of entry and summaryData to Vector. *
 * Vector vector = EmaFactory.createVector();
 * FieldList fl = EmaFactory.createFieldList();
 * fl.add(EmaFactory.createFieldEntry().real(22, 34, OmmReal.MagnitudeType.EXPONENT_POS_1));
 * vector.summaryData(fl);
 * ByteBuffer permission = (ByteBuffer)ByteBuffer.wrap("PERMISSION DATA".getBytes());
 * fl.clear();
 * fl.add(EmaFactory.createFieldEntry().real(22, 34, OmmReal.MagnitudeType.EXPONENT_POS_1));
 * vector.add(EmaFactory.createVectorEntry().fieldList(1, VectorEntry.VectorAction.DELETE, fl, permission));
 * vector.add(EmaFactory.createVectorEntry().fieldList(1, VectorEntry.VectorAction.SET, fl, permission));
 * 
* * The following code snippet shows extracting data from Vector and its content. *
 * void decode(Vector vector)
 * {
 *    switch(vector.summaryData().dataType())
 *    {
 *    case DataTypes.FIELD_LIST:
 *         decode(vector.summaryData().fieldList());
 *         break;
 *    case DataTypes.NO_DATA:
 *         break;
 *    }
 *
 *    for(VectorEntry vectorEntry : vector)
 *    {
 *       System.out.println(" DataType: " + DataType.asString(vectorEntry.loadType()) + " Value: ");
 *
 *       switch(vectorEntry.loadType())
 *       {
 *       case DataTypes.FIELD_LIST:
 *           decode(vectorEntry.fieldList());
 *           break;
 *       case DataTypes.NO_DATA:
 *           break;
 *       }
 *    }
 * }
 * 
* * Objects of this class are intended to be short lived or rather transitional.
* This class is designed to efficiently perform setting and extracting of Vector and its content.
* Objects of this class are not cache-able. * * @see Data * @see VectorEntry * @see SummaryData * @see ReqMsg * @see RefreshMsg * @see UpdateMsg * @see StatusMsg * @see GenericMsg * @see PostMsg * @see AckMsg * @see ElementList * @see Map * @see Vector * @see Series * @see FilterList * @see OmmOpaque * @see OmmXml * @see OmmAnsiPage * @see OmmError */ public interface Vector extends ComplexType, Collection { /** * Indicates presence of TotalCountHint. * * @return true if total count hint is set; false otherwise */ public boolean hasTotalCountHint(); /** * Returns Sortable. * * @return true if sortable flag is set; false otherwise */ public boolean sortable(); /** * Returns TotalCountHint. * * @throws OmmInvalidUsageException * if {@link #hasTotalCountHint()} returns false * * @return total count hint */ public int totalCountHint(); /** * Returns the contained summaryData Data based on the summaryData DataType. *
* SummaryData contains no data if {@link SummaryData#dataType()} returns * {@link com.thomsonreuters.ema.access.DataType.DataTypes#NO_DATA} * * @return {@link SummaryData} */ public SummaryData summaryData(); /** * Clears the Vector.
* Invoking clear() method clears all the values and resets all the * defaults. */ public void clear(); /** * Specifies Sortable. * * @param sortable * specifies if this object is sortable * * @return reference to this object */ public Vector sortable(boolean sortable); /** * Specifies TotalCountHint. * * @param totalCountHint * specifies total count hint * * @return reference to this object */ public Vector totalCountHint(int totalCountHint); /** * Specifies the SummaryData OMM Data.
* Call to summaryData() must happen prior to calling the add() method * * @throws OmmInvalidUsageException * if an error is detected (exception will specify the cause of * the error) * * @param data * specifies complex type as summaryData * @return reference to this object */ public Vector summaryData(ComplexType data); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy