rm package

This commit is contained in:
orange 2016-12-14 12:54:39 +01:00
parent 28900650a6
commit b0d88a567f
10 changed files with 69 additions and 33 deletions

View File

@ -1,5 +1,3 @@
package com.gmail.zurlo.michelef.util;
import java.text.SimpleDateFormat;
public class Constants {

View File

@ -1,5 +1,3 @@
package com.gmail.zurlo.michelef.util;
public class IllegalDateException extends RuntimeException {
public IllegalDateException() {

View File

@ -1,5 +1,3 @@
package com.gmail.zurlo.michelef.util;
public class IllegalPercentageException extends RuntimeException {
public IllegalPercentageException() {

View File

@ -1,5 +1,3 @@
package com.gmail.zurlo.michelef.util;
public class IncorrectLabelException extends RuntimeException {
public IncorrectLabelException() {

View File

@ -1,11 +1,7 @@
package com.gmail.zurlo.michelef.classi;
import java.io.PrintStream;
import java.util.Date;
import java.util.Scanner;
import com.gmail.zurlo.michelef.util.IllegalPercentageException;
public class IndustrialProject extends Project {
public IndustrialProject(String name, String description, double budget, Date start, Date end, String company,

View File

@ -1,14 +1,9 @@
package com.gmail.zurlo.michelef.classi;
import java.io.PrintStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
import com.gmail.zurlo.michelef.util.Constants;
import com.gmail.zurlo.michelef.util.IllegalDateException;
public class Project {
public Project(String name, String description, double budget, Date start, Date end) {

View File

@ -1,14 +1,7 @@
package com.gmail.zurlo.michelef.scenari;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import com.gmail.zurlo.michelef.classi.IndustrialProject;
import com.gmail.zurlo.michelef.classi.Project;
import com.gmail.zurlo.michelef.classi.ResearchProject;
import com.gmail.zurlo.michelef.util.IncorrectLabelException;
public class ProjectTester {
public static void main(String[] args) throws FileNotFoundException {

View File

@ -1,12 +1,8 @@
package com.gmail.zurlo.michelef.classi;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.Scanner;
import com.gmail.zurlo.michelef.util.IncorrectLabelException;
public class ResearchCenter {
public ResearchCenter(Scanner sc) {
@ -86,6 +82,16 @@ public class ResearchCenter {
return new ResearchCenter(projectsFilter);
}
public ResearchCenter researchProjectFilter(){
ArrayList<Project> projectsFilter = new ArrayList<Project>();
for(Project p: project)
if(p istanceof ResearchProject)
projectsFilter.add(p);
return new ResearchCenter(projectsFilter);
}
public void sortByName() {
int i, j = 0;
boolean done = false;

View File

@ -1,11 +1,7 @@
package com.gmail.zurlo.michelef.scenari;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import com.gmail.zurlo.michelef.classi.ResearchCenter;
public class ResearchCenterTester {
public static void main(String[] args) throws FileNotFoundException {

View File

@ -1,3 +1,61 @@
import java.io.PrintStream;
import java.util.Date;
import java.util.Scanner;
public class ResearchProject extends Project {
public ResearchProject(String name, String description, double budget, Date start, Date end, String fundingBody,
String fundingLaw) {
super(name, description, budget, start, end);
this.fundingBody = fundingBody;
this.fundingLaw = fundingLaw;
}
public String getFundingBody() {
return fundingBody;
}
public void setFundingBody(String fundingBody) {
this.fundingBody = fundingBody;
}
public String getFundingLaw() {
return fundingLaw;
}
public void setFundingLaw(String fundingLaw) {
this.fundingLaw = fundingLaw;
}
public static ResearchProject read(Scanner sc) {
String fundingBody, fundingLaw;
Project p = Project.read(sc);
if (!sc.hasNextLine()) {
return null;
}
fundingBody = sc.nextLine();
if (!sc.hasNextLine()) {
return null;
}
fundingLaw = sc.nextLine();
return new ResearchProject(p.getName(), p.getDescription(), p.getBudget(), p.getStart(), p.getEnd(),
fundingBody, fundingLaw);
}
public void print(PrintStream ps) {
super.print(ps);
ps.println(fundingBody);
ps.println(fundingLaw);
}
private String fundingBody;
private String fundingLaw;
}
package com.gmail.zurlo.michelef.classi;
import java.io.PrintStream;