Compare commits
No commits in common. "830f1178588b6e7b71cd88624c953f656ec0d30e" and "7ce8251e6d4b55b89647c5253e584a8ba9a394fa" have entirely different histories.
830f117858
...
7ce8251e6d
|
@ -1,8 +0,0 @@
|
||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
|
@ -1,9 +0,0 @@
|
||||||
<?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$" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectRootManager">
|
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/OOP_IO-2x_2023.iml" filepath="$PROJECT_DIR$/.idea/OOP_IO-2x_2023.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/lab1/lab1.iml" filepath="$PROJECT_DIR$/lab1/lab1.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/lab2/lab2.iml" filepath="$PROJECT_DIR$/lab2/lab2.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/lab3/lab3.iml" filepath="$PROJECT_DIR$/lab3/lab3.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<?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$/FunctionCalculator/src" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<?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$/Matrix/src" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<?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$/OperationsStrings/src" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
|
@ -1,8 +0,0 @@
|
||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="openjdk-19" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/EducationalInstitution.iml" filepath="$PROJECT_DIR$/EducationalInstitution.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<?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>
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,8 +0,0 @@
|
||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="openjdk-19" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/untitled.iml" filepath="$PROJECT_DIR$/untitled.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,56 +0,0 @@
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
public class Main {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
List<SeaShip> ships = createList();
|
|
||||||
|
|
||||||
printList(ships);
|
|
||||||
|
|
||||||
ships = sortList(ships);
|
|
||||||
|
|
||||||
System.out.println("==============================");
|
|
||||||
|
|
||||||
printList(ships);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static ArrayList<SeaShip> createList() {
|
|
||||||
ArrayList<SeaShip> ships = new ArrayList<>();
|
|
||||||
Random random = new Random();
|
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++)
|
|
||||||
ships.add(new SeaShip("name" + (i + 1), "class" + (i + 1), "type" + (i + 1),
|
|
||||||
random.nextInt(10000) + 1000, random.nextDouble() * 100 + 20,
|
|
||||||
random.nextInt(10000) + 1000, random.nextDouble() * 100));
|
|
||||||
|
|
||||||
// ships.add(new SeaShip("nameA", "classA", "typeA",
|
|
||||||
// random.nextInt(10000) + 1000, 100d,
|
|
||||||
// random.nextInt(10000) + 1000, 120d));
|
|
||||||
// ships.add(new SeaShip("nameA", "classA", "typeA",
|
|
||||||
// random.nextInt(10000) + 1000, 100d,
|
|
||||||
// random.nextInt(10000) + 1000, 130d));
|
|
||||||
// ships.add(new SeaShip("nameA", "classA", "typeA",
|
|
||||||
// random.nextInt(10000) + 1000, 100d,
|
|
||||||
// random.nextInt(10000) + 1000, 140d));
|
|
||||||
// ships.add(new SeaShip("nameA", "classA", "typeA",
|
|
||||||
// random.nextInt(10000) + 1000, 120d,
|
|
||||||
// random.nextInt(10000) + 1000, 120d));
|
|
||||||
// ships.add(new SeaShip("nameA", "classA", "typeA",
|
|
||||||
// random.nextInt(10000) + 1000, 120d,
|
|
||||||
// random.nextInt(10000) + 1000, 100d));
|
|
||||||
|
|
||||||
return ships;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<SeaShip> sortList(List<SeaShip> list) {
|
|
||||||
Comparator<SeaShip> comparator = Comparator.comparing(SeaShip::getLength).reversed()
|
|
||||||
.thenComparing(SeaShip::getMaxSpeed);
|
|
||||||
|
|
||||||
list.sort(comparator);
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void printList(List<SeaShip> list) {
|
|
||||||
list.forEach(System.out::println);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,86 +0,0 @@
|
||||||
|
|
||||||
public class SeaShip {
|
|
||||||
private String name;
|
|
||||||
private String shipClass;
|
|
||||||
private String type;
|
|
||||||
private Integer weight;
|
|
||||||
private Double length;
|
|
||||||
private Integer power;
|
|
||||||
private Double maxSpeed;
|
|
||||||
|
|
||||||
public SeaShip(String name, String shipClass, String type,
|
|
||||||
Integer weight, Double length, Integer power, Double maxSpeed) {
|
|
||||||
this.name = name;
|
|
||||||
this.shipClass = shipClass;
|
|
||||||
this.type = type;
|
|
||||||
this.weight = weight;
|
|
||||||
this.length = length;
|
|
||||||
this.power = power;
|
|
||||||
this.maxSpeed = maxSpeed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getShipClass() {
|
|
||||||
return shipClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShipClass(String shipClass) {
|
|
||||||
this.shipClass = shipClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(String type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getWeight() {
|
|
||||||
return weight;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWeight(Integer weight) {
|
|
||||||
this.weight = weight;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getLength() {
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLength(Double length) {
|
|
||||||
this.length = length;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getPower() {
|
|
||||||
return power;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPower(Integer power) {
|
|
||||||
this.power = power;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getMaxSpeed() {
|
|
||||||
return maxSpeed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMaxSpeed(Double maxSpeed) {
|
|
||||||
this.maxSpeed = maxSpeed;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "Sea ship '" + name + "', class: " + shipClass + ", type: " + type + ".\n" +
|
|
||||||
"Weight: " + weight + "\n" +
|
|
||||||
"Length: " + length + "\n" +
|
|
||||||
"Engine power: " + power + "\n" +
|
|
||||||
"Max speed: " + maxSpeed + "\n";
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
<?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>
|
|
Loading…
Reference in New Issue