cacheRunner
Class Portfolio

java.lang.Object
  extended by cacheRunner.Portfolio
All Implemented Interfaces:
Declarable, Serializable

public class Portfolio
extends Object
implements Declarable, Serializable

A stock portfolio that consists of multiple Position objects that represent shares of stock (a "security"). Instances of Portfolio can be stored in a GemFire Region and their contents can be queried using the GemFire query service.

This class is Serializable because we want it to be distributed to multiple members of a distributed system. Because this class is Declarable, we can describe instances of it in a GemFire cache.xml file.

Since:
4.0
Author:
GemStone Systems, Inc.
See Also:
Serialized Form

Constructor Summary
Portfolio()
           
 
Method Summary
 int getId()
          Returns the id of this portfolio.
 Map getPositions()
          Returns the positions held in this portfolio.
 String getStatus()
          Returns the status of this portfolio (active or inactive).
 String getType()
          Returns the type of this portfolio.
 void init(Properties props)
          Initializes an instance of Portfolio from a Properties object assembled from data residing in a cache.xml file.
 boolean isActive()
          Returns whether or not this portfolio is active.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Portfolio

public Portfolio()
Method Detail

init

public void init(Properties props)
Initializes an instance of Portfolio from a Properties object assembled from data residing in a cache.xml file.

Specified by:
init in interface Declarable

getStatus

public String getStatus()
Returns the status of this portfolio (active or inactive).


getId

public int getId()
Returns the id of this portfolio. When a Portfolio placed in a GemFire Region entry, its id is used as the key.


getPositions

public Map getPositions()
Returns the positions held in this portfolio.

Returns:
a Map whose keys are the security ids and whose values are Position objects.

getType

public String getType()
Returns the type of this portfolio. In this example, the type is an arbitrary string.


isActive

public boolean isActive()
Returns whether or not this portfolio is active.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2008 GemStone Systems, Inc. All Rights Reserved.