M src/kthr/Place.java => src/kthr/Place.java +8 -16
@@ 8,45 8,37 @@ public final class Place {
private double longitude;
private String name;
- public Place(String name, double latitude, double longitude)
- {
+ public Place(String name, double latitude, double longitude) {
this.name = name;
this.latitude = latitude;
this.longitude = longitude;
}
- public double getLatitude()
- {
+ public double getLatitude() {
return this.latitude;
}
- public double getLongitude()
- {
+ public double getLongitude() {
return this.longitude;
}
- public String getName()
- {
+ public String getName() {
return this.name;
}
- public void setLatitude(double latitude)
- {
+ public void setLatitude(double latitude) {
this.latitude = latitude;
}
- public void setLongitude(double longitude)
- {
+ public void setLongitude(double longitude) {
this.longitude = longitude;
}
- public void setName(String name)
- {
+ public void setName(String name) {
this.name = name;
}
- public String toString()
- {
+ public String toString() {
return String.format("Name: %s, Latitude: %.2f, Longitude: %.2f",
this.name, this.latitude, this.longitude);
}
M src/kthr/Property.java => src/kthr/Property.java +2 -4
@@ 4,13 4,11 @@
package kthr;
final class Property {
- public static void print(String property)
- {
+ public static void print(String property) {
System.out.printf("%s = %s", property, System.getProperty(property));
}
- public static void println(String property)
- {
+ public static void println(String property) {
print(property);
System.out.println();
}
M src/kthr/company/Employee.java => src/kthr/company/Employee.java +6 -12
@@ 10,33 10,27 @@ public abstract class Employee {
public abstract double calculateInsurancePayment();
- public String getCitizenId()
- {
+ public String getCitizenId() {
return this.citizenId;
}
- public String getEmail()
- {
+ public String getEmail() {
return this.email;
}
- public String getName()
- {
+ public String getName() {
return this.name;
}
- public void setCitizenId(String id)
- {
+ public void setCitizenId(String id) {
this.citizenId = id;
}
- public void setEmail(String email)
- {
+ public void setEmail(String email) {
this.email = email;
}
- public void setName(String name)
- {
+ public void setName(String name) {
this.name = name;
}
}
M src/kthr/company/HumanResources.java => src/kthr/company/HumanResources.java +1 -2
@@ 4,8 4,7 @@
package kthr.company;
public class HumanResources {
- public void payInsurance(Employee employee)
- {
+ public void payInsurance(Employee employee) {
System.out.printf("Citizen ID: %s%n", employee.getCitizenId());
System.out.printf("Name: %s%n", employee.getName());
System.out.printf("Email: %s%n", employee.getEmail());
M src/kthr/company/Main.java => src/kthr/company/Main.java +4 -8
@@ 4,8 4,7 @@
package kthr.company;
public final class Main {
- private static Manager getManager()
- {
+ private static Manager getManager() {
Manager manager = new Manager();
manager.setCitizenId("12345678916");
@@ 17,8 16,7 @@ public final class Main {
return manager;
}
- private static ProjectWorker getProjectWorker()
- {
+ private static ProjectWorker getProjectWorker() {
ProjectWorker worker = new ProjectWorker();
worker.setCitizenId("98765432124");
@@ 32,8 30,7 @@ public final class Main {
return worker;
}
- private static Worker getWorker()
- {
+ private static Worker getWorker() {
Worker worker = new Worker();
worker.setCitizenId("7439827812");
@@ 45,8 42,7 @@ public final class Main {
return worker;
}
- public static void main(String[] args)
- {
+ public static void main(String[] args) {
HumanResources hr = new HumanResources();
Manager manager = getManager();
Worker worker = getWorker();
M src/kthr/company/Manager.java => src/kthr/company/Manager.java +5 -10
@@ 8,28 8,23 @@ public class Manager extends Employee {
private double salary;
// override
- public double calculateInsurancePayment()
- {
+ public double calculateInsurancePayment() {
return this.salary * 1.6;
}
- public String getDepartment()
- {
+ public String getDepartment() {
return this.department;
}
- public double getSalary()
- {
+ public double getSalary() {
return this.salary;
}
- public void setDepartment(String department)
- {
+ public void setDepartment(String department) {
this.department = department;
}
- public void setSalary(double salary)
- {
+ public void setSalary(double salary) {
this.salary = salary;
}
}
M src/kthr/company/ProjectWorker.java => src/kthr/company/ProjectWorker.java +5 -10
@@ 8,28 8,23 @@ public class ProjectWorker extends Worker {
private String projectName;
// override
- public double calculateInsurancePayment()
- {
+ public double calculateInsurancePayment() {
return super.calculateInsurancePayment() * this.feeFactor;
}
- public double getFeeFactor()
- {
+ public double getFeeFactor() {
return this.feeFactor;
}
- public String getProjectName()
- {
+ public String getProjectName() {
return this.projectName;
}
- public void setFeeFactor(double factor)
- {
+ public void setFeeFactor(double factor) {
this.feeFactor = factor;
}
- public void setProjectName(String name)
- {
+ public void setProjectName(String name) {
this.projectName = name;
}
}
M src/kthr/company/Worker.java => src/kthr/company/Worker.java +5 -10
@@ 8,28 8,23 @@ public class Worker extends Employee {
private int hourPerDay;
// override
- public double calculateInsurancePayment()
- {
+ public double calculateInsurancePayment() {
return this.feePerHour * this.hourPerDay * 30;
}
- public int getFeePerHour()
- {
+ public int getFeePerHour() {
return this.feePerHour;
}
- public int getHourPerDay()
- {
+ public int getHourPerDay() {
return this.hourPerDay;
}
- public void setFeePerHour(int fee)
- {
+ public void setFeePerHour(int fee) {
this.feePerHour = fee;
}
- public void setHourPerDay(int hour)
- {
+ public void setHourPerDay(int hour) {
this.hourPerDay = hour;
}
}
M src/main/Main.java => src/main/Main.java +1 -2
@@ 4,8 4,7 @@
package main;
final class Main {
- public static void main(String[] args)
- {
+ public static void main(String[] args) {
System.out.println("hello world");
}
}