Last change
on this file since 219 was 219, checked in by Faria Nassiri Mofakham, 6 years ago |
'Line' problem (and in GUI) fixed. (There also have been several updates in other files before this commit!!)
|
File size:
1.2 KB
|
Rev | Line | |
---|
[209] | 1 | package negotiator.onetomany;
|
---|
| 2 |
|
---|
[211] | 3 | import java.awt.Color;
|
---|
[219] | 4 | import java.awt.List;
|
---|
| 5 | import java.util.Iterator;
|
---|
[211] | 6 |
|
---|
[209] | 7 | public class Main
|
---|
| 8 | {
|
---|
| 9 | private Portfolio portfolio;
|
---|
[215] | 10 | private DemandPlan demandPlan;
|
---|
[209] | 11 |
|
---|
| 12 | public Main()
|
---|
| 13 | {
|
---|
[212] | 14 | Product redProduct = new Product("Red");
|
---|
| 15 | Product pinkProduct = new Product("Pink");
|
---|
| 16 | Product blueProduct = new Product("Blue");
|
---|
[211] | 17 |
|
---|
[215] | 18 |
|
---|
[209] | 19 | portfolio = new Portfolio();
|
---|
[215] | 20 |
|
---|
[209] | 21 | portfolio.addProduct(redProduct);
|
---|
[212] | 22 | portfolio.addProduct(pinkProduct);
|
---|
[219] | 23 | portfolio.addProduct(pinkProduct);
|
---|
[209] | 24 | portfolio.addProduct(blueProduct);
|
---|
[215] | 25 |
|
---|
[219] | 26 |
|
---|
[215] | 27 | // int s = portfolio.size();
|
---|
| 28 | // for (int i=0; i<s; i++)
|
---|
| 29 | // {
|
---|
[219] | 30 | // //demandPlan.setQuantity(portfolio.getProduct(i), (int)Math.random()*5+1 );
|
---|
| 31 | //// System.out.println(portfolio.getProduct(i).getColor());
|
---|
| 32 | // }
|
---|
| 33 | //
|
---|
| 34 | //// Iterator<Product> t = (Iterator<Product>) portfolio.iterator();
|
---|
| 35 | //// for(List p:t)
|
---|
| 36 | //// {
|
---|
| 37 | //// System.out.println(p);
|
---|
| 38 | //// }
|
---|
| 39 |
|
---|
| 40 | // demandPlan = new DemandPlan();
|
---|
| 41 | //
|
---|
| 42 | // for (Product product : portfolio.getPortfolio())
|
---|
| 43 | // {
|
---|
| 44 | // demandPlan.setQuantity(product, (int)(Math.random()*5+1));
|
---|
| 45 | // }
|
---|
| 46 |
|
---|
[209] | 47 | }
|
---|
[219] | 48 |
|
---|
[209] | 49 |
|
---|
| 50 | public Portfolio getPortfolio()
|
---|
| 51 | {
|
---|
| 52 | return portfolio;
|
---|
| 53 | }
|
---|
[215] | 54 |
|
---|
[219] | 55 | public DemandPlan getDemandPlan()
|
---|
| 56 | {
|
---|
| 57 | return demandPlan;
|
---|
| 58 | }
|
---|
[209] | 59 |
|
---|
| 60 | }
|
---|
[215] | 61 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.