-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStartUpIdea.java
More file actions
144 lines (132 loc) · 4.4 KB
/
Copy pathStartUpIdea.java
File metadata and controls
144 lines (132 loc) · 4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/**
* @author Prakhar Mittal
* @version 2.0
* This class is a wrapper over different traits of a Startup Idea
*/
public class StartUpIdea implements Comparable<StartUpIdea> {
private String problem;
private String targetCustomer;
private int customerNeed;
private int feasibility;
private int knownPeopleWithProblem;
private int targetMarketSize;
private String competitors;
private int score;
/**
* 7-arg constructor
* @param problem description
* @param targetCustomer target customer
* @param customerNeed 1-10 rating of need
* @param feasibility 1-10 rating of feasibility
* @param knownPeopleWithProblem people you know with the problem
* @param targetMarketSize number of potential customer
* @param competitors current competitors/solutions
*/
public StartUpIdea(String problem, String targetCustomer, int customerNeed,
int feasibility, int knownPeopleWithProblem,
int targetMarketSize, String competitors) {
this.problem = problem;
this.targetCustomer = targetCustomer;
this.customerNeed = customerNeed;
this.knownPeopleWithProblem = knownPeopleWithProblem;
this.feasibility = feasibility;
this.targetMarketSize = targetMarketSize;
this.competitors = competitors;
this.score = (customerNeed + feasibility) * (targetMarketSize + knownPeopleWithProblem * 10000);
}
/**
* Returns full string representation for use in FileUtil
* @return full string representation of StartUpIdea
*/
public String toFullString() {
String str = "";
str += "Problem: " + problem + "\n";
str += "Target Customer: " + targetCustomer + "\n";
str += "Customer Need: " + customerNeed + "\n";
str += "Feasibility: " + feasibility + "\n";
str += "Known People With Problem: " + knownPeopleWithProblem + "\n";
str += "Target Market Size: " + targetMarketSize + "\n";
str += "Competitors: " + competitors + "\n";
return str;
}
/**
* Returns short string for use in ObservableList
* @return short string representation of StartUpIdea
*/
public String toString() {
return problem + " (Score: " + (int) (Math.pow(score, 0.4) * 10.0 / 52) + ")";
}
/**
* This StartUpIdea is less than other StartUpIdea if it is valued higher
* @param other StartUpIdea to be compared
* @return a negative integer, zero, or a positive integer as this
* object is less than, equal to, or greater than the specified object.
*/
public int compareTo(StartUpIdea other) {
return other.score - this.score;
}
/**
* Checks if two startup ideas have the same instance variables
* @param o reference object for comparison
* @return true if variables are equal; false otherwise
*/
public boolean equals(Object o) {
if (o instanceof StartUpIdea) {
StartUpIdea s = (StartUpIdea) o;
return problem.equals(s.problem) && targetCustomer.equals(s.targetCustomer)
&& customerNeed == s.customerNeed && feasibility == s.feasibility
&& knownPeopleWithProblem == s.knownPeopleWithProblem
&& targetMarketSize == s.targetMarketSize && competitors.equals(s.competitors);
}
return false;
}
/**
* Getter for problem
* @return problem
*/
public String getProblem() {
return problem;
}
/**
* Getter for targetCustomer
* @return targetCustomer
*/
public String getTargetCustomer() {
return targetCustomer;
}
/**
* Getter for customerNeed
* @return customerNeed
*/
public int getCustomerNeed() {
return customerNeed;
}
/**
* Getter for feasibility
* @return feasibility
*/
public int getFeasibility() {
return feasibility;
}
/**
* Getter for knownPeopleWithProblem
* @return knownPeopleWithProblem
*/
public int getKnownPeopleWithProblem() {
return knownPeopleWithProblem;
}
/**
* Getter for targetMarketSize
* @return targetMarketSize
*/
public int getTargetMarketSize() {
return targetMarketSize;
}
/**
* Getter for competitors
* @return competitors
*/
public String getCompetitors() {
return competitors;
}
}