This commit is contained in:
Oleksandr Hryshchenko 2022-12-14 01:20:10 +01:00
parent f0cf085391
commit 29bc9ee411
71 changed files with 2023 additions and 0 deletions

View File

@ -0,0 +1 @@
<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="ASK" />
<option name="description" value="" />
</component>
</project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View File

@ -0,0 +1,10 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<Languages>
<language minSize="80" name="Java" />
</Languages>
</inspection_tool>
</profile>
</component>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectKey">
<option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="19" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

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$/MyFirstUniverse.iml" filepath="$PROJECT_DIR$/MyFirstUniverse.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,3 @@
<template>
<input-field default="com.company">IJ_BASE_PACKAGE</input-field>
</template>

View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitSharedSettings">
<option name="synchronizeBranchProtectionRules" value="false" />
</component>
</project>

View File

@ -0,0 +1,201 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="857763f3-a81c-449a-8888-ff5df6dee023" name="Changes" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Enum" />
<option value="Interface" />
<option value="Class" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="ADD_SUFFIX_TO_CHERRY_PICKS_OF_PUBLISHED_COMMITS" value="false" />
<option name="PREVIEW_PUSH_ON_COMMIT_AND_PUSH" value="false" />
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/svet" />
<option name="WARN_ABOUT_CRLF" value="false" />
<option name="WARN_ABOUT_DETACHED_HEAD" value="false" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="2FMghcaH7Xgm9xQ0FjmXbPkGzmg" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
<pane id="Scope" />
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="untitled104" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="untitled104" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="untitled104" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="untitled104" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="untitled104" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="company" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
</panes>
</component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
&quot;last_opened_file_path&quot;: &quot;D:/Study/3year/OOP/MyFirstUniverse&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;
}
}</component>
<component name="RecentsManager">
<key name="CreateClassDialog.RecentsKey">
<recent name="com.company.creature.cicavce" />
</key>
</component>
<component name="RunManager">
<configuration name="Main" type="Application" factoryName="Application" temporary="true">
<option name="MAIN_CLASS_NAME" value="Main" />
<module name="MyFirstUniverse" />
<option name="PROGRAM_PARAMETERS" value="zoznamStvorenia.txt" />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Application.Main" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="857763f3-a81c-449a-8888-ff5df6dee023" name="Changes" comment="" />
<created>1664307490741</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1664307490741</updated>
<workItem from="1664307493533" duration="462000" />
<workItem from="1664954212249" duration="490000" />
<workItem from="1664955256543" duration="2938000" />
<workItem from="1664992953981" duration="2047000" />
<workItem from="1665396660524" duration="122000" />
<workItem from="1665529647566" duration="30000" />
<workItem from="1665559082986" duration="7912000" />
<workItem from="1665672593323" duration="70000" />
<workItem from="1666768705578" duration="4327000" />
<workItem from="1667733329462" duration="202000" />
<workItem from="1667742775449" duration="23000" />
<workItem from="1667751363182" duration="73000" />
<workItem from="1667751705366" duration="13759000" />
<workItem from="1667811885207" duration="7287000" />
<workItem from="1667824597894" duration="1941000" />
<workItem from="1667839107061" duration="895000" />
<workItem from="1667840376602" duration="3374000" />
<workItem from="1667858084425" duration="124000" />
<workItem from="1667858262314" duration="589000" />
<workItem from="1667858861369" duration="746000" />
<workItem from="1667900810467" duration="5122000" />
<workItem from="1667909850990" duration="1601000" />
<workItem from="1667978023696" duration="4691000" />
<workItem from="1669198101589" duration="513000" />
<workItem from="1669283031999" duration="278000" />
<workItem from="1669296857490" duration="9973000" />
<workItem from="1669746866999" duration="8976000" />
<workItem from="1669795842995" duration="3581000" />
<workItem from="1669814532578" duration="3739000" />
<workItem from="1669892181459" duration="312000" />
<workItem from="1669892510192" duration="1371000" />
<workItem from="1670185537472" duration="3079000" />
<workItem from="1670397750739" duration="845000" />
<workItem from="1670398684471" duration="722000" />
<workItem from="1670931242909" duration="24186000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<ignored-roots>
<path value="$PROJECT_DIR$/svet" />
</ignored-roots>
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<breakpoint enabled="true" type="java-exception">
<properties class="java.lang.ClassCastException" package="java.lang" />
<option name="timeStamp" value="8" />
</breakpoint>
</breakpoints>
</breakpoint-manager>
<watches-manager>
<configuration name="Application">
<watch expression="((ClassCastException)((ClassCastException)((ClassCastException)((ClassCastException)((ClassCastException)((ClassCastException)((ClassCastException)((ClassCastException)((ClassCastException)ClassCastException1303_DebugLabel).cause).cause).cause).cause).cause).cause).cause).cause).cause" custom="java.lang.ClassCastException" />
</configuration>
</watches-manager>
</component>
</project>

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>

View File

@ -0,0 +1,10 @@
Kapor
Nemo
Eagle
Mucha
MarineMammals
MarineMammals
MarineMammals
MarineMammals
Muz
Zena

View File

@ -0,0 +1,207 @@
import com.company.Singletone;
import com.company.cars.Car;
import com.company.cars.UniverseCarFactory;
import com.company.cosmicbody.Earth;
import com.company.cosmicbody.Planet;
import com.company.cosmicbody.SolarSystem;
import com.company.cosmicbody.Star;
import com.company.creature.Creature;
import com.company.creature.MarineMammals;
import com.company.creature.Mucha;
import com.company.creature.clovecina.Clovek;
import com.company.creature.clovecina.Muz;
import com.company.creature.clovecina.Zena;
import com.company.creature.stavovce.stavovcediely.birds.Eagle;
import com.company.creature.stavovce.stavovcediely.fish.Kapor;
import com.company.creature.stavovce.stavovcediely.fish.Nemo;
import com.company.universe.Galaxy;
import com.company.universe.PlanetaryNebula;
import com.company.universe.Universe;
import tools.MessageReader;
import tools.MessageWriter;
import java.util.ArrayList;
import java.util.Date;
public class Main {
public static void main(String[] args) {
Universe i_xander_i = new Universe();
System.out.println("\n");
PlanetaryNebula Orion = new PlanetaryNebula("Orion",5, 18000,200,200,200);
PlanetaryNebula Buba = new PlanetaryNebula("Buba", 8, 2300, 12,59,94);
PlanetaryNebula Phonk = new PlanetaryNebula("Phonk", 20, 100000, 0,0,0);
System.out.println("\n");
Planet Mercury = new Planet("Mercury", 1333, 6083, 0);
Planet Venus = new Planet("Venus", 4867, 938, 12.1);
Planet Earth = new Planet("Earth", 100000, 108321);
Earth motherEarth = new Earth("Earth2", 100000, 108321);
Planet Mars = new Planet("Mars", 641, 16318, 9.81);
Planet Jupiter = new Planet("Jupiter", 3, 71313, 20.89);
Planet Saturn = new Planet("Saturn", 1000, 108408, 95.8);
Planet Uranus = new Planet("Uranus", 1000, 202156, 255.55);
Planet Neptune = new Planet("Neptune", 7050, 620654, 0);
System.out.println("\n");
Star sun = new Star("Sun", 1.392, 1.40927, 1499726.85);
sun.on();
System.out.println("\n");
SolarSystem solarSystem = new SolarSystem();
solarSystem.addBody(Mercury);
solarSystem.addBody(Venus);
solarSystem.addBody(Earth);
solarSystem.addBody(Mars);
solarSystem.addBody(Jupiter);
solarSystem.addBody(Saturn);
solarSystem.addBody(Uranus);
solarSystem.addBody(Neptune);
System.out.println("\n");
Galaxy milkyWay = new Galaxy("Milky Way");
milkyWay.addSustava(solarSystem);
Galaxy Hryshchenko = new Galaxy("Hryshchenko");
Hryshchenko.addSustava(solarSystem);
System.out.println("\n");
milkyWay.sendMessage(Hryshchenko, "Hi, I'm you friend");
Hryshchenko.sendMessage(milkyWay, "Hi.");
System.out.println("\n");
/* Creature Ara = new Bird("Blu", 60, 0.4, "Blu-ara");
Ara.move(10, 10, 20);
Creature Ara1 = new Bird("Jewel", 55, 0.4, "Blu-ara");
Ara1.move(20,60,90);
Creature Toucan = new Bird("Rafael", 65, 0.75, "Toco toucan");
Toucan.move(60,23,95);
Creature Cardinal = new Bird("Pedro", 20, 0.09, "Red-crested cardinal");
Cardinal.move(98,65,32);
Creature Canary = new Bird("Nico", 20.5, 0.05, "Domestic canary");
Canary.move(87,56,26);
Creature Cockatoo = new Bird("Nigel", 55, 0.97, "Sulphur-crested cockatoo");
Cockatoo.move(95,45,12);
Creature Toucan1 = new Bird("Eva", 53, 0.4, "Keel-billed toucan");
Toucan1.move(78,64,23);*/
/* System.out.println("\n");
Creature Clownfish = new Fish("Oscar" , 10, 0.02, "Bluestreak cleaner wrasse");
Clownfish.move(2000,9000,3000);
Creature Shark = new Fish("Lenny" , 12000, 561, "Tiger shark");
Shark.move(6000,6258,82214);
Creature Angelfish = new Fish("Angie" , 15, 0.06, "Angelfish");
Angelfish.move(8452,1235,7536);
Creature Porcupinefish = new Fish("Sykes" , 91, 0.1, "Porcupinefish");
Porcupinefish.move(5628,7874,5632);
Creature Lionfish = new Fish("Lola" , 45.7, 0.26, "Red lionfish");
Lionfish.move(6203,8954,8443);*/
Kapor vianocnykapor = new Kapor(50);
Date dNow = new Date();
vianocnykapor.born(dNow);
motherEarth.addCreature(vianocnykapor);
vianocnykapor.move(10,10,0);
vianocnykapor.die(dNow);
motherEarth.addCreature(new Nemo());
motherEarth.addCreature(new Eagle());
Mucha vinnamuska = new Mucha();
motherEarth.addCreature(vinnamuska);
System.out.println("\n");
Creature Bear = new MarineMammals();
Bear.move(56,9,0);
Creature Otter = new MarineMammals("Nora", 115.1, 3.6, "marine otter", true);
Otter.move(20,8,2);
Creature Walrus = new MarineMammals("Pupik", 4.4, 1700, "Walrus", true);
Walrus.move(35,58,8);
Creature Seals = new MarineMammals("Duska", 117.2, 45, "True seals", true);
Seals.move(9526,856,258);
motherEarth.addCreature(Otter);
motherEarth.addCreature(Bear);
motherEarth.addCreature(Walrus);
motherEarth.addCreature(Seals);
System.out.println("\n");
/*for(int i = 0; i < 2000; i++){
motherEarth.addCreature(new Bird());
motherEarth.addCreature(new Fish());
}
Creature[] array = motherEarth.getArrayCreature();
for(int i = 0; i < 2000; i++){
array[i].move(10,10,0);
}*/
Muz prvyMuz = new Muz(null, null,34, "Adam", "Prvy");
Zena prvaZena = new Zena(null, null,34, "Eva", "Prva");
System.out.println(prvyMuz);
System.out.println(prvaZena);
motherEarth.addCreature(prvyMuz);
motherEarth.addCreature(prvaZena);
Clovek prvedieta = prvaZena.splodit(prvyMuz);
prvedieta.born(dNow);
prvedieta.setName("Kain");
Clovek druhedieta = prvaZena.splodit(prvyMuz);
druhedieta.born(dNow);
druhedieta.setName("Abel");
System.out.println(prvedieta);
System.out.println(druhedieta);
MessageReader AdamovReader = new MessageReader();
AdamovReader.obtainFilename(args);
AdamovReader.openAndRead();
AdamovReader.processMessage();
MessageWriter AdamovWriter = new MessageWriter(motherEarth.getArrayCreature());
AdamovWriter.WriteMessage();
Singletone singletone = Singletone.getInstance();
singletone.takeUniverse(i_xander_i);
System.out.println("\n");
UniverseCarFactory myFactory = new UniverseCarFactory("BMW");
Car mvp = myFactory.produce("MVP");
Car suv = myFactory.produce("SUV");
Car sport = myFactory.produce("Sportcar");
Car little = myFactory.produce("Littlecar");
System.out.println(mvp);
System.out.println(suv);
System.out.println(sport);
System.out.println(little);
ArrayList<Car> warehouse = new ArrayList<Car>();
UniverseCarFactory Mercedes = new UniverseCarFactory("Mercedes");
UniverseCarFactory BMW = new UniverseCarFactory("BMW");
for(int i =0; i<1000; i++ ){
Car mercedes = Mercedes.produce("Littlecar");
Car bmw = BMW.produce("Sportcar");
warehouse.add(mercedes);
warehouse.add(bmw);
}
i_xander_i.stopUniverse();
}
}

View File

@ -0,0 +1,25 @@
package com.company;
import com.company.universe.Universe;
public class Singletone {
private static Singletone instance = null;
private Universe i_xander_i;
private Singletone() {
}
public static Singletone getInstance() {
if(instance == null){
instance = new Singletone();
}
return instance;
}
public void takeUniverse(Universe i_xander_i){
this.i_xander_i = i_xander_i;
System.out.println("Vesmir teraz uz ma stvoritela");
}
}

View File

@ -0,0 +1,28 @@
package com.company.cars;
public abstract class Car {
protected String Model;
protected String Logo;
public String getModel() {
return Model;
}
public void setModel(String model) {
Model = model;
}
public String getLogo() {
return Logo;
}
public void setLogo(String logo) {
Logo = logo;
}
@Override
public String toString() {
return "Logo: " + Logo + "Model: " + Model;
}
}

View File

@ -0,0 +1,5 @@
package com.company.cars;
public class Littlecar extends Car{
}

View File

@ -0,0 +1,4 @@
package com.company.cars;
public class MVP extends Car{
}

View File

@ -0,0 +1,4 @@
package com.company.cars;
public class SUV extends Car{
}

View File

@ -0,0 +1,4 @@
package com.company.cars;
public class Sportcar extends Car{
}

View File

@ -0,0 +1,37 @@
package com.company.cars;
public class UniverseCarFactory {
protected String nameFactory;
public UniverseCarFactory(String NameFactory) {
nameFactory = NameFactory;
}
public Car produce(String type){
if(type == "SUV"){
Car suv = new SUV();
suv.setLogo(nameFactory);
suv.setModel("Suviaq");
return suv;
}
else if (type == "MVP") {
Car mvp = new MVP();
mvp.setLogo(nameFactory);
mvp.setModel("Familiaq");
return mvp;
}
else if(type == "Sportcar"){
Car sport =new Sportcar();
sport.setLogo(nameFactory);
sport.setModel("Sport");
return sport;
}
else if(type == "Littlecar"){
Car little =new Littlecar();
little.setLogo(nameFactory);
little.setModel("Little");
return little;
}
return null;
}
}

View File

@ -0,0 +1,13 @@
package com.company.cosmicbody;
public class CosmicBody {
private String body;
public String getBody() {
return body;
}
protected void setBody(String body) {
this.body = body;
}
}

View File

@ -0,0 +1,35 @@
package com.company.cosmicbody;
import com.company.creature.Creature;
import java.util.ArrayList;
public class Earth extends Planet{
private ArrayList<Creature> arrayCreature = new ArrayList<Creature>();
private int counterCreature;
public Earth(String name, double weight, double diameter) {
super(name, weight, diameter);
//arrayCreature = new Creature[9999];
//counterCreature = 0;
}
public void addCreature(Creature newCreature){
arrayCreature.add(newCreature);
//arrayCreature[counterCreature] = newCreature;
//counterCreature++;
}
public Earth() {
}
public ArrayList<Creature> getArrayCreature() {
return arrayCreature;
}
/* public Creature[] getArrayCreature() {
return arrayCreature;
}*/
}

View File

@ -0,0 +1,106 @@
package com.company.cosmicbody;
public class Planet extends CosmicBody {
private String name;
private double weight;
private double diameter;
private double gravitation;
private Boolean weightSet = false;
public void setPlanetaryWeight(double weight){
if(!weightSet){
setWeight(weight);
weightSet = true;
}
}
public double getWeight() {
return weight;
}
public void setWeight(double weight) {
if(this.weight>weight){
if(Math.abs(this.weight-weight) <= 1000){
System.out.println("I'm losing weight.");
}
else {
System.out.println("I'm losing a lot of weight.");
}
if(Math.abs(this.weight-weight) > 1000){
decreaseGravity(0.1);
}
}
else{
if(Math.abs(this.weight-weight) <= 1000){
System.out.println("Damn, I woke up.");
}
else {
System.out.println("Damn, I put on too much weight.");
}
if(Math.abs(this.weight-weight) > 1000){
increaseGravity(0.1);
}
}
this.weight = weight;
}
public double getDiameter() {
return diameter;
}
public void setDiameter(double diameter) {
this.diameter = diameter;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getGravitation() {
return gravitation;
}
public void setGravitation(double gravitation) {
this.gravitation = gravitation;
}
public Planet(String name, double weight, double diameter) {
// setWeight(weight);
// setDiameter(diameter);
// setName(name);
this.name = name;
this.weight = weight;
this.diameter = diameter;
this.gravitation = 9.81;
System.out.println("Planet is: " + name + " has been created. Parameters: " + weight + " " + diameter + ". Gravitation: " + gravitation);
}
private void increaseGravity(double add){
gravitation = gravitation + add;
}
private void decreaseGravity(double dec){
gravitation = gravitation - dec;
}
public Planet(String name, double weight, double diameter, double gravitation) {
this.name = name;
this.weight = weight;
this.diameter = diameter;
this.gravitation = gravitation;
System.out.println("Planet is: " + name + " has been created. Parameters: " + weight + " " + diameter + ". Gravitation: " + gravitation);
}
public Planet() {
this.name = "Earth";
this.weight = 5972200;
this.diameter = 12756;
System.out.println("Planet is: " + name + " has been created. Parameters: " + weight + " " + diameter + ". Gravitation: " + gravitation);
}
}

View File

@ -0,0 +1,40 @@
package com.company.cosmicbody;
public class SolarSystem {
// private Star Sun = new Star();
// private Planet Earth;
// private Planet Mars;
// private Planet Jupiter;
// private Planet Saturn;
private CosmicBody[] orbitalBody = new CosmicBody[500000000];
private int objectCounter;
public SolarSystem() {
//star = new Star();
setObjectCounter(0);
orbitalBody[objectCounter] = new Planet("Mars2", 432432, 432432);
objectCounter++;
orbitalBody[objectCounter] = new Planet("Venusa2", 55, 32342);
objectCounter++;
orbitalBody[objectCounter] = new Star("Polar",0,0,0);
objectCounter++;
}
public void addBody(CosmicBody newBody){
orbitalBody[objectCounter] = newBody;
objectCounter++;
}
public int getObjectCounter() {
return objectCounter;
}
public void setObjectCounter(int objectCounter) {
this.objectCounter = objectCounter;
}
}

View File

@ -0,0 +1,68 @@
package com.company.cosmicbody;
public class Star extends CosmicBody {
private String name;
private double weight;
private double radius;
private double temperature;
private Boolean light = false;
public Star(String name, double weight, double radius, double temperature) {
this.name = name;
this.weight = weight;
this.radius = radius;
this.temperature = temperature;
System.out.println("Star is: " + name + " has been created. Parameters: " + weight + ", " + radius + ", " + temperature);
}
public Star(){
this.name = "naname";
this.weight = 1000^35;
this.temperature = 500000;
System.out.println("Star is: " + name + " has been created");
}
public void on(){
this.light = true;
this.temperature = temperature + 10000;
System.out.println("Status: on" + ". Temperature = " + temperature);
}
public void off(){
this.light = false;
this.temperature = temperature - 10000;
System.out.println("Status: off" + ". Temperature = " + temperature);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getWeight() {
return weight;
}
public void setWeight(double weight) {
this.weight = weight;
}
public double getRadius() {
return radius;
}
public void setRadius(double radius) {
this.radius = radius;
}
public double getTemperature() {
return temperature;
}
public void setTemperature(double temperature) {
this.temperature = temperature;
}
}

View File

@ -0,0 +1,21 @@
package com.company.cosmicbody;
public class Сomet extends CosmicBody {
private int object_counter;
private CosmicBody[] orbitalBody = new CosmicBody[500000000];
public Сomet() {
setObject_counter(0);
orbitalBody[object_counter] = new Сomet();
object_counter++;
}
public int getObject_counter() {
return object_counter;
}
public void setObject_counter(int object_counter) {
this.object_counter = object_counter;
}
}

View File

@ -0,0 +1,5 @@
package com.company.creature;
public abstract class Bezstavovce extends Creature {
}

View File

@ -0,0 +1,7 @@
package com.company.creature;
import java.util.Date;
public interface Bornable {
public void born(Date DayOfBirth);
}

View File

@ -0,0 +1,13 @@
package com.company.creature;
import java.util.Date;
public abstract class Creature implements Bornable, Dieable{
protected Date DayOfBirth;
protected Date DayOfDie;
public abstract void move (int directionX, int directionY, int directionZ);
public Date getDayOfBirth() {
return DayOfBirth;
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature;
import java.util.Date;
public interface Dieable {
public void die(Date DayOfDie);
}

View File

@ -0,0 +1,51 @@
package com.company.creature;
import java.util.Date;
public class MarineMammals extends Creature {
private String name;
private double height;
private double weight;
private String type;
private boolean predator = false;
public MarineMammals(String name, double height, double weight, String type, boolean predator) {
this.name = name;
this.height = height;
this.weight = weight;
this.type = type;
this.predator = predator;
if (predator = true) {
System.out.println("Marine Mammals is: " + name + " has been created. Parameters: " + height + "cm, " + weight + "kg. Type - " + type + ". Predator: Yes" );
}else{
System.out.println("Marine Mammals is: " + name + " has been created. Parameters: " + height + "cm, " + weight + "kg. Type - " + type + ". Predator: No" );
}
}
public MarineMammals() {
this.name = "Umka";
this.height = 222;
this.weight = 5555;
this.type = "White Bear";
this.predator = false;
System.out.println("Marine Mammals is: " + name + " has been created. Parameters: " + height + "cm, " + weight + "kg. Type - " + type + ". Predator: " + this.predator);
}
@Override
public void move(int directionX, int directionY, int directionZ) {
System.out.println("I'm live in sea and land");
}
@Override
public void born(Date DayOfBirth) {
}
@Override
public void die(Date DayOfDie) {
}
}

View File

@ -0,0 +1,23 @@
package com.company.creature;
import com.company.creature.Bezstavovce;
import java.util.Date;
public class Mucha extends Bezstavovce {
@Override
public void born(Date DayOfBirth) {
}
@Override
public void move(int directionX, int directionY, int directionZ) {
}
@Override
public void die(Date DayOfDie) {
}
}

View File

@ -0,0 +1,25 @@
package com.company.creature.cicavce;
import com.company.creature.stavovce.stavovcediely.Stavovec;
import com.company.creature.stavovce.stavovcediely.sustavy.*;
public abstract class Cicavec extends Stavovec implements cicable{
private float temperature;
@Override
public void create_sustavy() {
sustavy.add(new ObehovaSustavaStavovec(TypSustavy.OBEHOVA));
sustavy.add(new OpovovaSustavaStavovec(TypSustavy.OPOROVA));
sustavy.add(new VylucovaciaSustavaStavovec(TypSustavy.VYLUCOVACIA));
sustavy.add(new PohybovaSustavaStavovec(TypSustavy.POHYBOVA));
sustavy.add(new DychaciaSustavaStavovec(TypSustavy.DUCHACIA));
sustavy.add(new TraviacaSustavaStavovec(TypSustavy.TRAVIACA));
sustavy.add(new RozmnozovaciaSustavaStavovec(TypSustavy.ROZMNOZOVACIA));
sustavy.add(new NervovaSustavaStavovec_Default(TypSustavy.NERVOVA));
}
public Cicavec(int pocet_stavcov) {
super(pocet_stavcov);
this.temperature = 36;
}
}

View File

@ -0,0 +1,4 @@
package com.company.creature.cicavce;
public class Materske_mlieko {
}

View File

@ -0,0 +1,6 @@
package com.company.creature.cicavce;
public interface cicable {
public void cicat (Cicavec mama);
public void cicat(Materske_mlieko mliecko);
}

View File

@ -0,0 +1,68 @@
package com.company.creature.clovecina;
import com.company.creature.cicavce.Cicavec;
import com.company.creature.cicavce.Materske_mlieko;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public abstract class Clovek extends Cicavec {
protected Clovek otec;
protected Clovek mama;
protected List<Clovek> deti;
protected String name;
protected String surname;
public Clovek(Clovek otec, Clovek mama, int pocet_stavcov) {
super(pocet_stavcov);
this.otec = otec;
this.mama = mama;
deti = new ArrayList();
}
public void setName(String name) {
this.name = name;
}
public void setSurname(String surname){
this.surname = surname;
}
@Override
public void cicat(Cicavec mama) {
}
@Override
public void cicat(Materske_mlieko mliecko) {
}
@Override
public void born(Date DayOfBirth) {
super.born(DayOfBirth);
}
@Override
public void move(int directionX, int directionY, int directionZ) {
super.move(directionX, directionY, directionZ);
}
@Override
public void die(Date DayOfDie) {
super.die(DayOfDie);
}
@Override
public String toString() {
return "Clovek{" +
"name='" + name + '\'' +
", surname='" + surname + '\'' +
'}';
}
}

View File

@ -0,0 +1,61 @@
package com.company.creature.clovecina;
import com.company.creature.cicavce.Cicavec;
import com.company.creature.cicavce.Materske_mlieko;
import com.company.creature.stavovce.stavovcediely.sustavy.*;
import com.company.creature.stavovce.stavovcediely.sustavy.rozmnozovaciaclovek.RozmonozovaciaSustavaMuz;
import java.util.Date;
public class Muz extends Clovek{
public Muz(Clovek otec, Clovek mama, int pocet_stavcov) {
super(otec, mama, pocet_stavcov);
}
public Muz(Clovek otec, Clovek mama, int pocet_stavcov, String name, String surname) {
super(otec, mama, pocet_stavcov);
super.name = name;
super.surname = surname;
create_sustavy();
}
@Override
public void cicat(Cicavec mama) {
}
@Override
public void cicat(Materske_mlieko mliecko) {
}
@Override
public void born(Date DayOfBirth) {
super.born(DayOfBirth);
}
@Override
public void move(int directionX, int directionY, int directionZ) {
super.move(directionX, directionY, directionZ);
}
@Override
public void die(Date DayOfDie) {
super.die(DayOfDie);
}
@Override
public void create_sustavy() {
sustavy.add(new ObehovaSustavaStavovec(TypSustavy.OBEHOVA));
sustavy.add(new OpovovaSustavaStavovec(TypSustavy.OPOROVA));
sustavy.add(new VylucovaciaSustavaStavovec(TypSustavy.VYLUCOVACIA));
sustavy.add(new PohybovaSustavaStavovec(TypSustavy.POHYBOVA));
sustavy.add(new DychaciaSustavaStavovec(TypSustavy.DUCHACIA));
sustavy.add(new TraviacaSustavaStavovec(TypSustavy.TRAVIACA));
sustavy.add(new RozmonozovaciaSustavaMuz(TypSustavy.ROZMNOZOVACIA));
sustavy.add(new NervovaSustavaStavovec_Default(TypSustavy.NERVOVA));
System.out.println("Som muz a mam obicajnu nervovu sustavu a rozmozovaciu sustavu");
}
}

View File

@ -0,0 +1,91 @@
package com.company.creature.clovecina;
import com.company.creature.cicavce.Cicavec;
import com.company.creature.cicavce.Materske_mlieko;
import com.company.creature.stavovce.stavovcediely.sustavy.*;
import com.company.creature.stavovce.stavovcediely.sustavy.rozmnozovaciaclovek.RozmonozovaciaSustavaZena;
import java.util.Date;
import java.util.Random;
public class Zena extends Clovek{
public Zena(Clovek otec, Clovek mama, int pocet_stavcov) {
super(otec, mama, pocet_stavcov);
}
public Zena(Clovek otec, Clovek mama, int pocet_stavcov, String name, String surname) {
super(otec, mama, pocet_stavcov);
super.name = name;
super.surname = surname;
create_sustavy();
}
@Override
public void cicat(Cicavec mama) {
}
@Override
public void cicat(Materske_mlieko mliecko) {
}
@Override
public void born(Date DayOfBirth) {
super.born(DayOfBirth);
}
@Override
public void move(int directionX, int directionY, int directionZ) {
super.move(directionX, directionY, directionZ);
}
@Override
public void die(Date DayOfDie) {
super.die(DayOfDie);
}
@Override
public void create_sustavy() {
sustavy.add(new ObehovaSustavaStavovec(TypSustavy.OBEHOVA));
sustavy.add(new OpovovaSustavaStavovec(TypSustavy.OPOROVA));
sustavy.add(new VylucovaciaSustavaStavovec(TypSustavy.VYLUCOVACIA));
sustavy.add(new PohybovaSustavaStavovec(TypSustavy.POHYBOVA));
sustavy.add(new DychaciaSustavaStavovec(TypSustavy.DUCHACIA));
sustavy.add(new TraviacaSustavaStavovec(TypSustavy.TRAVIACA));
sustavy.add(new RozmonozovaciaSustavaZena(TypSustavy.ROZMNOZOVACIA));
sustavy.add(new NervovaSustavaStavovec_Default(TypSustavy.NERVOVA));
System.out.println("Som zena a mam zlozitu nervovu sustavu a speci rozmozovaciu sustavu");
}
public Clovek splodit(Muz stymtomuzom){
Random rand = new Random();
Boolean man = rand.nextBoolean();
Clovek clovecikSpodneny;
if(man){
clovecikSpodneny = new Muz(stymtomuzom, this,34);
super.deti.add(clovecikSpodneny);
stymtomuzom.deti.add(clovecikSpodneny);
}
else{
clovecikSpodneny = new Zena(stymtomuzom, this,34);
super.deti.add(clovecikSpodneny);
stymtomuzom.deti.add(clovecikSpodneny);
}
clovecikSpodneny.surname = super.surname + "-" + stymtomuzom.surname;
babyIsideCare(clovecikSpodneny);
return clovecikSpodneny;
}
public void babyIsideCare(Clovek plod){
RozmonozovaciaSustavaZena myRS = (RozmonozovaciaSustavaZena) sustavy.get(6);
myRS.takeAndCareBaby(plod);
}
}

View File

@ -0,0 +1,13 @@
package com.company.creature.stavovce.stavovcediely;
public class Chrbtica {
private Stavec[] stavce;
public Chrbtica(int pocet_stavcov) {
this.stavce = new Stavec[pocet_stavcov];
}
public Chrbtica() {
this.stavce = new Stavec[11];
}
}

View File

@ -0,0 +1,4 @@
package com.company.creature.stavovce.stavovcediely;
public class Stavec {
}

View File

@ -0,0 +1,48 @@
package com.company.creature.stavovce.stavovcediely;
import com.company.creature.Creature;
import com.company.creature.stavovce.stavovcediely.sustavy.*;
import java.util.ArrayList;
import java.util.Date;
public class Stavovec extends Creature {
protected Chrbtica chrbtica;
protected ArrayList<Sustava> sustavy = new ArrayList<Sustava>();
public Stavovec(int pocet_stavcov){
chrbtica = new Chrbtica(pocet_stavcov);
//create_sustavy();
}
protected void create_sustavy(){
sustavy.add(new ObehovaSustavaStavovec(TypSustavy.OBEHOVA));
sustavy.add(new OpovovaSustavaStavovec(TypSustavy.OPOROVA));
sustavy.add(new VylucovaciaSustavaStavovec(TypSustavy.VYLUCOVACIA));
sustavy.add(new PohybovaSustavaStavovec(TypSustavy.POHYBOVA));
sustavy.add(new DychaciaSustavaStavovec(TypSustavy.DUCHACIA));
sustavy.add(new TraviacaSustavaStavovec(TypSustavy.TRAVIACA));
sustavy.add(new RozmnozovaciaSustavaStavovec(TypSustavy.ROZMNOZOVACIA));
sustavy.add(new NervovaSustavaStavovec_Default(TypSustavy.NERVOVA));
}
public ArrayList<Sustava> getSustavy() {
return sustavy;
}
@Override
public void born(Date DayOfBirth) {
}
@Override
public void move(int directionX, int directionY, int directionZ) {
}
@Override
public void die(Date DayOfDie) {
}
}

View File

@ -0,0 +1,52 @@
package com.company.creature.stavovce.stavovcediely.birds;
import com.company.creature.stavovce.stavovcediely.Stavovec;
import java.util.Date;
public abstract class Bird extends Stavovec {
private String name;
private double height;
private double weight;
private String type;
public Bird(int pocet_stavcov){
super(pocet_stavcov);
}
public Bird(String name, double height, double weight, String type, int pocet_stavcov) {
super(pocet_stavcov);
this.name = name;
this.height = height;
this.weight = weight;
this.type = type;
System.out.println("Bird is: " + name + " has been created. Parameters: " + height + "cm, " + weight + "kg. Type - " + type);
}
public Bird() {
super(11);
this.name = "Loloska";
this.height = 100;
this.weight = 10;
this.type = "parrot";
System.out.println("Bird is: " + name + " has been created. Parameters: " + height + "cm, " + weight + "kg. Type - " + type);
}
@Override
public void move(int directionX, int directionY, int directionZ) {
System.out.println("I fly. Because I'm bird");
}
@Override
public void born(Date DayOfBirth) {
super.DayOfBirth = DayOfBirth;
System.out.println("I was born " + super.DayOfBirth.toString());
}
@Override
public void die(Date DayOfDie) {
super.DayOfDie = DayOfDie;
System.out.println("I was die " + super.DayOfDie.toString());
}
}

View File

@ -0,0 +1,14 @@
package com.company.creature.stavovce.stavovcediely.birds;
public class Eagle extends Bird{
public Eagle(int pocet_stavcov) {
super(pocet_stavcov);
}
public Eagle(String name, double height, double weight, String type, int pocet_stavcov) {
super(name, height, weight, type, pocet_stavcov);
}
public Eagle() {
}
}

View File

@ -0,0 +1,51 @@
package com.company.creature.stavovce.stavovcediely.fish;
import com.company.creature.stavovce.stavovcediely.Stavovec;
import java.util.Date;
public abstract class Fish extends Stavovec {
private String name;
private double height;
private double weight;
private String type;
public Fish(int pocet_stavcov){
super(pocet_stavcov);
}
public Fish(String name, double height, double weight, String type, int pocet_stavcov) {
super(pocet_stavcov);
this.name = name;
this.height = height;
this.weight = weight;
this.type = type;
System.out.println("Fish is: " + name + " has been created. Parameters: " + height + "cm, " + weight + "kg. Type - " + type);
}
public Fish() {
super(11);
this.name = "Svoupy";
this.height = 15;
this.weight = 0.2;
this.type = "Golden fish";
System.out.println("Bird is: " + name + " has been created. Parameters: " + height + "cm, " + weight + "kg. Type - " + type);
}
@Override
public void move(int directionX, int directionY, int directionZ) {
System.out.println("I swim. Because I'm a fish");
}
@Override
public void born(Date DayOfBirth) {
super.DayOfBirth = DayOfBirth;
System.out.println("I was born " + super.DayOfBirth.toString());
}
@Override
public void die(Date DayOfDie) {
super.DayOfDie = DayOfDie;
System.out.println("I was die " + super.DayOfDie.toString());
}
}

View File

@ -0,0 +1,15 @@
package com.company.creature.stavovce.stavovcediely.fish;
public class Kapor extends Fish{
public Kapor(int pocet_stavcov) {
super(pocet_stavcov);
}
public Kapor(String name, double height, double weight, String type, int pocet_stavcov) {
super(name, height, weight, type, pocet_stavcov);
}
public Kapor() {
}
}

View File

@ -0,0 +1,14 @@
package com.company.creature.stavovce.stavovcediely.fish;
public class Nemo extends Fish{
public Nemo(int pocet_stavcov) {
super(pocet_stavcov);
}
public Nemo(String name, double height, double weight, String type, int pocet_stavcov) {
super(name, height, weight, type, pocet_stavcov);
}
public Nemo() {
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class DychaciaSustavaStavovec extends Sustava{
public DychaciaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class NervovaSustavaStavovec_Default extends Sustava{
public NervovaSustavaStavovec_Default(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class ObehovaSustavaStavovec extends Sustava{
public ObehovaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class OpovovaSustavaStavovec extends Sustava{
public OpovovaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class PohybovaSustavaStavovec extends Sustava{
public PohybovaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class RozmnozovaciaSustavaStavovec extends Sustava {
public RozmnozovaciaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,13 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public abstract class Sustava {
TypSustavy typSustavy;
public Sustava(TypSustavy typSustavy) {
this.typSustavy = typSustavy;
}
public void setTypSustavy(TypSustavy typSustavy) {
this.typSustavy = typSustavy;
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class TraviacaSustavaStavovec extends Sustava{
public TraviacaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,12 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public enum TypSustavy {
OPOROVA,
OBEHOVA,
VYLUCOVACIA,
POHYBOVA,
DUCHACIA,
TRAVIACA,
ROZMNOZOVACIA,
NERVOVA
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class VylucovaciaSustavaStavovec extends Sustava{
public VylucovaciaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,11 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
public class CNS {
private Mozog mozog;
private Miecha miecha;
public CNS() {
mozog = new Mozog();
miecha = new Miecha();
}
}

View File

@ -0,0 +1,9 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
public class Miecha {
private Neuron[] NeuronovaSiet;
public Miecha() {
this.NeuronovaSiet = new Neuron[500];
}
}

View File

@ -0,0 +1,9 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
public class Mozog {
private Neuron[] NeuronovaSiet;
public Mozog(){
this.NeuronovaSiet = new Neuron[500];
}
}

View File

@ -0,0 +1,4 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
public class Nerv {
}

View File

@ -0,0 +1,16 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
import com.company.creature.stavovce.stavovcediely.sustavy.NervovaSustavaStavovec_Default;
import com.company.creature.stavovce.stavovcediely.sustavy.TypSustavy;
public class NervovaSustavaCicavec extends NervovaSustavaStavovec_Default {
private CNS cns;
private PNS pns;
public NervovaSustavaCicavec(TypSustavy typSustavy) {
super(typSustavy);
cns = new CNS();
pns = new PNS();
}
}

View File

@ -0,0 +1,4 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
public class Neuron {
}

View File

@ -0,0 +1,9 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
public class PNS {
private Nerv[] nervy;
public PNS(){
nervy = new Nerv[100];
}
}

View File

@ -0,0 +1,10 @@
package com.company.creature.stavovce.stavovcediely.sustavy.rozmnozovaciaclovek;
import com.company.creature.stavovce.stavovcediely.sustavy.RozmnozovaciaSustavaStavovec;
import com.company.creature.stavovce.stavovcediely.sustavy.TypSustavy;
public class RozmonozovaciaSustavaMuz extends RozmnozovaciaSustavaStavovec {
public RozmonozovaciaSustavaMuz(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,22 @@
package com.company.creature.stavovce.stavovcediely.sustavy.rozmnozovaciaclovek;
import com.company.creature.clovecina.Clovek;
import com.company.creature.stavovce.stavovcediely.sustavy.RozmnozovaciaSustavaStavovec;
import com.company.creature.stavovce.stavovcediely.sustavy.TypSustavy;
public class RozmonozovaciaSustavaZena extends RozmnozovaciaSustavaStavovec {
public int BabyDevelopmentProgress = 0;
public RozmonozovaciaSustavaZena(TypSustavy typSustavy) {
super(typSustavy);
}
public int takeAndCareBaby(Clovek plod){
while (BabyDevelopmentProgress != 100){
BabyDevelopmentProgress++;
}
plod.create_sustavy();
return BabyDevelopmentProgress;
}
}

View File

@ -0,0 +1,46 @@
package com.company.universe;
import com.company.cosmicbody.SolarSystem;
public class Galaxy {
private String name;
private SolarSystem[] systems = new SolarSystem[5000];
private int objectCounter;
private String message;
public void sendMessage(Galaxy galaxy, String message){
galaxy.setMessage(message);
System.out.println("Meassage: '" + message + "' from " + this.name + " has been send to: " + galaxy.name);
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Galaxy(String name) {
this.name = name;
this.objectCounter = 0;
System.out.println("Galaxy is: " + name + " has been created.");
}
public void addSustava(SolarSystem system){
this.systems[objectCounter] = system;
this.setObjectCounter(this.objectCounter++);
}
public int getObjectCounter() {
return objectCounter;
}
private void setObjectCounter(int objectCounter) {
this.objectCounter = objectCounter;
}
}

View File

@ -0,0 +1,28 @@
package com.company.universe;
public class PlanetaryNebula {
private String name;
private long size;
private long lifeDuration;
private long x, y , z;
public PlanetaryNebula(){
name = "myName";
size = 0;
lifeDuration = 0;
x = 0; y = 0; z=0;
System.out.println("Created Planetary Nebula: " + name + "Parameters: " + lifeDuration + ", " + size + ". Coordination: " + x + ", " + y + ", " + z);
}
public PlanetaryNebula(String name,long lifeDuration, long size, long x, long y, long z) {
this.name = name;
this.lifeDuration = lifeDuration;
this.size = size;
this.x = x;
this.y = y;
this.z = z;
System.out.println("Created Planetary Nebula: " + name + "Parameters: " + lifeDuration + ", " + size + ". Coordination: " + x + ", " + y + ", " + z);
}
}

View File

@ -0,0 +1,40 @@
package com.company.universe;
public class Universe {
private boolean state;
private long size;
public Universe() {
state = false;
size = 0;
startUniverse();
}
public void startUniverse(){
state = true;
System.out.println("World is ready");
increaseSize();
decreaseSize(10000);
}
public void stopUniverse(){
state = false;
System.out.println("World is stop");
}
private void increaseSize(){
while (size<999000){
size++;
//System.out.println("Wait. Universe " + size + "km3");
}
System.out.println("Universe is " + size + "km3");
}
private void decreaseSize(long desiredSize){
while (size > desiredSize){
size--;
//System.out.println ("Wait. Compressed world " + size + "km3");
}
System.out.println ("Compress world is " + size + "km3");
}
}

View File

@ -0,0 +1,61 @@
package tools;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.*;
public class MessageReader {
private String filename;
private File myFile;
private Scanner fileScanner;
List<String> lineContainer = new ArrayList<String>();
private Map<String, Integer> uniqueWords = new HashMap<>();
public MessageReader(){
}
public void obtainFilename(String arguments[]){
// if(arguments.length >= 1){
// filename = arguments[0];
// }
// else{
// Scanner inputReader = new Scanner(System.in);
// System.out.println("Zadaj nazov suboru: ");
//
// filename = inputReader.nextLine();
// }
filename = "MyZoznamStvoritela.txt";
System.out.println("Subor na spracovanie " + filename);
}
public void openAndRead(){
try {
myFile = new File(filename);
fileScanner = new Scanner(myFile);
while(fileScanner.hasNextLine()){
lineContainer.add(fileScanner.nextLine());
}
}
catch (FileNotFoundException e){
System.out.println("Nenasiel som subor.");
e.printStackTrace();
}
}
public void processMessage(){
for(int i = 0; i < lineContainer.size(); i++){
String temp = lineContainer.get(i);
Integer count = uniqueWords.getOrDefault(temp, 0);
count += 1;
uniqueWords.put(temp, count);
}
System.out.println("Zoznam tvorov");
uniqueWords.forEach((key, value) -> System.out.println(key + ":" + value));
}
}

View File

@ -0,0 +1,35 @@
package tools;
import com.company.creature.Creature;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
public class MessageWriter {
private ArrayList<Creature> arrayCreature;
private int countCreature;
public MessageWriter(ArrayList<Creature> arrayCreature){
this.arrayCreature = arrayCreature;
this.countCreature = arrayCreature.size();
}
public void WriteMessage(){
try {
FileWriter myWriter = new FileWriter("MyZoznamStvoritela.txt");
for(int i = 0; i < countCreature; i++){
String creature = arrayCreature.get(i).getClass().getSimpleName();
myWriter.write(creature + '\n');
}
myWriter.close();
System.out.println("Tvory ktore boli zapisane do suboru.");
}
catch (IOException e) {
System.out.println("Dakde stala chyba");
e.printStackTrace();
}
}
}

View File

@ -0,0 +1,70 @@
lev
lev
lev
lev
lev
lev
slon
slon
slon
slon
slon
slon
slon
slon
had
had
had
had
velhad
velhad
velhad
velhad
velhad
velhad
velhad
velhad
velhad
velhad
velhad
velhad
opica
opica
opica
opica
bocian
opica
bocian
bocian
opica
hroch
hroch
opica
simpanz
simpanz
delfín
delfín
delfín
kapor
delfín
sleď
sleď
sleď
delfín
losos
losos
losos
losos
dinosaurusrex
dinosaurusrex
dinosaurusrex
lienka
lienka
lienka
lienka
zajac
líška
zajac
líška
zajac
líška