-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from einaskoi/einar/exchange
implement skeleton for exchange class
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Model/Exchange.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,55 @@ | ||
| package edu.ntnu.idi.idatt2003.gruppe42.Model; | ||
|
|
||
| import edu.ntnu.idi.idatt2003.gruppe42.Model.Transaction.Transaction; | ||
|
|
||
| import java.math.BigDecimal; | ||
| import java.util.HashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.Random; | ||
|
|
||
| public class Exchange { | ||
| private String name; | ||
| private int week; | ||
| private Map<String, Stock> stockMap; | ||
| private Random random; | ||
|
|
||
| public Exchange(String name, List<Stock> stocks) { | ||
| this.name = name; | ||
| this.week = 0; | ||
| this.stockMap = new HashMap<String, Stock>(); | ||
| this.random = new Random(); | ||
| } | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| public int getWeek() { | ||
| return week; | ||
| } | ||
|
|
||
| public boolean hasStock(String symbol) { | ||
| return true; | ||
| } | ||
|
|
||
| public Stock getStock(String symbol) { | ||
| return null; | ||
| } | ||
|
|
||
| public List<Stock> findStocks(String searchTerm) { | ||
| return null; | ||
| } | ||
|
|
||
| public Transaction buy(String symbol, BigDecimal quantity, Player player) { | ||
| return null; | ||
| } | ||
|
|
||
| public Transaction sell(Share share, Player player) { | ||
| return null; | ||
| } | ||
|
|
||
| public void advance() { | ||
| week += 1; | ||
| } | ||
| } |