Lab 7 init

This commit is contained in:
Aelita4 2022-11-29 09:34:27 +01:00
commit aedf9d1ae3
Signed by: Aelita4
GPG Key ID: C217320B9C5FD53B
8 changed files with 111 additions and 0 deletions

29
.gitignore vendored Normal file
View File

@ -0,0 +1,29 @@
### IntelliJ IDEA ###
out/
!**/src/main/**/out/
!**/src/test/**/out/
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

3
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

6
.idea/misc.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Lab7.iml" filepath="$PROJECT_DIR$/Lab7.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

11
Lab7.iml Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

10
src/Main.java Normal file
View File

@ -0,0 +1,10 @@
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) {
List<Uczestnik> uczestnicy = new ArrayList<>();
}
}

38
src/Uczestnik.java Normal file
View File

@ -0,0 +1,38 @@
import java.util.Objects;
public class Uczestnik {
int id;
String imie;
int wiek;
public Uczestnik(int id, String imie, int wiek) {
this.id = id;
this.imie = imie;
this.wiek = wiek;
}
@Override
public String toString() {
return "Uczestnik{" +
"id=" + id +
", imie='" + imie + '\'' +
", wiek=" + wiek +
'}';
}
@Override
public boolean equals(Object o) {
if(this == o) return true;
if(!(o instanceof Uczestnik)) return false;
Uczestnik uczestnik = (Uczestnik) o;
return this.getId() == o.getId() &&
this.getImie().equals(o.getImie()) &&
this.getWiek() == o.getWiek();
}
@Override
public int hashCode() {
return Objects.hash(id, imie, wiek);
}
}