Code Examples
A repository of 155 code examples for BeepBeep
stockticker.TickerFeed Class Reference

Public Member Functions

 TickerFeed (int num_companies, int num_days)
 
Processor duplicate (boolean with_state)
 

Static Public Attributes

static final String upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 

Protected Member Functions

String randomString (int length)
 Generates a random string of given length. More...
 
boolean compute (Object[] inputs, Queue< Object[]> outputs)
 

Protected Attributes

String [] m_symbolNames
 
float [] m_lastValues
 
Random m_random
 
int m_computeCount
 
int m_maxDays = 0
 

Static Protected Attributes

static final String [] m_realNames = {"MSFT", "GOGL", "APPL", "AMZN", "RHT", "IBM", "DVMT"}
 

Detailed Description

Definition at line 8 of file TickerFeed.java.

Member Function Documentation

◆ randomString()

String stockticker.TickerFeed.randomString ( int  length)
protected

Generates a random string of given length.

Parameters
lengthThe length of the string
Returns
The string

Definition at line 56 of file TickerFeed.java.

57  {
58  StringBuilder sb = new StringBuilder();
59  for (int i = 0; i < length; i++)
60  {
61  sb.append(upper.charAt(m_random.nextInt(25)));
62  }
63  return sb.toString();
64  }

The documentation for this class was generated from the following file: