'Added USOS4 mockup;'
This commit is contained in:
parent
4a8e7fb1aa
commit
542c30a043
21
02_UsosMockup4/src/net/hypki/USOS4/Main.java
Normal file
21
02_UsosMockup4/src/net/hypki/USOS4/Main.java
Normal file
@ -0,0 +1,21 @@
|
||||
package net.hypki.USOS4;
|
||||
|
||||
import net.hypki.USOS4.model.Faculty;
|
||||
import net.hypki.USOS4.model.Person;
|
||||
import net.hypki.USOS4.model.Student;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello");
|
||||
|
||||
Student s = new Student();
|
||||
s.setName("Jan");
|
||||
s.setSurname("Kowalski");
|
||||
System.out.println(s.toString());
|
||||
|
||||
// Person p = new Person();
|
||||
Faculty f = new Faculty();
|
||||
}
|
||||
|
||||
}
|
26
02_UsosMockup4/src/net/hypki/USOS4/model/Faculty.java
Normal file
26
02_UsosMockup4/src/net/hypki/USOS4/model/Faculty.java
Normal file
@ -0,0 +1,26 @@
|
||||
package net.hypki.USOS4.model;
|
||||
|
||||
public class Faculty extends Person {
|
||||
|
||||
private String department = null;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString()
|
||||
+ "(" + getDepartment() + ")";
|
||||
}
|
||||
|
||||
public String getDepartment() {
|
||||
return department;
|
||||
}
|
||||
|
||||
public void setDepartment(String department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void terminate() {
|
||||
// 1. dont pay anymore
|
||||
// 2. switch off cards
|
||||
}
|
||||
}
|
31
02_UsosMockup4/src/net/hypki/USOS4/model/Person.java
Normal file
31
02_UsosMockup4/src/net/hypki/USOS4/model/Person.java
Normal file
@ -0,0 +1,31 @@
|
||||
package net.hypki.USOS4.model;
|
||||
|
||||
public abstract class Person {
|
||||
|
||||
private String name = null;
|
||||
|
||||
private String surname = null;
|
||||
|
||||
public abstract void terminate();
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getName() + " " + getSurname();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getSurname() {
|
||||
return surname;
|
||||
}
|
||||
|
||||
public void setSurname(String surname) {
|
||||
this.surname = surname;
|
||||
}
|
||||
}
|
24
02_UsosMockup4/src/net/hypki/USOS4/model/Student.java
Normal file
24
02_UsosMockup4/src/net/hypki/USOS4/model/Student.java
Normal file
@ -0,0 +1,24 @@
|
||||
package net.hypki.USOS4.model;
|
||||
|
||||
public class Student extends Person {
|
||||
|
||||
private int indexNr = 0;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + ", nr indeksu " + getIndexNr();
|
||||
}
|
||||
|
||||
public int getIndexNr() {
|
||||
return indexNr;
|
||||
}
|
||||
|
||||
public void setIndexNr(int indexNr) {
|
||||
this.indexNr = indexNr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void terminate() {
|
||||
// 1. remove from all classes
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user