edu.umass.cs.sase.stream
Class StockEvent

java.lang.Object
  extended by edu.umass.cs.sase.stream.StockEvent
All Implemented Interfaces:
Event

public class StockEvent
extends java.lang.Object
implements Event

This class represents the stock event.

Author:
haopeng

Constructor Summary
StockEvent(int id, int ts, int symbol, int price, int volume)
          Constructor
StockEvent(int id, int ts, int symbol, int price, int volume, java.lang.String type)
          Another constructor
 
Method Summary
 java.lang.Object clone()
          Clones the event
 int getAttributeByName(java.lang.String attributeName)
          Returns the attribute value for the given attribute
 double getAttributeByNameDouble(java.lang.String attributeName)
          Returns the value of the attribute with the required name
 java.lang.String getAttributeByNameString(java.lang.String attributeName)
          Returns the value of the attribute with the required name
 int getAttributeValueType(java.lang.String attributeName)
          Returns the value type of the attribute
 java.lang.String getEventType()
           
 int getId()
           
 int getPrice()
           
 int getSymbol()
           
 int getTimestamp()
           
 int getVolume()
           
 void setEventType(java.lang.String eventType)
           
 void setId(int id)
           
 void setPrice(int price)
           
 void setSymbol(int symbol)
           
 void setTimestamp(int timestamp)
           
 void setVolume(int volume)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StockEvent

public StockEvent(int id,
                  int ts,
                  int symbol,
                  int price,
                  int volume)
Constructor


StockEvent

public StockEvent(int id,
                  int ts,
                  int symbol,
                  int price,
                  int volume,
                  java.lang.String type)
Another constructor

Parameters:
id -
ts -
symbol -
price -
volume -
type -
Method Detail

getAttributeByName

public int getAttributeByName(java.lang.String attributeName)
Returns the attribute value for the given attribute

Specified by:
getAttributeByName in interface Event
Parameters:
attributeName - The name of the attribute to be returned
Returns:
the value of the attribute, integer

getEventType

public java.lang.String getEventType()
Specified by:
getEventType in interface Event
Returns:
the event type

getId

public int getId()
Specified by:
getId in interface Event
Returns:
the event id

getTimestamp

public int getTimestamp()
Specified by:
getTimestamp in interface Event
Returns:
the timestamp of the event

toString

public java.lang.String toString()
Specified by:
toString in interface Event
Overrides:
toString in class java.lang.Object
Returns:
self description

getSymbol

public int getSymbol()
Returns:
the symbol

setSymbol

public void setSymbol(int symbol)
Parameters:
symbol - the symbol to set

getPrice

public int getPrice()
Returns:
the price

setPrice

public void setPrice(int price)
Parameters:
price - the price to set

getVolume

public int getVolume()
Returns:
the volume

setVolume

public void setVolume(int volume)
Parameters:
volume - the volume to set

setId

public void setId(int id)
Specified by:
setId in interface Event
Parameters:
id - the id to set

setTimestamp

public void setTimestamp(int timestamp)
Parameters:
timestamp - the timestamp to set

setEventType

public void setEventType(java.lang.String eventType)
Parameters:
eventType - the eventType to set

clone

public java.lang.Object clone()
Clones the event

Specified by:
clone in interface Event
Overrides:
clone in class java.lang.Object
Returns:
the cloned event

getAttributeByNameDouble

public double getAttributeByNameDouble(java.lang.String attributeName)
Description copied from interface: Event
Returns the value of the attribute with the required name

Specified by:
getAttributeByNameDouble in interface Event
Parameters:
attributeName - the required attribute name
Returns:
the value of the attribute, double

getAttributeByNameString

public java.lang.String getAttributeByNameString(java.lang.String attributeName)
Description copied from interface: Event
Returns the value of the attribute with the required name

Specified by:
getAttributeByNameString in interface Event
Parameters:
attributeName - the required attribute name
Returns:
the value of the attribute, string

getAttributeValueType

public int getAttributeValueType(java.lang.String attributeName)
Description copied from interface: Event
Returns the value type of the attribute

Specified by:
getAttributeValueType in interface Event
Parameters:
attributeName - the required attribute name
Returns:
the code representing the type, 0 for integer, 1 for double, 2 for string