Package soc.qase.com.message

Source Code of soc.qase.com.message.ServerInventory

//---------------------------------------------------------------------
// Name:      ServerInventory.java
// Author:      Bernard.Gorman@computing.dcu.ie
// Author:      Martin.Fredriksson@bth.se
//---------------------------------------------------------------------

package soc.qase.com.message;

import soc.qase.state.Inventory;
import soc.qase.tools.Utils;

/*-------------------------------------------------------------------*/
/**  Message wrapper used to store the inventory list received from
*  the server. */
/*-------------------------------------------------------------------*/
public class ServerInventory extends Message
{
  private Inventory inventory = null;

/*-------------------------------------------------------------------*/
/**  Constructor. Parses the data and extracts message details.
@param data message source. */
/*-------------------------------------------------------------------*/
  public ServerInventory(byte[] data, int off)
  {
    inventory = new Inventory();

    for(int i = 0; i < 256; i++)
      inventory.setCount(i, Utils.shortValue(data, off + (i * 2)));

    setLength(512);
  }

/*-------------------------------------------------------------------*/
/*-------------------------------------------------------------------*/
  public Inventory getInventory()
  {
    return inventory;
  }
}
TOP

Related Classes of soc.qase.com.message.ServerInventory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.