Athlete implementiert
This commit is contained in:
56
Athlete.java
Normal file
56
Athlete.java
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
|
||||
/**
|
||||
* Beschreiben Sie hier die Klasse Athlete.
|
||||
*
|
||||
* @author (Ihr Name)
|
||||
* @version (eine Versionsnummer oder ein Datum)
|
||||
*/
|
||||
public class Athlete implements ComparableContent<Athlete>{
|
||||
|
||||
String name;
|
||||
long startTime;
|
||||
long endTime;
|
||||
|
||||
public Athlete(String pName) {
|
||||
name = pName;
|
||||
}
|
||||
|
||||
public String getName(){
|
||||
return name;
|
||||
}
|
||||
|
||||
public long getStartTime(){
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public long getEndTime(){
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public double getFinalTime(){
|
||||
return getEndTime() - getStartTime();
|
||||
}
|
||||
|
||||
public void setStartTime(long pStartTime){
|
||||
startTime = pStartTime;
|
||||
}
|
||||
|
||||
public void setEndTime(long pEndTime){
|
||||
endTime = pEndTime;
|
||||
}
|
||||
|
||||
public boolean isGreater(Athlete pOther){
|
||||
return getFinalTime() > pOther.getFinalTime();
|
||||
}
|
||||
|
||||
public boolean isEqual(Athlete pOther){
|
||||
return getFinalTime() == pOther.getFinalTime();
|
||||
}
|
||||
|
||||
public boolean isLess(Athlete pOther){
|
||||
return getFinalTime() < pOther.getFinalTime();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
#BlueJ package file
|
||||
editor.fx.0.height=738
|
||||
editor.fx.0.width=816
|
||||
editor.fx.0.x=232
|
||||
editor.fx.0.y=82
|
||||
objectbench.height=87
|
||||
editor.fx.0.height=0
|
||||
editor.fx.0.width=0
|
||||
editor.fx.0.x=0
|
||||
editor.fx.0.y=0
|
||||
objectbench.height=92
|
||||
objectbench.width=760
|
||||
package.divider.horizontal=0.6
|
||||
package.divider.vertical=0.812375249500998
|
||||
package.editor.height=400
|
||||
package.divider.vertical=0.8023952095808383
|
||||
package.editor.height=395
|
||||
package.editor.width=649
|
||||
package.editor.x=170
|
||||
package.editor.y=331
|
||||
package.editor.x=140
|
||||
package.editor.y=80
|
||||
package.frame.height=600
|
||||
package.frame.width=800
|
||||
package.numDependencies=0
|
||||
@@ -28,12 +28,12 @@ target1.name=BinaryTree
|
||||
target1.showInterface=false
|
||||
target1.type=ClassTarget
|
||||
target1.width=190
|
||||
target1.x=110
|
||||
target1.y=50
|
||||
target1.x=350
|
||||
target1.y=80
|
||||
target2.height=50
|
||||
target2.name=List
|
||||
target2.showInterface=false
|
||||
target2.type=ClassTarget
|
||||
target2.width=150
|
||||
target2.x=260
|
||||
target2.x=60
|
||||
target2.y=160
|
||||
|
||||
Reference in New Issue
Block a user