source: src/main/java/negotiator/onetomany/Product.java@ 217

Last change on this file since 217 was 212, checked in by Faria Nassiri Mofakham, 6 years ago
File size: 546 bytes
Line 
1package negotiator.onetomany;
2
3import java.awt.Color;
4
5/**
6 * A product, such as Paracetamol, or a Red Dot
7 */
8public class Product
9{
10
11 String id;
12
13 public Product(String id)
14 {
15 this.id = id;
16 }
17
18 @Override
19 public String toString()
20 {
21 return id;
22 }
23
24 public Color getColor()
25 {
26 switch(id)
27 {
28 case "Red":
29 return Color.RED;
30 case "Blue":
31 return Color.BLUE;
32 case "Pink":
33 return Color.PINK;
34 default:
35 System.out.println("Undefined color!");
36 return null;
37 }
38 }
39}
Note: See TracBrowser for help on using the repository browser.