-
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.
- Loading branch information
1 parent
4549260
commit 930b7c0
Showing
47 changed files
with
1,539 additions
and
50 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package MainFirstTask; | ||
|
||
/** | ||
* Beta (������) | ||
* @version 1.0 3 Oct 2013 | ||
* @author Andrei Loyevets | ||
*/ | ||
public class Beta extends RootVegetable{ | ||
|
||
/** | ||
* Default constructor. | ||
*/ | ||
public Beta() { | ||
super("Beta", 47); | ||
} | ||
|
||
/** | ||
* Constructor with parameters. Creates a Beta of a given weight. | ||
* @param weight the mass of the vegetable that will be created | ||
*/ | ||
public Beta(double weight) { | ||
super("Beta", 47, weight); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package MainFirstTask; | ||
|
||
/** | ||
* This class implements interface Comparator to compare Vegetables by | ||
* calories per 100g. | ||
* @version 1.0 3 Oct 2013 | ||
* @author Andrei Loyevets | ||
*/ | ||
public class CaloriesComparator implements java.util.Comparator<Vegetable>{ | ||
|
||
public int compare(Vegetable v1, Vegetable v2) { | ||
return (int) (v1.getCalories() - v2.getCalories()); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package MainFirstTask; | ||
|
||
/** | ||
* Carrot (�������) | ||
* @version 1.0 3 Oct 2013 | ||
* @author Andrei Loyevets | ||
*/ | ||
public class Carrot extends RootVegetable{ | ||
|
||
/** | ||
* Default constructor. | ||
*/ | ||
public Carrot() { | ||
super("Carrot", 41); | ||
} | ||
|
||
/** | ||
* Constructor with parameters. Creates a Carrot of a given weight. | ||
* @param weight the mass of the vegetable that will be created | ||
*/ | ||
public Carrot(double weight) { | ||
super("Carrot", 41, weight); | ||
} | ||
} |
Oops, something went wrong.