diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 1a29e22..8fdb436 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -7,7 +7,8 @@ - + + diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 611e7c8..a774292 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -9,6 +9,9 @@ diff --git a/Lab5Client/build.gradle.kts b/Lab5Client/build.gradle.kts new file mode 100644 index 0000000..8294567 --- /dev/null +++ b/Lab5Client/build.gradle.kts @@ -0,0 +1,42 @@ +plugins { + java + id("com.github.johnrengelman.shadow") version("7.1.2") +} + +group = "ru.erius.lab5" +version = "2.0" +val mainClass = "client.Lab5Client" + +repositories { + mavenCentral() +} + +dependencies { + testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") + implementation(project(":Lab5Core")) + compileOnly("org.projectlombok:lombok:1.18.22") + annotationProcessor("org.projectlombok:lombok:1.18.22") +} + +tasks.getByName("test") { + useJUnitPlatform() +} + +tasks.compileJava { + options.encoding = "UTF-8" +} + +tasks.javadoc { + options.encoding = "UTF-8" +} + +tasks.shadowJar { + archiveClassifier.set("") + manifest { + attributes( + "Manifest-Version" to "1.0", + "Main-Class" to mainClass + ) + } +} diff --git a/Lab5Client/build/classes/java/main/client/Lab5Client.class b/Lab5Client/build/classes/java/main/client/Lab5Client.class new file mode 100644 index 0000000..5b03d81 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/Lab5Client.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/Command.class b/Lab5Client/build/classes/java/main/client/commandline/Command.class new file mode 100644 index 0000000..13b3082 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/Command.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler$ExecuteScriptCommand.class b/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler$ExecuteScriptCommand.class new file mode 100644 index 0000000..9dac597 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler$ExecuteScriptCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler$ExitCommand.class b/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler$ExitCommand.class new file mode 100644 index 0000000..d76c17a Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler$ExitCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler$HistoryCommand.class b/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler$HistoryCommand.class new file mode 100644 index 0000000..9d6ab10 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler$HistoryCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler$ModeCommand.class b/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler$ModeCommand.class new file mode 100644 index 0000000..e20d78b Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler$ModeCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler.class b/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler.class new file mode 100644 index 0000000..5b8312c Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/CommandLineHandler.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry$1.class b/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry$1.class new file mode 100644 index 0000000..f1a02c7 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry$1.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry$CommandAlreadyExistsException.class b/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry$CommandAlreadyExistsException.class new file mode 100644 index 0000000..3fa5150 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry$CommandAlreadyExistsException.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry$CommandNotFoundException.class b/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry$CommandNotFoundException.class new file mode 100644 index 0000000..aff4f4e Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry$CommandNotFoundException.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry$HelpCommand.class b/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry$HelpCommand.class new file mode 100644 index 0000000..4a6a9a3 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry$HelpCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry.class b/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry.class new file mode 100644 index 0000000..cdfa7ff Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/CommandRegistry.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/LongStrings.class b/Lab5Client/build/classes/java/main/client/commandline/LongStrings.class new file mode 100644 index 0000000..06e1b71 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/LongStrings.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/AddCommand.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/AddCommand.class new file mode 100644 index 0000000..9338031 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/AddCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/AddIfMaxCommand.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/AddIfMaxCommand.class new file mode 100644 index 0000000..1d9e693 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/AddIfMaxCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/AddIfMinCommand.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/AddIfMinCommand.class new file mode 100644 index 0000000..2a4570b Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/AddIfMinCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/ClearCommand.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/ClearCommand.class new file mode 100644 index 0000000..09532d8 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/ClearCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/FilterContainsNameCommand.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/FilterContainsNameCommand.class new file mode 100644 index 0000000..9cadfb9 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/FilterContainsNameCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/InfoCommand.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/InfoCommand.class new file mode 100644 index 0000000..46f468f Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/InfoCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/PeopleDatabaseCommand.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/PeopleDatabaseCommand.class new file mode 100644 index 0000000..ab582c2 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/PeopleDatabaseCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/PeopleDatabaseCommands.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/PeopleDatabaseCommands.class new file mode 100644 index 0000000..d585f65 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/PeopleDatabaseCommands.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/PrintFieldDescendingLocationCommand.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/PrintFieldDescendingLocationCommand.class new file mode 100644 index 0000000..6e87b7f Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/PrintFieldDescendingLocationCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/RemoveByIdCommand.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/RemoveByIdCommand.class new file mode 100644 index 0000000..63f9874 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/RemoveByIdCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/SaveCommand.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/SaveCommand.class new file mode 100644 index 0000000..4eedb74 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/SaveCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/ShowCommand.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/ShowCommand.class new file mode 100644 index 0000000..7fddd67 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/ShowCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/SumOfHeightCommand.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/SumOfHeightCommand.class new file mode 100644 index 0000000..66cefd7 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/SumOfHeightCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/commandline/pdcommands/UpdateCommand.class b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/UpdateCommand.class new file mode 100644 index 0000000..b57e994 Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/commandline/pdcommands/UpdateCommand.class differ diff --git a/Lab5Client/build/classes/java/main/client/net/UDPClient.class b/Lab5Client/build/classes/java/main/client/net/UDPClient.class new file mode 100644 index 0000000..66b61dc Binary files /dev/null and b/Lab5Client/build/classes/java/main/client/net/UDPClient.class differ diff --git a/Lab5Client/build/docs/javadoc/allclasses-frame.html b/Lab5Client/build/docs/javadoc/allclasses-frame.html new file mode 100644 index 0000000..493897a --- /dev/null +++ b/Lab5Client/build/docs/javadoc/allclasses-frame.html @@ -0,0 +1,44 @@ + + + + + +All Classes (Lab5Client 2.0 API) + + + + +

All Classes

+ + + diff --git a/Lab5Client/build/docs/javadoc/allclasses-noframe.html b/Lab5Client/build/docs/javadoc/allclasses-noframe.html new file mode 100644 index 0000000..f4512ab --- /dev/null +++ b/Lab5Client/build/docs/javadoc/allclasses-noframe.html @@ -0,0 +1,44 @@ + + + + + +All Classes (Lab5Client 2.0 API) + + + + +

All Classes

+ + + diff --git a/Lab5Client/build/docs/javadoc/client/Lab5Client.html b/Lab5Client/build/docs/javadoc/client/Lab5Client.html new file mode 100644 index 0000000..393446a --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/Lab5Client.html @@ -0,0 +1,268 @@ + + + + + +Lab5Client (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client
+

Class Lab5Client

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • client.Lab5Client
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class Lab5Client
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Lab5Client() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Lab5Client

        +
        public Lab5Client()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/Command.html b/Lab5Client/build/docs/javadoc/client/commandline/Command.html new file mode 100644 index 0000000..9aa6b54 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/Command.html @@ -0,0 +1,388 @@ + + + + + +Command (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline
+

Class Command

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • client.commandline.Command
    • +
    +
  • +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      protected java.lang.Stringalias 
      protected java.lang.Object[]args 
      protected booleanclientOnly 
      protected java.lang.Stringdescription 
      protected common.commandline.Executableexecutable 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Command(java.lang.String alias, + boolean clientOnly, + java.lang.String description, + common.commandline.Executable executable) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethod and Description
      common.commandline.response.CommandResultexecuteOnClient() 
      abstract booleanvalidate(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        alias

        +
        protected final java.lang.String alias
        +
      • +
      + + + +
        +
      • +

        description

        +
        protected final java.lang.String description
        +
      • +
      + + + +
        +
      • +

        clientOnly

        +
        protected final boolean clientOnly
        +
      • +
      + + + +
        +
      • +

        executable

        +
        protected final common.commandline.Executable executable
        +
      • +
      + + + +
        +
      • +

        args

        +
        protected java.lang.Object[] args
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Command

        +
        public Command(java.lang.String alias,
        +               boolean clientOnly,
        +               java.lang.String description,
        +               common.commandline.Executable executable)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public abstract boolean validate(java.lang.String[] args)
        +
      • +
      + + + +
        +
      • +

        executeOnClient

        +
        public common.commandline.response.CommandResult executeOnClient()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.ExecuteScriptCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.ExecuteScriptCommand.html new file mode 100644 index 0000000..1a97727 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.ExecuteScriptCommand.html @@ -0,0 +1,311 @@ + + + + + +CommandLineHandler.ExecuteScriptCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline
+

Class CommandLineHandler.ExecuteScriptCommand

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    Enclosing class:
    +
    CommandLineHandler
    +
    +
    +
    +
    public static class CommandLineHandler.ExecuteScriptCommand
    +extends Command
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ExecuteScriptCommand

        +
        public ExecuteScriptCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.ExitCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.ExitCommand.html new file mode 100644 index 0000000..3fec705 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.ExitCommand.html @@ -0,0 +1,311 @@ + + + + + +CommandLineHandler.ExitCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline
+

Class CommandLineHandler.ExitCommand

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    Enclosing class:
    +
    CommandLineHandler
    +
    +
    +
    +
    public static class CommandLineHandler.ExitCommand
    +extends Command
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ExitCommand

        +
        public ExitCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.HistoryCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.HistoryCommand.html new file mode 100644 index 0000000..1add7c0 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.HistoryCommand.html @@ -0,0 +1,311 @@ + + + + + +CommandLineHandler.HistoryCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline
+

Class CommandLineHandler.HistoryCommand

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    Enclosing class:
    +
    CommandLineHandler
    +
    +
    +
    +
    public static class CommandLineHandler.HistoryCommand
    +extends Command
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HistoryCommand

        +
        public HistoryCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.ModeCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.ModeCommand.html new file mode 100644 index 0000000..ae3bc1e --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.ModeCommand.html @@ -0,0 +1,311 @@ + + + + + +CommandLineHandler.ModeCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline
+

Class CommandLineHandler.ModeCommand

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    Enclosing class:
    +
    CommandLineHandler
    +
    +
    +
    +
    public static class CommandLineHandler.ModeCommand
    +extends Command
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ModeCommand

        +
        public ModeCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.html b/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.html new file mode 100644 index 0000000..593e4df --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/CommandLineHandler.html @@ -0,0 +1,431 @@ + + + + + +CommandLineHandler (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline
+

Class CommandLineHandler

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • client.commandline.CommandLineHandler
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class CommandLineHandler
    +extends java.lang.Object
    +
    Класс обработчика командной строки, реализует шаблон проектирования Singleton, + читает ввод с командной строки, обрабатывает его и вызывает соответствующую команду + на выполнение из регистра команд, используйте метод start() для его запуска
    +
    +
    See Also:
    +
    CommandRegistry
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidaddNewInput(java.io.Reader reader, + java.lang.String filePath) 
      java.lang.StringawaitInput(java.lang.String msg, + java.lang.String err) +
      Метод, ожидающий ввода из потока ввода reader и возвращающий результат, + печатает запрос msg перед ожиданием данных (если их вводит пользователь), + печатает ошибку err, если при вводе данных произошла ошибка
      +
      java.lang.StringawaitInput(java.lang.String msg, + java.lang.String err, + java.util.function.Predicate<java.lang.String> predicate) +
      Метод, ожидающий ввода из потока ввода reader и возвращающий результат, + печатает запрос msg перед ожиданием данных (если их вводит пользователь), + печатает ошибку err, если введенные данные не соответствуют предикату predicate
      +
      <T> TawaitInput(java.lang.String msg, + java.lang.String err, + java.util.function.Predicate<java.lang.String> predicate, + java.util.function.Function<java.lang.String,T> transform) +
      Метод, ожидающий ввода из потока ввода reader и возвращающий результат, + печатает запрос msg перед ожиданием данных (если их вводит пользователь), + печатает ошибку err, если введенные данные не соответствуют предикату predicate, + преобразует результат в тип T в соответствии с функцией transform
      +
      common.commandline.response.CommandResultexecuteOnServer(UDPClient udp, + Command command) 
      static CommandLineHandlergetInstance() 
      voidremoveInput() 
      voidstart() +
      Метод, запускающий обработчик командной строки, для остановки требуется ввести команду "exit"
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        start

        +
        public void start()
        +
        Метод, запускающий обработчик командной строки, для остановки требуется ввести команду "exit"
        +
      • +
      + + + +
        +
      • +

        executeOnServer

        +
        public common.commandline.response.CommandResult executeOnServer(UDPClient udp,
        +                                                                 Command command)
        +
      • +
      + + + +
        +
      • +

        awaitInput

        +
        public java.lang.String awaitInput(java.lang.String msg,
        +                                   java.lang.String err)
        +
        Метод, ожидающий ввода из потока ввода reader и возвращающий результат, + печатает запрос msg перед ожиданием данных (если их вводит пользователь), + печатает ошибку err, если при вводе данных произошла ошибка
        +
        +
        Parameters:
        +
        msg - Строка, печатающаяся как запрос данных от пользователя
        +
        err - Строка, печатающаяся во время ошибки
        +
        Returns:
        +
        Строка из потока ввода
        +
        +
      • +
      + + + +
        +
      • +

        awaitInput

        +
        public java.lang.String awaitInput(java.lang.String msg,
        +                                   java.lang.String err,
        +                                   java.util.function.Predicate<java.lang.String> predicate)
        +
        Метод, ожидающий ввода из потока ввода reader и возвращающий результат, + печатает запрос msg перед ожиданием данных (если их вводит пользователь), + печатает ошибку err, если введенные данные не соответствуют предикату predicate
        +
        +
        Parameters:
        +
        msg - Строка, печатающаяся как запрос данных от пользователя
        +
        err - Строка, печатающаяся при несоответствии ввода предикату
        +
        predicate - Предикат, определяющий валидность введенных данных
        +
        Returns:
        +
        Строка из потока ввода
        +
        +
      • +
      + + + +
        +
      • +

        awaitInput

        +
        public <T> T awaitInput(java.lang.String msg,
        +                        java.lang.String err,
        +                        java.util.function.Predicate<java.lang.String> predicate,
        +                        java.util.function.Function<java.lang.String,T> transform)
        +
        Метод, ожидающий ввода из потока ввода reader и возвращающий результат, + печатает запрос msg перед ожиданием данных (если их вводит пользователь), + печатает ошибку err, если введенные данные не соответствуют предикату predicate, + преобразует результат в тип T в соответствии с функцией transform
        +
        +
        Type Parameters:
        +
        T - Тип, к которому будет приведен результат
        +
        Parameters:
        +
        msg - Строка, печатающаяся как запрос данных от пользователя
        +
        err - Строка, печатающаяся при несоответствии ввода предикату
        +
        predicate - Предикат, определяющий валидность введенных данных
        +
        transform - Функция, преобразующая результат в тип T
        +
        Returns:
        +
        Результат типа T
        +
        +
      • +
      + + + +
        +
      • +

        addNewInput

        +
        public void addNewInput(java.io.Reader reader,
        +                        java.lang.String filePath)
        +
      • +
      + + + +
        +
      • +

        removeInput

        +
        public void removeInput()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/CommandRegistry.CommandAlreadyExistsException.html b/Lab5Client/build/docs/javadoc/client/commandline/CommandRegistry.CommandAlreadyExistsException.html new file mode 100644 index 0000000..75030e8 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/CommandRegistry.CommandAlreadyExistsException.html @@ -0,0 +1,228 @@ + + + + + +CommandRegistry.CommandAlreadyExistsException (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline
+

Class CommandRegistry.CommandAlreadyExistsException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • java.lang.RuntimeException
        • +
        • +
            +
          • client.commandline.CommandRegistry.CommandAlreadyExistsException
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    Enclosing class:
    +
    CommandRegistry
    +
    +
    +
    +
    public static class CommandRegistry.CommandAlreadyExistsException
    +extends java.lang.RuntimeException
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/CommandRegistry.CommandNotFoundException.html b/Lab5Client/build/docs/javadoc/client/commandline/CommandRegistry.CommandNotFoundException.html new file mode 100644 index 0000000..31887eb --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/CommandRegistry.CommandNotFoundException.html @@ -0,0 +1,228 @@ + + + + + +CommandRegistry.CommandNotFoundException (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline
+

Class CommandRegistry.CommandNotFoundException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • java.lang.RuntimeException
        • +
        • +
            +
          • client.commandline.CommandRegistry.CommandNotFoundException
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    Enclosing class:
    +
    CommandRegistry
    +
    +
    +
    +
    public static class CommandRegistry.CommandNotFoundException
    +extends java.lang.RuntimeException
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/CommandRegistry.HelpCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/CommandRegistry.HelpCommand.html new file mode 100644 index 0000000..6322a2a --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/CommandRegistry.HelpCommand.html @@ -0,0 +1,311 @@ + + + + + +CommandRegistry.HelpCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline
+

Class CommandRegistry.HelpCommand

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    Enclosing class:
    +
    CommandRegistry
    +
    +
    +
    +
    public static class CommandRegistry.HelpCommand
    +extends Command
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HelpCommand

        +
        public HelpCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/CommandRegistry.html b/Lab5Client/build/docs/javadoc/client/commandline/CommandRegistry.html new file mode 100644 index 0000000..11e3c59 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/CommandRegistry.html @@ -0,0 +1,314 @@ + + + + + +CommandRegistry (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline
+

Class CommandRegistry

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • client.commandline.CommandRegistry
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class CommandRegistry
    +extends java.lang.Object
    +
    Класс регистра команд, используемый для добавления, переопределения или удаления команд
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        registerCommand

        +
        public static void registerCommand(Command command)
        +
      • +
      + + + +
        +
      • +

        registerCommands

        +
        public static void registerCommands(Command... commands)
        +
      • +
      + + + +
        +
      • +

        reassignCommand

        +
        public static void reassignCommand(Command command)
        +
      • +
      + + + +
        +
      • +

        unregisterCommand

        +
        public static void unregisterCommand(java.lang.String alias)
        +
      • +
      + + + +
        +
      • +

        getCommand

        +
        public static Command getCommand(java.lang.String alias)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/LongStrings.html b/Lab5Client/build/docs/javadoc/client/commandline/LongStrings.html new file mode 100644 index 0000000..cb28d80 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/LongStrings.html @@ -0,0 +1,351 @@ + + + + + +LongStrings (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline
+

Enum LongStrings

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<LongStrings>
    • +
    • +
        +
      • client.commandline.LongStrings
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<LongStrings>
    +
    +
    +
    +
    public enum LongStrings
    +extends java.lang.Enum<LongStrings>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      GREETINGS 
      LINE 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.StringgetValue() 
      static LongStringsvalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static LongStrings[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static LongStrings[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (LongStrings c : LongStrings.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static LongStrings valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getValue

        +
        public java.lang.String getValue()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/package-frame.html b/Lab5Client/build/docs/javadoc/client/commandline/package-frame.html new file mode 100644 index 0000000..f977d5f --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/package-frame.html @@ -0,0 +1,35 @@ + + + + + +client.commandline (Lab5Client 2.0 API) + + + + +

client.commandline

+ + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/package-summary.html b/Lab5Client/build/docs/javadoc/client/commandline/package-summary.html new file mode 100644 index 0000000..ebc63df --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/package-summary.html @@ -0,0 +1,207 @@ + + + + + +client.commandline (Lab5Client 2.0 API) + + + + + + + + + + +
+

Package client.commandline

+
+
+ +
+ + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/package-tree.html b/Lab5Client/build/docs/javadoc/client/commandline/package-tree.html new file mode 100644 index 0000000..db1a74c --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/package-tree.html @@ -0,0 +1,170 @@ + + + + + +client.commandline Class Hierarchy (Lab5Client 2.0 API) + + + + + + + + + + +
+

Hierarchy For Package client.commandline

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    • +
    +
  • +
+
+ + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/AddCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/AddCommand.html new file mode 100644 index 0000000..0679d74 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/AddCommand.html @@ -0,0 +1,312 @@ + + + + + +AddCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class AddCommand

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        AddCommand

        +
        public AddCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/AddIfMaxCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/AddIfMaxCommand.html new file mode 100644 index 0000000..84f3970 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/AddIfMaxCommand.html @@ -0,0 +1,312 @@ + + + + + +AddIfMaxCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class AddIfMaxCommand

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        AddIfMaxCommand

        +
        public AddIfMaxCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/AddIfMinCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/AddIfMinCommand.html new file mode 100644 index 0000000..284a50e --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/AddIfMinCommand.html @@ -0,0 +1,312 @@ + + + + + +AddIfMinCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class AddIfMinCommand

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        AddIfMinCommand

        +
        public AddIfMinCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/ClearCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/ClearCommand.html new file mode 100644 index 0000000..4eab2f1 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/ClearCommand.html @@ -0,0 +1,312 @@ + + + + + +ClearCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class ClearCommand

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ClearCommand

        +
        public ClearCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/FilterContainsNameCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/FilterContainsNameCommand.html new file mode 100644 index 0000000..1bbccb7 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/FilterContainsNameCommand.html @@ -0,0 +1,312 @@ + + + + + +FilterContainsNameCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class FilterContainsNameCommand

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FilterContainsNameCommand

        +
        public FilterContainsNameCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/InfoCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/InfoCommand.html new file mode 100644 index 0000000..05c9d78 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/InfoCommand.html @@ -0,0 +1,312 @@ + + + + + +InfoCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class InfoCommand

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        InfoCommand

        +
        public InfoCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/PeopleDatabaseCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/PeopleDatabaseCommand.html new file mode 100644 index 0000000..6783e09 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/PeopleDatabaseCommand.html @@ -0,0 +1,330 @@ + + + + + +PeopleDatabaseCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class PeopleDatabaseCommand

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PeopleDatabaseCommand

        +
        public PeopleDatabaseCommand(java.lang.String alias,
        +                             boolean clientOnly,
        +                             java.lang.String description,
        +                             common.commandline.Executable executable)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        executeOnClient

        +
        public common.commandline.response.CommandResult executeOnClient()
        +
        +
        Overrides:
        +
        executeOnClient in class Command
        +
        +
      • +
      + + + +
        +
      • +

        validateIdCommand

        +
        public static boolean validateIdCommand(java.lang.String[] args)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/PeopleDatabaseCommands.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/PeopleDatabaseCommands.html new file mode 100644 index 0000000..102f392 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/PeopleDatabaseCommands.html @@ -0,0 +1,319 @@ + + + + + +PeopleDatabaseCommands (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class PeopleDatabaseCommands

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • client.commandline.pdcommands.PeopleDatabaseCommands
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class PeopleDatabaseCommands
    +extends java.lang.Object
    +
    Класс объявления всех команд, связанных с манипуляциями над объектом класса PeopleDatabase
    +
    +
    See Also:
    +
    PeopleDatabase
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      static common.collection.PeopleDatabasepeopleDatabase 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static common.data.CoordinatescreateCoordinates() 
      static common.data.LocationcreateLocation() 
      static common.data.PersoncreatePerson() 
      static voidregisterDatabaseCommands() +
      Метод добавления всех команд в регистр команд, обязательно вызывайте его в своей программе, + если вам требуются данные команды
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        peopleDatabase

        +
        public static common.collection.PeopleDatabase peopleDatabase
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        registerDatabaseCommands

        +
        public static void registerDatabaseCommands()
        +
        Метод добавления всех команд в регистр команд, обязательно вызывайте его в своей программе, + если вам требуются данные команды
        +
      • +
      + + + +
        +
      • +

        createPerson

        +
        public static common.data.Person createPerson()
        +
      • +
      + + + +
        +
      • +

        createLocation

        +
        public static common.data.Location createLocation()
        +
      • +
      + + + +
        +
      • +

        createCoordinates

        +
        public static common.data.Coordinates createCoordinates()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/PrintFieldDescendingLocationCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/PrintFieldDescendingLocationCommand.html new file mode 100644 index 0000000..8a4f121 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/PrintFieldDescendingLocationCommand.html @@ -0,0 +1,312 @@ + + + + + +PrintFieldDescendingLocationCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class PrintFieldDescendingLocationCommand

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PrintFieldDescendingLocationCommand

        +
        public PrintFieldDescendingLocationCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/RemoveByIdCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/RemoveByIdCommand.html new file mode 100644 index 0000000..ab50ad1 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/RemoveByIdCommand.html @@ -0,0 +1,312 @@ + + + + + +RemoveByIdCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class RemoveByIdCommand

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RemoveByIdCommand

        +
        public RemoveByIdCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/SaveCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/SaveCommand.html new file mode 100644 index 0000000..4e266bc --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/SaveCommand.html @@ -0,0 +1,312 @@ + + + + + +SaveCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class SaveCommand

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SaveCommand

        +
        public SaveCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/ShowCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/ShowCommand.html new file mode 100644 index 0000000..5bda0a4 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/ShowCommand.html @@ -0,0 +1,312 @@ + + + + + +ShowCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class ShowCommand

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ShowCommand

        +
        public ShowCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/SumOfHeightCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/SumOfHeightCommand.html new file mode 100644 index 0000000..22d7d5f --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/SumOfHeightCommand.html @@ -0,0 +1,312 @@ + + + + + +SumOfHeightCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class SumOfHeightCommand

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumOfHeightCommand

        +
        public SumOfHeightCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/UpdateCommand.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/UpdateCommand.html new file mode 100644 index 0000000..b9c6080 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/UpdateCommand.html @@ -0,0 +1,312 @@ + + + + + +UpdateCommand (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.commandline.pdcommands
+

Class UpdateCommand

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UpdateCommand

        +
        public UpdateCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validate

        +
        public boolean validate(java.lang.String[] args)
        +
        +
        Specified by:
        +
        validate in class Command
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/package-frame.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/package-frame.html new file mode 100644 index 0000000..6495b51 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/package-frame.html @@ -0,0 +1,32 @@ + + + + + +client.commandline.pdcommands (Lab5Client 2.0 API) + + + + +

client.commandline.pdcommands

+ + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/package-summary.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/package-summary.html new file mode 100644 index 0000000..2a9d2bf --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/package-summary.html @@ -0,0 +1,193 @@ + + + + + +client.commandline.pdcommands (Lab5Client 2.0 API) + + + + + + + + + + +
+

Package client.commandline.pdcommands

+
+
+ +
+ + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/package-tree.html b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/package-tree.html new file mode 100644 index 0000000..789e15b --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/commandline/pdcommands/package-tree.html @@ -0,0 +1,154 @@ + + + + + +client.commandline.pdcommands Class Hierarchy (Lab5Client 2.0 API) + + + + + + + + + + +
+

Hierarchy For Package client.commandline.pdcommands

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/net/UDPClient.html b/Lab5Client/build/docs/javadoc/client/net/UDPClient.html new file mode 100644 index 0000000..1fc25fe --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/net/UDPClient.html @@ -0,0 +1,323 @@ + + + + + +UDPClient (Lab5Client 2.0 API) + + + + + + + + + + + +
+
client.net
+

Class UDPClient

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • client.net.UDPClient
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class UDPClient
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      UDPClient(int port) 
      UDPClient(java.lang.String hostname, + int port) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidconnect() 
      voiddisconnect() 
      common.commandline.response.CommandResultreceive() 
      common.commandline.response.CommandResultsend(common.commandline.Executable executable, + java.lang.Object[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UDPClient

        +
        public UDPClient(int port)
        +
      • +
      + + + +
        +
      • +

        UDPClient

        +
        public UDPClient(java.lang.String hostname,
        +                 int port)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        connect

        +
        public void connect()
        +
      • +
      + + + +
        +
      • +

        disconnect

        +
        public void disconnect()
        +
      • +
      + + + +
        +
      • +

        send

        +
        public common.commandline.response.CommandResult send(common.commandline.Executable executable,
        +                                                      java.lang.Object[] args)
        +
      • +
      + + + +
        +
      • +

        receive

        +
        public common.commandline.response.CommandResult receive()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/net/package-frame.html b/Lab5Client/build/docs/javadoc/client/net/package-frame.html new file mode 100644 index 0000000..c388a1b --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/net/package-frame.html @@ -0,0 +1,19 @@ + + + + + +client.net (Lab5Client 2.0 API) + + + + +

client.net

+
+

Classes

+ +
+ + diff --git a/Lab5Client/build/docs/javadoc/client/net/package-summary.html b/Lab5Client/build/docs/javadoc/client/net/package-summary.html new file mode 100644 index 0000000..d88c824 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/net/package-summary.html @@ -0,0 +1,139 @@ + + + + + +client.net (Lab5Client 2.0 API) + + + + + + + + + + +
+

Package client.net

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    UDPClient 
    +
  • +
+
+ + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/net/package-tree.html b/Lab5Client/build/docs/javadoc/client/net/package-tree.html new file mode 100644 index 0000000..ac95358 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/net/package-tree.html @@ -0,0 +1,134 @@ + + + + + +client.net Class Hierarchy (Lab5Client 2.0 API) + + + + + + + + + + +
+

Hierarchy For Package client.net

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object + +
  • +
+
+ + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/package-frame.html b/Lab5Client/build/docs/javadoc/client/package-frame.html new file mode 100644 index 0000000..1e282b5 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/package-frame.html @@ -0,0 +1,19 @@ + + + + + +client (Lab5Client 2.0 API) + + + + +

client

+
+

Classes

+ +
+ + diff --git a/Lab5Client/build/docs/javadoc/client/package-summary.html b/Lab5Client/build/docs/javadoc/client/package-summary.html new file mode 100644 index 0000000..2122eb6 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/package-summary.html @@ -0,0 +1,139 @@ + + + + + +client (Lab5Client 2.0 API) + + + + + + + + + + +
+

Package client

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Lab5Client 
    +
  • +
+
+ + + + + + diff --git a/Lab5Client/build/docs/javadoc/client/package-tree.html b/Lab5Client/build/docs/javadoc/client/package-tree.html new file mode 100644 index 0000000..5ccbe49 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/client/package-tree.html @@ -0,0 +1,134 @@ + + + + + +client Class Hierarchy (Lab5Client 2.0 API) + + + + + + + + + + +
+

Hierarchy For Package client

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/Lab5Client/build/docs/javadoc/constant-values.html b/Lab5Client/build/docs/javadoc/constant-values.html new file mode 100644 index 0000000..fc0d8c4 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/constant-values.html @@ -0,0 +1,121 @@ + + + + + +Constant Field Values (Lab5Client 2.0 API) + + + + + + + + + + +
+

Constant Field Values

+

Contents

+
+ + + + + + diff --git a/Lab5Client/build/docs/javadoc/deprecated-list.html b/Lab5Client/build/docs/javadoc/deprecated-list.html new file mode 100644 index 0000000..600fef5 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/deprecated-list.html @@ -0,0 +1,121 @@ + + + + + +Deprecated List (Lab5Client 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Client/build/docs/javadoc/help-doc.html b/Lab5Client/build/docs/javadoc/help-doc.html new file mode 100644 index 0000000..ce285e5 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/help-doc.html @@ -0,0 +1,222 @@ + + + + + +API Help (Lab5Client 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    Overview

    +

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    +
  • +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Client/build/docs/javadoc/index-all.html b/Lab5Client/build/docs/javadoc/index-all.html new file mode 100644 index 0000000..e5800dc --- /dev/null +++ b/Lab5Client/build/docs/javadoc/index-all.html @@ -0,0 +1,449 @@ + + + + + +Index (Lab5Client 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
A C D E F G H I L M P R S U V  + + +

A

+
+
AddCommand - Class in client.commandline.pdcommands
+
 
+
AddCommand() - Constructor for class client.commandline.pdcommands.AddCommand
+
 
+
AddIfMaxCommand - Class in client.commandline.pdcommands
+
 
+
AddIfMaxCommand() - Constructor for class client.commandline.pdcommands.AddIfMaxCommand
+
 
+
AddIfMinCommand - Class in client.commandline.pdcommands
+
 
+
AddIfMinCommand() - Constructor for class client.commandline.pdcommands.AddIfMinCommand
+
 
+
addNewInput(Reader, String) - Method in class client.commandline.CommandLineHandler
+
 
+
alias - Variable in class client.commandline.Command
+
 
+
args - Variable in class client.commandline.Command
+
 
+
awaitInput(String, String) - Method in class client.commandline.CommandLineHandler
+
+
Метод, ожидающий ввода из потока ввода reader и возвращающий результат, + печатает запрос msg перед ожиданием данных (если их вводит пользователь), + печатает ошибку err, если при вводе данных произошла ошибка
+
+
awaitInput(String, String, Predicate<String>) - Method in class client.commandline.CommandLineHandler
+
+
Метод, ожидающий ввода из потока ввода reader и возвращающий результат, + печатает запрос msg перед ожиданием данных (если их вводит пользователь), + печатает ошибку err, если введенные данные не соответствуют предикату predicate
+
+
awaitInput(String, String, Predicate<String>, Function<String, T>) - Method in class client.commandline.CommandLineHandler
+
+
Метод, ожидающий ввода из потока ввода reader и возвращающий результат, + печатает запрос msg перед ожиданием данных (если их вводит пользователь), + печатает ошибку err, если введенные данные не соответствуют предикату predicate, + преобразует результат в тип T в соответствии с функцией transform
+
+
+ + + +

C

+
+
ClearCommand - Class in client.commandline.pdcommands
+
 
+
ClearCommand() - Constructor for class client.commandline.pdcommands.ClearCommand
+
 
+
client - package client
+
 
+
client.commandline - package client.commandline
+
 
+
client.commandline.pdcommands - package client.commandline.pdcommands
+
 
+
client.net - package client.net
+
 
+
clientOnly - Variable in class client.commandline.Command
+
 
+
Command - Class in client.commandline
+
 
+
Command(String, boolean, String, Executable) - Constructor for class client.commandline.Command
+
 
+
CommandLineHandler - Class in client.commandline
+
+
Класс обработчика командной строки, реализует шаблон проектирования Singleton, + читает ввод с командной строки, обрабатывает его и вызывает соответствующую команду + на выполнение из регистра команд, используйте метод CommandLineHandler.start() для его запуска
+
+
CommandLineHandler.ExecuteScriptCommand - Class in client.commandline
+
 
+
CommandLineHandler.ExitCommand - Class in client.commandline
+
 
+
CommandLineHandler.HistoryCommand - Class in client.commandline
+
 
+
CommandLineHandler.ModeCommand - Class in client.commandline
+
 
+
CommandRegistry - Class in client.commandline
+
+
Класс регистра команд, используемый для добавления, переопределения или удаления команд
+
+
CommandRegistry.CommandAlreadyExistsException - Exception in client.commandline
+
 
+
CommandRegistry.CommandNotFoundException - Exception in client.commandline
+
 
+
CommandRegistry.HelpCommand - Class in client.commandline
+
 
+
connect() - Method in class client.net.UDPClient
+
 
+
createCoordinates() - Static method in class client.commandline.pdcommands.PeopleDatabaseCommands
+
 
+
createLocation() - Static method in class client.commandline.pdcommands.PeopleDatabaseCommands
+
 
+
createPerson() - Static method in class client.commandline.pdcommands.PeopleDatabaseCommands
+
 
+
+ + + +

D

+
+
description - Variable in class client.commandline.Command
+
 
+
disconnect() - Method in class client.net.UDPClient
+
 
+
+ + + +

E

+
+
executable - Variable in class client.commandline.Command
+
 
+
executeOnClient() - Method in class client.commandline.Command
+
 
+
executeOnClient() - Method in class client.commandline.pdcommands.PeopleDatabaseCommand
+
 
+
executeOnServer(UDPClient, Command) - Method in class client.commandline.CommandLineHandler
+
 
+
ExecuteScriptCommand() - Constructor for class client.commandline.CommandLineHandler.ExecuteScriptCommand
+
 
+
ExitCommand() - Constructor for class client.commandline.CommandLineHandler.ExitCommand
+
 
+
+ + + +

F

+
+
FilterContainsNameCommand - Class in client.commandline.pdcommands
+
 
+
FilterContainsNameCommand() - Constructor for class client.commandline.pdcommands.FilterContainsNameCommand
+
 
+
+ + + +

G

+
+
getCommand(String) - Static method in class client.commandline.CommandRegistry
+
 
+
getInstance() - Static method in class client.commandline.CommandLineHandler
+
 
+
getValue() - Method in enum client.commandline.LongStrings
+
 
+
+ + + +

H

+
+
HelpCommand() - Constructor for class client.commandline.CommandRegistry.HelpCommand
+
 
+
HistoryCommand() - Constructor for class client.commandline.CommandLineHandler.HistoryCommand
+
 
+
+ + + +

I

+
+
InfoCommand - Class in client.commandline.pdcommands
+
 
+
InfoCommand() - Constructor for class client.commandline.pdcommands.InfoCommand
+
 
+
+ + + +

L

+
+
Lab5Client - Class in client
+
 
+
Lab5Client() - Constructor for class client.Lab5Client
+
 
+
LongStrings - Enum in client.commandline
+
 
+
+ + + +

M

+
+
main(String[]) - Static method in class client.Lab5Client
+
 
+
ModeCommand() - Constructor for class client.commandline.CommandLineHandler.ModeCommand
+
 
+
+ + + +

P

+
+
peopleDatabase - Static variable in class client.commandline.pdcommands.PeopleDatabaseCommands
+
 
+
PeopleDatabaseCommand - Class in client.commandline.pdcommands
+
 
+
PeopleDatabaseCommand(String, boolean, String, Executable) - Constructor for class client.commandline.pdcommands.PeopleDatabaseCommand
+
 
+
PeopleDatabaseCommands - Class in client.commandline.pdcommands
+
+
Класс объявления всех команд, связанных с манипуляциями над объектом класса PeopleDatabase
+
+
PrintFieldDescendingLocationCommand - Class in client.commandline.pdcommands
+
 
+
PrintFieldDescendingLocationCommand() - Constructor for class client.commandline.pdcommands.PrintFieldDescendingLocationCommand
+
 
+
+ + + +

R

+
+
reassignCommand(Command) - Static method in class client.commandline.CommandRegistry
+
 
+
receive() - Method in class client.net.UDPClient
+
 
+
registerCommand(Command) - Static method in class client.commandline.CommandRegistry
+
 
+
registerCommands(Command...) - Static method in class client.commandline.CommandRegistry
+
 
+
registerDatabaseCommands() - Static method in class client.commandline.pdcommands.PeopleDatabaseCommands
+
+
Метод добавления всех команд в регистр команд, обязательно вызывайте его в своей программе, + если вам требуются данные команды
+
+
RemoveByIdCommand - Class in client.commandline.pdcommands
+
 
+
RemoveByIdCommand() - Constructor for class client.commandline.pdcommands.RemoveByIdCommand
+
 
+
removeInput() - Method in class client.commandline.CommandLineHandler
+
 
+
+ + + +

S

+
+
SaveCommand - Class in client.commandline.pdcommands
+
 
+
SaveCommand() - Constructor for class client.commandline.pdcommands.SaveCommand
+
 
+
send(Executable, Object[]) - Method in class client.net.UDPClient
+
 
+
ShowCommand - Class in client.commandline.pdcommands
+
 
+
ShowCommand() - Constructor for class client.commandline.pdcommands.ShowCommand
+
 
+
start() - Method in class client.commandline.CommandLineHandler
+
+
Метод, запускающий обработчик командной строки, для остановки требуется ввести команду "exit"
+
+
SumOfHeightCommand - Class in client.commandline.pdcommands
+
 
+
SumOfHeightCommand() - Constructor for class client.commandline.pdcommands.SumOfHeightCommand
+
 
+
+ + + +

U

+
+
UDPClient - Class in client.net
+
 
+
UDPClient(int) - Constructor for class client.net.UDPClient
+
 
+
UDPClient(String, int) - Constructor for class client.net.UDPClient
+
 
+
unregisterCommand(String) - Static method in class client.commandline.CommandRegistry
+
 
+
UpdateCommand - Class in client.commandline.pdcommands
+
 
+
UpdateCommand() - Constructor for class client.commandline.pdcommands.UpdateCommand
+
 
+
+ + + +

V

+
+
validate(String[]) - Method in class client.commandline.Command
+
 
+
validate(String[]) - Method in class client.commandline.CommandLineHandler.ExecuteScriptCommand
+
 
+
validate(String[]) - Method in class client.commandline.CommandLineHandler.ExitCommand
+
 
+
validate(String[]) - Method in class client.commandline.CommandLineHandler.HistoryCommand
+
 
+
validate(String[]) - Method in class client.commandline.CommandLineHandler.ModeCommand
+
 
+
validate(String[]) - Method in class client.commandline.CommandRegistry.HelpCommand
+
 
+
validate(String[]) - Method in class client.commandline.pdcommands.AddCommand
+
 
+
validate(String[]) - Method in class client.commandline.pdcommands.AddIfMaxCommand
+
 
+
validate(String[]) - Method in class client.commandline.pdcommands.AddIfMinCommand
+
 
+
validate(String[]) - Method in class client.commandline.pdcommands.ClearCommand
+
 
+
validate(String[]) - Method in class client.commandline.pdcommands.FilterContainsNameCommand
+
 
+
validate(String[]) - Method in class client.commandline.pdcommands.InfoCommand
+
 
+
validate(String[]) - Method in class client.commandline.pdcommands.PrintFieldDescendingLocationCommand
+
 
+
validate(String[]) - Method in class client.commandline.pdcommands.RemoveByIdCommand
+
 
+
validate(String[]) - Method in class client.commandline.pdcommands.SaveCommand
+
 
+
validate(String[]) - Method in class client.commandline.pdcommands.ShowCommand
+
 
+
validate(String[]) - Method in class client.commandline.pdcommands.SumOfHeightCommand
+
 
+
validate(String[]) - Method in class client.commandline.pdcommands.UpdateCommand
+
 
+
validateIdCommand(String[]) - Static method in class client.commandline.pdcommands.PeopleDatabaseCommand
+
 
+
valueOf(String) - Static method in enum client.commandline.LongStrings
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum client.commandline.LongStrings
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
+A C D E F G H I L M P R S U V 
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Client/build/docs/javadoc/index.html b/Lab5Client/build/docs/javadoc/index.html new file mode 100644 index 0000000..3cf7b43 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/index.html @@ -0,0 +1,75 @@ + + + + + +Lab5Client 2.0 API + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/Lab5Client/build/docs/javadoc/overview-frame.html b/Lab5Client/build/docs/javadoc/overview-frame.html new file mode 100644 index 0000000..0f2a67d --- /dev/null +++ b/Lab5Client/build/docs/javadoc/overview-frame.html @@ -0,0 +1,23 @@ + + + + + +Overview List (Lab5Client 2.0 API) + + + + + + +

 

+ + diff --git a/Lab5Client/build/docs/javadoc/overview-summary.html b/Lab5Client/build/docs/javadoc/overview-summary.html new file mode 100644 index 0000000..d751211 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/overview-summary.html @@ -0,0 +1,147 @@ + + + + + +Overview (Lab5Client 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Lab5Client 2.0 API

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
client 
client.commandline 
client.commandline.pdcommands 
client.net 
+
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Client/build/docs/javadoc/overview-tree.html b/Lab5Client/build/docs/javadoc/overview-tree.html new file mode 100644 index 0000000..7e6f35b --- /dev/null +++ b/Lab5Client/build/docs/javadoc/overview-tree.html @@ -0,0 +1,192 @@ + + + + + +Class Hierarchy (Lab5Client 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    • +
    +
  • +
+
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Client/build/docs/javadoc/package-list b/Lab5Client/build/docs/javadoc/package-list new file mode 100644 index 0000000..1a69557 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/package-list @@ -0,0 +1,4 @@ +client +client.commandline +client.commandline.pdcommands +client.net diff --git a/Lab5Client/build/docs/javadoc/script.js b/Lab5Client/build/docs/javadoc/script.js new file mode 100644 index 0000000..b346356 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/Lab5Client/build/docs/javadoc/serialized-form.html b/Lab5Client/build/docs/javadoc/serialized-form.html new file mode 100644 index 0000000..d7c8260 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/serialized-form.html @@ -0,0 +1,266 @@ + + + + + +Serialized Form (Lab5Client 2.0 API) + + + + + + + + + + +
+

Serialized Form

+
+
+ +
+ + + + + + diff --git a/Lab5Client/build/docs/javadoc/stylesheet.css b/Lab5Client/build/docs/javadoc/stylesheet.css new file mode 100644 index 0000000..98055b2 --- /dev/null +++ b/Lab5Client/build/docs/javadoc/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/Lab5Client/build/libs/Lab5Client-2.0.jar b/Lab5Client/build/libs/Lab5Client-2.0.jar new file mode 100644 index 0000000..9bb6618 Binary files /dev/null and b/Lab5Client/build/libs/Lab5Client-2.0.jar differ diff --git a/Lab5Client/build/libs/connection.properties b/Lab5Client/build/libs/connection.properties new file mode 100644 index 0000000..15fc23f --- /dev/null +++ b/Lab5Client/build/libs/connection.properties @@ -0,0 +1,2 @@ +hostname=helios.se.ifmo.ru +port=1234 \ No newline at end of file diff --git a/Lab5Client/build/libs/connection.properties.bak b/Lab5Client/build/libs/connection.properties.bak new file mode 100644 index 0000000..193632e --- /dev/null +++ b/Lab5Client/build/libs/connection.properties.bak @@ -0,0 +1,2 @@ +hostname=s316304@helios.se.ifmo.ru +port=1234 \ No newline at end of file diff --git a/Lab5Client/build/libs/lab5.xml b/Lab5Client/build/libs/lab5.xml new file mode 100644 index 0000000..bca9d56 --- /dev/null +++ b/Lab5Client/build/libs/lab5.xml @@ -0,0 +1,130 @@ + + + + 321321321 + + 2.0 + 2.0 + + 2022-04-18 + 321321 + 321312312 + BLACK + CHINA + + 2.0 + 2.0 + 2 + w + + + + Gena + + 5.0 + 6.0 + + 2022-04-18 + 124 + 231323232 + BLACK + JAPAN + + 2.0 + 3.0 + 4 + Tokyo + + + + Sasha + + 3.4 + -2.0 + + 2022-04-18 + 175 + 2312131231 + BROWN + JAPAN + + 2323.0 + 443.0 + 2 + Tokyo + + + + w + + 2.0 + 2.0 + + 2022-04-18 + 2 + 321321312 + ORANGE + THAILAND + + 2.0 + 2.0 + 2 + 2 + + + + w + + 2.0 + 2.0 + + 2022-03-22 + 1 + wwwwwwwwwwww + BLACK + GERMANY + + 2.0 + 2.0 + 2 + + + + + w + + 2.0 + 2.0 + + 2022-03-22 + + wwwwwwwwwwwwwwwww + BLACK + CHINA + + 2.0 + 2.0 + 2 + w + + + + wasd + + 2.0 + 2.0 + + 2022-04-18 + 2 + 2313213121 + BLACK + GERMANY + + 2.0 + 2.0 + 2 + wasd + + + 2022-03-22 + diff --git a/Lab5Client/build/libs/lab5.xml.bak b/Lab5Client/build/libs/lab5.xml.bak new file mode 100644 index 0000000..0f4e4ca --- /dev/null +++ b/Lab5Client/build/libs/lab5.xml.bak @@ -0,0 +1,130 @@ + + + + 321321321 + + 2.0 + 2.0 + + 2022-04-18 + 321321 + 321312312 + BLACK + CHINA + + 2.0 + 2.0 + 2 + w + + + + Gena + + 5.0 + 6.0 + + 2022-04-18 + 124 + 231323232 + BLACK + JAPAN + + 2.0 + 3.0 + 4 + Tokyo + + + + Sasha + + 3.4 + -2.0 + + 2022-04-18 + 175 + 2312131231 + BROWN + JAPAN + + 2323.0 + 443.0 + 2 + Tokyo + + + + w + + 2.0 + 2.0 + + 2022-04-18 + 2 + 321321312 + ORANGE + THAILAND + + 2.0 + 2.0 + 2 + 2 + + + + w + + 2.0 + 2.0 + + 2022-03-22 + 1 + wwwwwwwwwwww + BLACK + GERMANY + + 2.0 + 2.0 + 2 + + + + + w + + 2.0 + 2.0 + + 2022-03-22 + + wwwwwwwwwwwwwwwww + BLACK + CHINA + + 2.0 + 2.0 + 2 + w + + + + wasd + + 2.0 + 2.0 + + 2022-04-18 + 2 + 2313213121 + BLACK + GERMANY + + 2.0 + 2.0 + 2 + wasd + + + 2022-03-22 + diff --git a/Lab5Client/build/libs/run.bat b/Lab5Client/build/libs/run.bat new file mode 100644 index 0000000..b06d7dc --- /dev/null +++ b/Lab5Client/build/libs/run.bat @@ -0,0 +1,3 @@ +cls +java -jar Lab5-1.0.jar +pause diff --git a/Lab5Client/build/libs/run.bat.bak b/Lab5Client/build/libs/run.bat.bak new file mode 100644 index 0000000..0ac50be --- /dev/null +++ b/Lab5Client/build/libs/run.bat.bak @@ -0,0 +1,3 @@ +cls +java -jar Lab5-1.0.jar +pause \ No newline at end of file diff --git a/Lab5Client/build/libs/script.txt b/Lab5Client/build/libs/script.txt new file mode 100644 index 0000000..f5115d2 --- /dev/null +++ b/Lab5Client/build/libs/script.txt @@ -0,0 +1,18 @@ +show +info +add +Gena +124 +231323232 +black +japan +2 +3 +4 +Tokyo +5 +6 +show +execute_script script2.txt +sum_of_height +filter_contains_name e \ No newline at end of file diff --git a/Lab5Client/build/libs/script2.txt b/Lab5Client/build/libs/script2.txt new file mode 100644 index 0000000..f89072a --- /dev/null +++ b/Lab5Client/build/libs/script2.txt @@ -0,0 +1,15 @@ +add +Sasha +175 +2312131231 +brown +japan +2323 +443 +2 +Tokyo +3.4 +-2 +execute_script script.txt +show +print_field_descending_location \ No newline at end of file diff --git a/Lab5Client/build/tmp/compileJava/previous-compilation-data.bin b/Lab5Client/build/tmp/compileJava/previous-compilation-data.bin new file mode 100644 index 0000000..bbecc71 Binary files /dev/null and b/Lab5Client/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/Lab5Client/build/tmp/jar/MANIFEST.MF b/Lab5Client/build/tmp/jar/MANIFEST.MF new file mode 100644 index 0000000..012a17f --- /dev/null +++ b/Lab5Client/build/tmp/jar/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: client.Lab5Client + diff --git a/Lab5Client/build/tmp/javadoc/javadoc.options b/Lab5Client/build/tmp/javadoc/javadoc.options new file mode 100644 index 0000000..183e73d --- /dev/null +++ b/Lab5Client/build/tmp/javadoc/javadoc.options @@ -0,0 +1,27 @@ +-classpath 'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\build\\classes\\java\\main;C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\build\\resources\\main;C:\\Users\\egor\\.gradle\\caches\\modules-2\\files-2.1\\org.projectlombok\\lombok\\1.18.22\\9c08ea24c6eb714e2d6170e8122c069a0ba9aacf\\lombok-1.18.22.jar;C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\build\\libs\\Lab5Core-2.0.jar' +-d 'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\build\\docs\\javadoc' +-doctitle 'Lab5Client 2.0 API' +-encoding 'UTF-8' +-notimestamp +-quiet +-windowtitle 'Lab5Client 2.0 API' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\Command.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\CommandLineHandler.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\CommandRegistry.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\LongStrings.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\AddCommand.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\AddIfMaxCommand.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\AddIfMinCommand.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\ClearCommand.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\FilterContainsNameCommand.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\InfoCommand.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\PeopleDatabaseCommand.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\PeopleDatabaseCommands.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\PrintFieldDescendingLocationCommand.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\RemoveByIdCommand.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\SaveCommand.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\ShowCommand.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\SumOfHeightCommand.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\commandline\\pdcommands\\UpdateCommand.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\Lab5Client.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Client\\src\\main\\java\\client\\net\\UDPClient.java' diff --git a/Lab5Client/build/tmp/shadowJar/MANIFEST.MF b/Lab5Client/build/tmp/shadowJar/MANIFEST.MF new file mode 100644 index 0000000..012a17f --- /dev/null +++ b/Lab5Client/build/tmp/shadowJar/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: client.Lab5Client + diff --git a/Lab5Client/src/main/java/client/Lab5Client.java b/Lab5Client/src/main/java/client/Lab5Client.java new file mode 100644 index 0000000..20e45ff --- /dev/null +++ b/Lab5Client/src/main/java/client/Lab5Client.java @@ -0,0 +1,28 @@ +package client; + +import client.commandline.CommandLineHandler; +import client.commandline.pdcommands.PeopleDatabaseCommands; +import common.collection.Database; +import common.collection.PeopleDatabase; + +import java.util.logging.Logger; + +public class Lab5Client { + + public static void main(String[] args) { + Logger logger = Logger.getLogger("Lab5Client"); + CommandLineHandler cmd = CommandLineHandler.getInstance(); + + PeopleDatabaseCommands.registerDatabaseCommands(); + PeopleDatabase peopleDatabase = new PeopleDatabase(logger); + try { + peopleDatabase.load(); + } catch (Database.DatabaseLoadFailedException e) { + System.out.println(e.getMessage()); + System.exit(-1); + } + PeopleDatabaseCommands.peopleDatabase = peopleDatabase; + + cmd.start(); + } +} diff --git a/Lab5Client/src/main/java/client/commandline/Command.java b/Lab5Client/src/main/java/client/commandline/Command.java new file mode 100644 index 0000000..86b0d1a --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/Command.java @@ -0,0 +1,31 @@ +package client.commandline; + +import common.commandline.Executable; +import common.commandline.response.CommandResult; +import lombok.Getter; + +import java.io.Serializable; + +@Getter +public abstract class Command implements Serializable { + + protected final String alias; + protected final String description; + protected final boolean clientOnly; + protected final Executable executable; + + protected Object[] args; + + public Command(String alias, boolean clientOnly, String description, Executable executable) { + this.alias = alias; + this.clientOnly = clientOnly; + this.description = description; + this.executable = executable; + } + + public abstract boolean validate(String[] args); + + public CommandResult executeOnClient() { + return executable.execute(args); + } +} diff --git a/src/main/java/ru/erius/lab5/commandline/CommandLineHandler.java b/Lab5Client/src/main/java/client/commandline/CommandLineHandler.java similarity index 53% rename from src/main/java/ru/erius/lab5/commandline/CommandLineHandler.java rename to Lab5Client/src/main/java/client/commandline/CommandLineHandler.java index bd5a604..a484b30 100644 --- a/src/main/java/ru/erius/lab5/commandline/CommandLineHandler.java +++ b/Lab5Client/src/main/java/client/commandline/CommandLineHandler.java @@ -1,9 +1,16 @@ -package ru.erius.lab5.commandline; +package client.commandline; -import ru.erius.lab5.util.UtilFunctions; +import client.net.UDPClient; +import common.commandline.response.CommandResult; +import common.commandline.response.DefaultResponse; +import common.parser.ConnectionProperties; +import common.util.UtilFunctions; import java.io.*; -import java.util.*; +import java.util.Deque; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; import java.util.function.Function; import java.util.function.Predicate; @@ -18,11 +25,13 @@ public final class CommandLineHandler { private final static CommandLineHandler instance = new CommandLineHandler(); + private final UDPClient udp = new UDPClient(ConnectionProperties.getHostname(), ConnectionProperties.getPort()); private final Deque inputs = new LinkedList<>(); private final Deque fileNames = new LinkedList<>(); private final List history = new LinkedList<>(); private BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); private boolean isActive = false; + private boolean clientMode = true; static { clearScreen(); @@ -36,12 +45,7 @@ public final class CommandLineHandler { } private static void registerBasicCommands() { - CommandRegistry.registerCommand("exit", args -> instance.exit(), - "exit : завершить программу (без сохранения в файл)"); - CommandRegistry.registerCommand("history", instance::showHistory, - "history [count] : вывести последние count введенных команд, по умолчанию count равен 6"); - CommandRegistry.registerCommand("execute_script", instance::executeScript, - "execute_script {file_name} : считать и исполнить скрипт из указанного файла. В скрипте содержатся команды в таком же виде, в котором их вводит пользователь в интерактивном режиме."); + CommandRegistry.registerCommands(new ExitCommand(), new HistoryCommand(), new ExecuteScriptCommand(), new ModeCommand()); } /** @@ -77,65 +81,33 @@ public final class CommandLineHandler { args = new String[split.length - 1]; System.arraycopy(split, 1, args, 0, split.length - 1); } + executeCommand(alias, args); + } + + private void executeCommand(String alias, String[] args) { Command command = CommandRegistry.getCommand(alias); if (command == null) { - System.out.println("Неизвестная команда " + alias + ", напишите help для отображения всех существующих команд"); + System.err.println("Неизвестная команда " + alias + ", напишите help для отображения всех существующих команд"); return; } - command.execute(args); + boolean argsValid = command.validate(args); + if (!argsValid) return; + CommandResult result = command.isClientOnly() || clientMode ? + command.executeOnClient() : executeOnServer(udp, command); + PrintStream ps = result.getResponse() == DefaultResponse.OK ? System.out : System.err; + if (result.getValue() == null) ps.println(result.getResponse().getMsg()); + else ps.println(result.getValue()); updateHistory(alias); } - /** - * Метод, останавливающий работу обработчика командной строки - */ - public void exit() { - this.isActive = false; - System.out.println("Выход из программы..."); - } - - public void showHistory(String[] args) { - int lines = 6; - if (args.length >= 1 && UtilFunctions.intOrNull(args[0]) != null) - lines = Integer.parseInt(args[0]); - if (lines <= 0) { - System.out.println("[count] должен быть больше 0"); - return; - } - int start = lines < history.size() ? history.size() - lines : 0; - System.out.println("История последних команд:"); - for (int i = start; i < history.size(); i++) - System.out.println(history.get(i)); - } - - public void executeScript(String[] args) { - if (args.length < 1) { - System.out.println("Недостаточно данных"); - return; - } - - String fileName = args[0]; - File file = new File(fileName); - if (!file.exists() || file.isDirectory()) { - System.out.println("Не удалось найти файл " + fileName); - return; - } - - Reader streamReader; - try { - streamReader = new InputStreamReader(new FileInputStream(file)); - } catch (FileNotFoundException e) { - e.printStackTrace(); - System.out.println("Что-то пошло не так"); - return; - } - addNewInput(streamReader, fileName); - } - private void updateHistory(String command) { history.add(command); } + public CommandResult executeOnServer(UDPClient udp, Command command) { + return udp.send(command.executable, command.args); + } + /** * Метод, ожидающий ввода из потока ввода {@link #reader reader} и возвращающий результат, * печатает запрос msg перед ожиданием данных (если их вводит пользователь), @@ -221,4 +193,108 @@ public final class CommandLineHandler { Reader reader = inputs.isEmpty() ? new InputStreamReader(System.in) : inputs.peek(); this.reader = new BufferedReader(reader); } + + public static class ExitCommand extends Command { + public ExitCommand() { + super("exit", true, "exit : завершить программу (без сохранения в файл)", + args -> { + instance.isActive = false; + return new CommandResult("Выход из программы...", DefaultResponse.OK); + }); + } + + @Override + public boolean validate(String[] args) { + return true; + } + } + + public static class HistoryCommand extends Command { + public HistoryCommand() { + super("history", true, "history [count] : вывести последние count введенных команд, по умолчанию count равен 6", + args -> { + int lines = args.length > 0 ? (int) args[0] : 6; + int start = lines < instance.history.size() ? instance.history.size() - lines : 0; + StringBuilder result = new StringBuilder("История последних команд:\n"); + for (int i = start; i < instance.history.size(); i++) + result.append(instance.history.get(i)).append("\n"); + return new CommandResult(result.toString(), DefaultResponse.OK); + }); + } + + @Override + public boolean validate(String[] args) { + Integer value = 6; + this.args = new Object[]{ value }; + if (args.length > 0) { + value = UtilFunctions.intOrNull(args[0]); + if (value != null) { + this.args = new Object[]{ value }; + return true; + } else return false; + } + return true; + } + } + + public static class ExecuteScriptCommand extends Command { + public ExecuteScriptCommand() { + super("execute_script", true, "execute_script {file_name} : считать и исполнить скрипт из указанного файла. В скрипте содержатся команды в таком же виде, в котором их вводит пользователь в интерактивном режиме.", + args -> { + String fileName = (String) args[0]; + File file = new File(fileName); + if (!file.exists() || file.isDirectory()) + return new CommandResult(null, DefaultResponse.FILE_NOT_FOUND); + + Reader streamReader; + try { + streamReader = new InputStreamReader(new FileInputStream(file)); + } catch (FileNotFoundException e) { + e.printStackTrace(); + return new CommandResult(null, DefaultResponse.UNKNOWN); + } + instance.addNewInput(streamReader, fileName); + return new CommandResult(null, DefaultResponse.OK); + }); + } + + @Override + public boolean validate(String[] args) { + if (args.length < 1) { + System.err.println("Недостаточно данных"); + return false; + } + this.args = args; + return true; + } + } + + public static class ModeCommand extends Command { + public ModeCommand() { + super("mode", true, "mode [sw] : выводит режим работы программы, если написать sw, меняет режим с серверного на клиентский или наоборот", + args -> { + String result; + if (args.length == 0) { + result = "Программа работает в режиме клиент " + (instance.clientMode ? "" : "+ сервер"); + } else { + instance.clientMode = !instance.clientMode; + if (instance.clientMode) { + result = "Режим работы сменен на клиент"; + instance.udp.disconnect(); + } else { + result = "Режим работы сменен на клиент + сервер"; + instance.udp.connect(); + } + } + return new CommandResult(result, DefaultResponse.OK); + }); + } + + @Override + public boolean validate(String[] args) { + if (args.length > 0 && args[0].equals("sw")) this.args = args; + else this.args = new Object[]{}; + return true; + } + } } diff --git a/src/main/java/ru/erius/lab5/commandline/CommandRegistry.java b/Lab5Client/src/main/java/client/commandline/CommandRegistry.java similarity index 50% rename from src/main/java/ru/erius/lab5/commandline/CommandRegistry.java rename to Lab5Client/src/main/java/client/commandline/CommandRegistry.java index 3d866b2..b3a7258 100644 --- a/src/main/java/ru/erius/lab5/commandline/CommandRegistry.java +++ b/Lab5Client/src/main/java/client/commandline/CommandRegistry.java @@ -1,41 +1,40 @@ -package ru.erius.lab5.commandline; +package client.commandline; + +import common.commandline.response.CommandResult; +import common.commandline.response.DefaultResponse; -import java.util.Comparator; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * Класс регистра команд, используемый для добавления, переопределения или удаления команд */ public final class CommandRegistry { - private static final Map COMMANDS = new HashMap<>(); + private static final Map COMMANDS = new HashMap<>(); private CommandRegistry() { } static { - registerCommand("help", args -> help(), - "help : вывести справку по доступным командам"); + registerCommand(new HelpCommand()); } - public static void registerCommand(String alias, Command command) { - registerCommand(alias, command, null); - } - - public static void registerCommand(String alias, Command command, String desc) { - if (COMMANDS.containsKey(alias)) + public static void registerCommand(Command command) { + if (COMMANDS.containsKey(command.getAlias())) throw new CommandAlreadyExistsException("Команда %s уже существует, " + - "используйте метод reassignCommand() для переопределения существующей команды", alias); - COMMANDS.put(alias, new DescriptiveCommand(command, desc)); + "используйте метод reassignCommand() для переопределения существующей команды", command.getAlias()); + COMMANDS.put(command.getAlias(), command); } - public static void reassignCommand(String alias, Command command, String desc) { - if (!COMMANDS.containsKey(alias)) - throw new CommandNotFoundException("Не удалось переопределить несуществующую команду %s", alias); - COMMANDS.put(alias, new DescriptiveCommand(command, desc)); + public static void registerCommands(Command... commands) { + for (Command command : commands) registerCommand(command); + } + + public static void reassignCommand(Command command) { + if (!COMMANDS.containsKey(command.getAlias())) + throw new CommandNotFoundException("Не удалось переопределить несуществующую команду %s", command.getAlias()); + COMMANDS.put(command.getAlias(), command); } public static void unregisterCommand(String alias) { @@ -45,20 +44,7 @@ public final class CommandRegistry { } public static Command getCommand(String alias) { - DescriptiveCommand command = COMMANDS.get(alias); - return command == null ? null : command.getCommand() ; - } - - public static void help() { - System.out.println(LongStrings.LINE.getValue() + "\n"); - List commands = COMMANDS.values().stream() - .sorted(Comparator.comparing(DescriptiveCommand::getDesc)) - .collect(Collectors.toList()); - for (DescriptiveCommand dc : commands) { - String desc = dc.getDesc(); - if (desc != null) System.out.println(desc + "\n"); - } - System.out.println(LongStrings.LINE.getValue()); + return COMMANDS.get(alias); } public static class CommandNotFoundException extends RuntimeException { @@ -82,4 +68,24 @@ public final class CommandRegistry { super(String.format(message, alias)); } } + + public static class HelpCommand extends Command { + public HelpCommand() { + super("help", true, "help : вывести справку по доступным командам", + args -> { + StringBuilder result = new StringBuilder(LongStrings.LINE.getValue() + "\n\n"); + for (Command c : COMMANDS.values()) { + String desc = c.getDescription(); + if (desc != null) result.append(desc).append("\n\n"); + } + result.append(LongStrings.LINE.getValue()); + return new CommandResult(result.toString(), DefaultResponse.OK); + }); + } + + @Override + public boolean validate(String[] args) { + return true; + } + } } diff --git a/src/main/java/ru/erius/lab5/commandline/LongStrings.java b/Lab5Client/src/main/java/client/commandline/LongStrings.java similarity index 95% rename from src/main/java/ru/erius/lab5/commandline/LongStrings.java rename to Lab5Client/src/main/java/client/commandline/LongStrings.java index 8f6cf00..76ee683 100644 --- a/src/main/java/ru/erius/lab5/commandline/LongStrings.java +++ b/Lab5Client/src/main/java/client/commandline/LongStrings.java @@ -1,4 +1,4 @@ -package ru.erius.lab5.commandline; +package client.commandline; public enum LongStrings { LINE("=================================================================================================="), diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/AddCommand.java b/Lab5Client/src/main/java/client/commandline/pdcommands/AddCommand.java new file mode 100644 index 0000000..3f8e008 --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/AddCommand.java @@ -0,0 +1,16 @@ +package client.commandline.pdcommands; + +import common.commandline.Executables; + +public class AddCommand extends PeopleDatabaseCommand { + public AddCommand() { + super("add", false, "add : добавить новый элемент в коллекцию", + Executables.ADD.getExecutable()); + } + + @Override + public boolean validate(String[] args) { + this.args = new Object[]{ null, PeopleDatabaseCommands.createPerson() }; + return true; + } +} diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/AddIfMaxCommand.java b/Lab5Client/src/main/java/client/commandline/pdcommands/AddIfMaxCommand.java new file mode 100644 index 0000000..a0a7120 --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/AddIfMaxCommand.java @@ -0,0 +1,16 @@ +package client.commandline.pdcommands; + +import common.commandline.Executables; + +public class AddIfMaxCommand extends PeopleDatabaseCommand { + public AddIfMaxCommand() { + super("add_if_max", false, "add_if_max : добавить новый элемент в коллекцию, если его значение превышает значение наибольшего элемента этой коллекции", + Executables.ADD_IF_MAX.getExecutable()); + } + + @Override + public boolean validate(String[] args) { + this.args = new Object[]{ null, PeopleDatabaseCommands.createPerson() }; + return true; + } +} diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/AddIfMinCommand.java b/Lab5Client/src/main/java/client/commandline/pdcommands/AddIfMinCommand.java new file mode 100644 index 0000000..3a10ef4 --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/AddIfMinCommand.java @@ -0,0 +1,16 @@ +package client.commandline.pdcommands; + +import common.commandline.Executables; + +public class AddIfMinCommand extends PeopleDatabaseCommand { + public AddIfMinCommand() { + super("add_if_min", false, "add_if_min : добавить новый элемент в коллекцию, если его значение меньше, чем у наименьшего элемента этой коллекции", + Executables.ADD_IF_MIN.getExecutable()); + } + + @Override + public boolean validate(String[] args) { + this.args = new Object[]{ null, PeopleDatabaseCommands.createPerson() }; + return true; + } +} diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/ClearCommand.java b/Lab5Client/src/main/java/client/commandline/pdcommands/ClearCommand.java new file mode 100644 index 0000000..f8f9b64 --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/ClearCommand.java @@ -0,0 +1,16 @@ +package client.commandline.pdcommands; + +import common.commandline.Executables; + +public class ClearCommand extends PeopleDatabaseCommand { + public ClearCommand() { + super("clear", false, "clear : очистить коллекцию", + Executables.CLEAR.getExecutable()); + } + + @Override + public boolean validate(String[] args) { + this.args = new Object[]{ null }; + return true; + } +} \ No newline at end of file diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/FilterContainsNameCommand.java b/Lab5Client/src/main/java/client/commandline/pdcommands/FilterContainsNameCommand.java new file mode 100644 index 0000000..73bc948 --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/FilterContainsNameCommand.java @@ -0,0 +1,20 @@ +package client.commandline.pdcommands; + +import common.commandline.Executables; + +public class FilterContainsNameCommand extends PeopleDatabaseCommand { + public FilterContainsNameCommand() { + super("filter_contains_name", false, "filter_contains_name {name} : вывести элементы, значение поля name которых содержит заданную подстроку", + Executables.FILTER_CONTAINS_NAME.getExecutable()); + } + + @Override + public boolean validate(String[] args) { + if (args.length < 1) { + System.err.println("Недостаточно данных"); + return false; + } + this.args = new Object[]{ null, args[0] }; + return true; + } +} diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/InfoCommand.java b/Lab5Client/src/main/java/client/commandline/pdcommands/InfoCommand.java new file mode 100644 index 0000000..13fbc8d --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/InfoCommand.java @@ -0,0 +1,16 @@ +package client.commandline.pdcommands; + +import common.commandline.Executables; + +public class InfoCommand extends PeopleDatabaseCommand { + public InfoCommand() { + super("info", false, "info : вывести в стандартный поток вывода информацию о коллекции (тип, дата инициализации, количество элементов и т.д.)", + Executables.INFO.getExecutable()); + } + + @Override + public boolean validate(String[] args) { + this.args = new Object[]{ null }; + return true; + } +} diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/PeopleDatabaseCommand.java b/Lab5Client/src/main/java/client/commandline/pdcommands/PeopleDatabaseCommand.java new file mode 100644 index 0000000..6d1d539 --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/PeopleDatabaseCommand.java @@ -0,0 +1,30 @@ +package client.commandline.pdcommands; + +import client.commandline.Command; +import common.commandline.Executable; +import common.commandline.response.CommandResult; +import common.util.UtilFunctions; + +public abstract class PeopleDatabaseCommand extends Command { + public PeopleDatabaseCommand(String alias, boolean clientOnly, String description, Executable executable) { + super(alias, clientOnly, description, executable); + } + + public CommandResult executeOnClient() { + args[0] = PeopleDatabaseCommands.peopleDatabase; + return super.executeOnClient(); + } + + public static boolean validateIdCommand(String[] args) { + if (args.length < 1) { + System.err.println("Недостаточно данных"); + return false; + } + Long id = UtilFunctions.longOrNull(args[0]); + if (id == null) { + System.err.println("{id} должен быть целым числом"); + return false; + } + return true; + } +} diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/PeopleDatabaseCommands.java b/Lab5Client/src/main/java/client/commandline/pdcommands/PeopleDatabaseCommands.java new file mode 100644 index 0000000..565ac0c --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/PeopleDatabaseCommands.java @@ -0,0 +1,82 @@ +package client.commandline.pdcommands; + +import client.commandline.CommandLineHandler; +import client.commandline.CommandRegistry; +import common.collection.PeopleDatabase; +import common.data.*; +import common.util.UtilFunctions; + +import java.util.Arrays; +import java.util.Locale; + +/** + * Класс объявления всех команд, связанных с манипуляциями над объектом класса PeopleDatabase + * + * @see PeopleDatabase + */ +public final class PeopleDatabaseCommands { + + public static PeopleDatabase peopleDatabase; + private static final String COLORS = Arrays.toString(Color.values()), + COUNTRIES = Arrays.toString(Country.values()); + private static final CommandLineHandler CMD = CommandLineHandler.getInstance(); + + private PeopleDatabaseCommands() {} + + /** + * Метод добавления всех команд в регистр команд, обязательно вызывайте его в своей программе, + * если вам требуются данные команды + */ + public static void registerDatabaseCommands() { + CommandRegistry.registerCommands(new InfoCommand(), new ShowCommand(), new AddCommand(), new AddIfMaxCommand(), + new AddIfMinCommand(), new ClearCommand(), new FilterContainsNameCommand(), new PrintFieldDescendingLocationCommand(), + new RemoveByIdCommand(), new SaveCommand(), new SumOfHeightCommand(), new UpdateCommand()); + } + + public static Person createPerson() { + System.out.println("Создание нового объекта класса Person"); + String name = CMD.awaitInput("Введите имя:", "Введите непустую строку", + input -> !input.isEmpty()); + Integer height = CMD.awaitInput("Введите рост:", "Введите целое число, большее нуля", + input -> { + Integer result = UtilFunctions.intOrNull(input); + return result != null && result > 0 || input.isEmpty(); + }, input -> input.isEmpty() ? null : Integer.parseInt(input)); + String passportID = CMD.awaitInput("Введите номер паспорта:", "Введите минимум 8 символов", + input -> input.length() >= 8 || input.isEmpty(), input -> input.isEmpty() ? null : input); + Color eyeColor = CMD.awaitInput("Введите цвет глаз " + COLORS + ":", "Введите один из предложенных цветов", + input -> UtilFunctions.enumOrNull(input.toUpperCase(Locale.ROOT), Color.class) != null, + input -> Color.valueOf(input.toUpperCase(Locale.ROOT))); + Country nationality = CMD.awaitInput("Введите национальность " + COUNTRIES + ":", "Введите одну из предложенных стран", + input -> UtilFunctions.enumOrNull(input.toUpperCase(Locale.ROOT), Country.class) != null, + input -> Country.valueOf(input.toUpperCase(Locale.ROOT))); + Location location = createLocation(); + Coordinates coordinates = createCoordinates(); + return new Person(name, coordinates, height, passportID, eyeColor, nationality, location); + } + + public static Location createLocation() { + System.out.println("Создание нового объекта класса Location"); + double x = CMD.awaitInput("Введите x:", "Введите дробное число", + input -> UtilFunctions.doubleOrNull(input) != null, Double::parseDouble); + float y = CMD.awaitInput("Введите y:", "Введите дробное число", + input -> UtilFunctions.floatOrNull(input) != null, Float::parseFloat); + long z = CMD.awaitInput("Введите z:", "Введите целое число", + input -> UtilFunctions.longOrNull(input) != null, Long::parseLong); + String name = CMD.awaitInput("Введите название:", "Строка не может быть пустой", + input -> true, input -> input.isEmpty() ? null : input); + return new Location(x, y, z, name); + } + + public static Coordinates createCoordinates() { + System.out.println("Создание нового объекта класса Coordinates"); + float x = CMD.awaitInput("Введите x:", "Введите дробное число", + input -> UtilFunctions.floatOrNull(input) != null, Float::parseFloat); + float y = CMD.awaitInput("Введите y:", "Введите дробное число, большее -816", + input -> { + Float result = UtilFunctions.floatOrNull(input); + return result != null && result > -816F; + }, Float::parseFloat); + return new Coordinates(x, y); + } +} diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/PrintFieldDescendingLocationCommand.java b/Lab5Client/src/main/java/client/commandline/pdcommands/PrintFieldDescendingLocationCommand.java new file mode 100644 index 0000000..c98b240 --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/PrintFieldDescendingLocationCommand.java @@ -0,0 +1,16 @@ +package client.commandline.pdcommands; + +import common.commandline.Executables; + +public class PrintFieldDescendingLocationCommand extends PeopleDatabaseCommand { + public PrintFieldDescendingLocationCommand() { + super("print_field_descending_location", false, "print_field_descending_location : вывести значения поля location всех элементов в порядке убывания", + Executables.PRINT_FIELD_DESCENDING_LOCATION.getExecutable()); + } + + @Override + public boolean validate(String[] args) { + this.args = new Object[]{ null }; + return true; + } +} diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/RemoveByIdCommand.java b/Lab5Client/src/main/java/client/commandline/pdcommands/RemoveByIdCommand.java new file mode 100644 index 0000000..d467081 --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/RemoveByIdCommand.java @@ -0,0 +1,21 @@ +package client.commandline.pdcommands; + +import common.commandline.Executables; +import common.util.UtilFunctions; + +public class RemoveByIdCommand extends PeopleDatabaseCommand { + public RemoveByIdCommand() { + super("remove_by_id", false, "remove_by_id {id} : удалить элемент из коллекции по его {id}", + Executables.REMOVE_BY_ID.getExecutable()); + } + + @Override + public boolean validate(String[] args) { + if (PeopleDatabaseCommand.validateIdCommand(args)) { + Long id = UtilFunctions.longOrNull(args[0]); + this.args = new Object[]{ null, id }; + return true; + } + return false; + } +} diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/SaveCommand.java b/Lab5Client/src/main/java/client/commandline/pdcommands/SaveCommand.java new file mode 100644 index 0000000..aca4dab --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/SaveCommand.java @@ -0,0 +1,16 @@ +package client.commandline.pdcommands; + +import common.commandline.Executables; + +public class SaveCommand extends PeopleDatabaseCommand { + public SaveCommand() { + super("save", false, "save : сохранить коллекцию в файл", + Executables.SAVE.getExecutable()); + } + + @Override + public boolean validate(String[] args) { + this.args = new Object[]{ null }; + return true; + } +} diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/ShowCommand.java b/Lab5Client/src/main/java/client/commandline/pdcommands/ShowCommand.java new file mode 100644 index 0000000..a0a6b3d --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/ShowCommand.java @@ -0,0 +1,16 @@ +package client.commandline.pdcommands; + +import common.commandline.Executables; + +public class ShowCommand extends PeopleDatabaseCommand { + public ShowCommand() { + super("show", false, "show : вывести в стандартный поток вывода все элементы коллекции в строковом представлении", + Executables.SHOW.getExecutable()); + } + + @Override + public boolean validate(String[] args) { + this.args = new Object[]{ null }; + return true; + } +} diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/SumOfHeightCommand.java b/Lab5Client/src/main/java/client/commandline/pdcommands/SumOfHeightCommand.java new file mode 100644 index 0000000..c6c923e --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/SumOfHeightCommand.java @@ -0,0 +1,16 @@ +package client.commandline.pdcommands; + +import common.commandline.Executables; + +public class SumOfHeightCommand extends PeopleDatabaseCommand { + public SumOfHeightCommand() { + super("sum_of_height", false, "sum_of_height : вывести сумму значений поля height для всех элементов коллекции", + Executables.SUM_OF_HEIGHT.getExecutable()); + } + + @Override + public boolean validate(String[] args) { + this.args = new Object[]{ null }; + return true; + } +} diff --git a/Lab5Client/src/main/java/client/commandline/pdcommands/UpdateCommand.java b/Lab5Client/src/main/java/client/commandline/pdcommands/UpdateCommand.java new file mode 100644 index 0000000..563bd63 --- /dev/null +++ b/Lab5Client/src/main/java/client/commandline/pdcommands/UpdateCommand.java @@ -0,0 +1,21 @@ +package client.commandline.pdcommands; + +import common.commandline.Executables; +import common.util.UtilFunctions; + +public class UpdateCommand extends PeopleDatabaseCommand { + public UpdateCommand() { + super("update", false, "update {id} : обновить значение элемента коллекции, {id} которого равен заданному", + Executables.UPDATE.getExecutable()); + } + + @Override + public boolean validate(String[] args) { + if (PeopleDatabaseCommand.validateIdCommand(args)) { + Long id = UtilFunctions.longOrNull(args[0]); + this.args = new Object[]{ null, id, PeopleDatabaseCommands.createPerson() }; + return true; + } + return false; + } +} diff --git a/Lab5Client/src/main/java/client/net/UDPClient.java b/Lab5Client/src/main/java/client/net/UDPClient.java new file mode 100644 index 0000000..62a8901 --- /dev/null +++ b/Lab5Client/src/main/java/client/net/UDPClient.java @@ -0,0 +1,82 @@ +package client.net; + +import common.commandline.Executable; +import common.commandline.response.CommandResult; +import common.commandline.response.DefaultResponse; + +import java.io.*; +import java.net.*; + +public class UDPClient { + + private String hostname; + private final int port; + private InetAddress address; + private DatagramSocket socket; + boolean available = false; + + public UDPClient(int port) { + this.port = port; + } + + public UDPClient(String hostname, int port) { + this.hostname = hostname; + this.port = port; + } + + public void connect() { + try { + address = hostname == null ? InetAddress.getLocalHost() : InetAddress.getByName(hostname); + socket = new DatagramSocket(); + socket.setSoTimeout(10000); + available = true; + } catch (UnknownHostException | SocketException e) { + System.err.println("Ошибка при подключении к серверу, хост не найден"); + available = false; + } + } + + public void disconnect() { + if (!available) return; + socket.close(); + available = false; + } + + public CommandResult send(Executable executable, Object[] args) { + if (!available) return new CommandResult(null, DefaultResponse.HOST_NOT_FOUND); + byte[] buffer; + try ( + ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream(); + ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteOutputStream) + ) { + objectOutputStream.writeObject(executable); + objectOutputStream.writeObject(args); + buffer = byteOutputStream.toByteArray(); + DatagramPacket request = new DatagramPacket(buffer, buffer.length, address, port); + socket.send(request); + } catch (IOException e) { + return new CommandResult("Нет ответа от сервера", DefaultResponse.SERVER_ERROR); + } + return receive(); + } + + public CommandResult receive() { + byte[] buffer = new byte[65535]; + DatagramPacket response = new DatagramPacket(buffer, buffer.length); + try (ByteArrayInputStream byteInputStream = new ByteArrayInputStream(buffer)) { + socket.receive(response); + ObjectInputStream objectInputStream = new ObjectInputStream(byteInputStream); + CommandResult result = (CommandResult) objectInputStream.readObject(); + objectInputStream.close(); + return result; + } catch (SocketTimeoutException e) { + return new CommandResult("Сервер не отвечает", DefaultResponse.SERVER_ERROR); + } catch (IOException e) { + return new CommandResult("Нестабильное соединении", DefaultResponse.SERVER_ERROR); + } catch (ClassNotFoundException e) { + return new CommandResult("Не удалось преобразовать результат, не существует нужного класса", DefaultResponse.CLASS_NOT_FOUND); + } catch (ClassCastException e) { + return new CommandResult("Не удалось преобразовать результат, ожидался объект другого типа", DefaultResponse.TYPE_ERROR); + } + } +} diff --git a/Lab5Core/build.gradle.kts b/Lab5Core/build.gradle.kts new file mode 100644 index 0000000..2b5be4e --- /dev/null +++ b/Lab5Core/build.gradle.kts @@ -0,0 +1,29 @@ +plugins { + java +} + +group = "ru.erius.lab5" +version = "2.0" + +repositories { + mavenCentral() +} + +dependencies { + testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") + compileOnly("org.projectlombok:lombok:1.18.22") + annotationProcessor("org.projectlombok:lombok:1.18.22") +} + +tasks.getByName("test") { + useJUnitPlatform() +} + +tasks.compileJava { + options.encoding = "UTF-8" +} + +tasks.javadoc { + options.encoding = "UTF-8" +} diff --git a/Lab5Core/build/classes/java/main/common/collection/Database$DatabaseLoadFailedException.class b/Lab5Core/build/classes/java/main/common/collection/Database$DatabaseLoadFailedException.class new file mode 100644 index 0000000..492ba0a Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/collection/Database$DatabaseLoadFailedException.class differ diff --git a/Lab5Core/build/classes/java/main/common/collection/Database$DatabaseSaveFailedException.class b/Lab5Core/build/classes/java/main/common/collection/Database$DatabaseSaveFailedException.class new file mode 100644 index 0000000..c8f1fe3 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/collection/Database$DatabaseSaveFailedException.class differ diff --git a/Lab5Core/build/classes/java/main/common/collection/Database.class b/Lab5Core/build/classes/java/main/common/collection/Database.class new file mode 100644 index 0000000..8603206 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/collection/Database.class differ diff --git a/Lab5Core/build/classes/java/main/common/collection/PeopleDatabase.class b/Lab5Core/build/classes/java/main/common/collection/PeopleDatabase.class new file mode 100644 index 0000000..946242d Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/collection/PeopleDatabase.class differ diff --git a/Lab5Core/build/classes/java/main/common/commandline/Executable.class b/Lab5Core/build/classes/java/main/common/commandline/Executable.class new file mode 100644 index 0000000..52dda24 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/commandline/Executable.class differ diff --git a/Lab5Core/build/classes/java/main/common/commandline/Executables.class b/Lab5Core/build/classes/java/main/common/commandline/Executables.class new file mode 100644 index 0000000..56c3fca Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/commandline/Executables.class differ diff --git a/Lab5Core/build/classes/java/main/common/commandline/response/CommandResult.class b/Lab5Core/build/classes/java/main/common/commandline/response/CommandResult.class new file mode 100644 index 0000000..7d55a03 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/commandline/response/CommandResult.class differ diff --git a/Lab5Core/build/classes/java/main/common/commandline/response/DefaultResponse.class b/Lab5Core/build/classes/java/main/common/commandline/response/DefaultResponse.class new file mode 100644 index 0000000..38a0803 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/commandline/response/DefaultResponse.class differ diff --git a/Lab5Core/build/classes/java/main/common/commandline/response/PeopleDatabaseResponse.class b/Lab5Core/build/classes/java/main/common/commandline/response/PeopleDatabaseResponse.class new file mode 100644 index 0000000..c956890 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/commandline/response/PeopleDatabaseResponse.class differ diff --git a/Lab5Core/build/classes/java/main/common/commandline/response/Response.class b/Lab5Core/build/classes/java/main/common/commandline/response/Response.class new file mode 100644 index 0000000..4f5dd76 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/commandline/response/Response.class differ diff --git a/Lab5Core/build/classes/java/main/common/data/Color.class b/Lab5Core/build/classes/java/main/common/data/Color.class new file mode 100644 index 0000000..96a17b5 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/data/Color.class differ diff --git a/Lab5Core/build/classes/java/main/common/data/Coordinates.class b/Lab5Core/build/classes/java/main/common/data/Coordinates.class new file mode 100644 index 0000000..95a2996 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/data/Coordinates.class differ diff --git a/Lab5Core/build/classes/java/main/common/data/Country.class b/Lab5Core/build/classes/java/main/common/data/Country.class new file mode 100644 index 0000000..6283421 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/data/Country.class differ diff --git a/Lab5Core/build/classes/java/main/common/data/Location.class b/Lab5Core/build/classes/java/main/common/data/Location.class new file mode 100644 index 0000000..69aefe6 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/data/Location.class differ diff --git a/Lab5Core/build/classes/java/main/common/data/Person.class b/Lab5Core/build/classes/java/main/common/data/Person.class new file mode 100644 index 0000000..39516c3 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/data/Person.class differ diff --git a/Lab5Core/build/classes/java/main/common/parser/Adapters$ColorAdapter.class b/Lab5Core/build/classes/java/main/common/parser/Adapters$ColorAdapter.class new file mode 100644 index 0000000..c627f25 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/parser/Adapters$ColorAdapter.class differ diff --git a/Lab5Core/build/classes/java/main/common/parser/Adapters$CoordinateYAdapter.class b/Lab5Core/build/classes/java/main/common/parser/Adapters$CoordinateYAdapter.class new file mode 100644 index 0000000..5a2dea9 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/parser/Adapters$CoordinateYAdapter.class differ diff --git a/Lab5Core/build/classes/java/main/common/parser/Adapters$CountryAdapter.class b/Lab5Core/build/classes/java/main/common/parser/Adapters$CountryAdapter.class new file mode 100644 index 0000000..a585e91 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/parser/Adapters$CountryAdapter.class differ diff --git a/Lab5Core/build/classes/java/main/common/parser/Adapters$HeightAdapter.class b/Lab5Core/build/classes/java/main/common/parser/Adapters$HeightAdapter.class new file mode 100644 index 0000000..4fec1a6 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/parser/Adapters$HeightAdapter.class differ diff --git a/Lab5Core/build/classes/java/main/common/parser/Adapters$LocalDateAdapter.class b/Lab5Core/build/classes/java/main/common/parser/Adapters$LocalDateAdapter.class new file mode 100644 index 0000000..8d44bb9 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/parser/Adapters$LocalDateAdapter.class differ diff --git a/Lab5Core/build/classes/java/main/common/parser/Adapters$NameAdapter.class b/Lab5Core/build/classes/java/main/common/parser/Adapters$NameAdapter.class new file mode 100644 index 0000000..c39718b Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/parser/Adapters$NameAdapter.class differ diff --git a/Lab5Core/build/classes/java/main/common/parser/Adapters$PassportAdapter.class b/Lab5Core/build/classes/java/main/common/parser/Adapters$PassportAdapter.class new file mode 100644 index 0000000..0e049b7 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/parser/Adapters$PassportAdapter.class differ diff --git a/Lab5Core/build/classes/java/main/common/parser/Adapters.class b/Lab5Core/build/classes/java/main/common/parser/Adapters.class new file mode 100644 index 0000000..9c88fc4 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/parser/Adapters.class differ diff --git a/Lab5Core/build/classes/java/main/common/parser/ConnectionProperties.class b/Lab5Core/build/classes/java/main/common/parser/ConnectionProperties.class new file mode 100644 index 0000000..71b4f31 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/parser/ConnectionProperties.class differ diff --git a/Lab5Core/build/classes/java/main/common/util/UtilFunctions.class b/Lab5Core/build/classes/java/main/common/util/UtilFunctions.class new file mode 100644 index 0000000..6222623 Binary files /dev/null and b/Lab5Core/build/classes/java/main/common/util/UtilFunctions.class differ diff --git a/Lab5Core/build/docs/javadoc/allclasses-frame.html b/Lab5Core/build/docs/javadoc/allclasses-frame.html new file mode 100644 index 0000000..03d1708 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/allclasses-frame.html @@ -0,0 +1,42 @@ + + + + + +All Classes (Lab5Core 2.0 API) + + + + +

All Classes

+ + + diff --git a/Lab5Core/build/docs/javadoc/allclasses-noframe.html b/Lab5Core/build/docs/javadoc/allclasses-noframe.html new file mode 100644 index 0000000..216ac53 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/allclasses-noframe.html @@ -0,0 +1,42 @@ + + + + + +All Classes (Lab5Core 2.0 API) + + + + +

All Classes

+ + + diff --git a/Lab5Core/build/docs/javadoc/common/collection/Database.DatabaseLoadFailedException.html b/Lab5Core/build/docs/javadoc/common/collection/Database.DatabaseLoadFailedException.html new file mode 100644 index 0000000..e962f5b --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/collection/Database.DatabaseLoadFailedException.html @@ -0,0 +1,319 @@ + + + + + +Database.DatabaseLoadFailedException (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.collection
+

Class Database.DatabaseLoadFailedException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • common.collection.Database.DatabaseLoadFailedException
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    Enclosing interface:
    +
    Database
    +
    +
    +
    +
    public static class Database.DatabaseLoadFailedException
    +extends java.lang.Exception
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DatabaseLoadFailedException

        +
        public DatabaseLoadFailedException(java.lang.String message)
        +
      • +
      + + + +
        +
      • +

        DatabaseLoadFailedException

        +
        public DatabaseLoadFailedException(java.lang.String message,
        +                                   java.lang.String path)
        +
      • +
      + + + +
        +
      • +

        DatabaseLoadFailedException

        +
        public DatabaseLoadFailedException(java.lang.String message,
        +                                   java.lang.Throwable cause)
        +
      • +
      + + + +
        +
      • +

        DatabaseLoadFailedException

        +
        public DatabaseLoadFailedException(java.lang.String message,
        +                                   java.lang.String path,
        +                                   java.lang.Throwable cause)
        +
      • +
      + + + +
        +
      • +

        DatabaseLoadFailedException

        +
        public DatabaseLoadFailedException(java.lang.Throwable cause)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/collection/Database.DatabaseSaveFailedException.html b/Lab5Core/build/docs/javadoc/common/collection/Database.DatabaseSaveFailedException.html new file mode 100644 index 0000000..f52abaf --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/collection/Database.DatabaseSaveFailedException.html @@ -0,0 +1,319 @@ + + + + + +Database.DatabaseSaveFailedException (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.collection
+

Class Database.DatabaseSaveFailedException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • common.collection.Database.DatabaseSaveFailedException
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    Enclosing interface:
    +
    Database
    +
    +
    +
    +
    public static class Database.DatabaseSaveFailedException
    +extends java.lang.Exception
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DatabaseSaveFailedException

        +
        public DatabaseSaveFailedException(java.lang.String message)
        +
      • +
      + + + +
        +
      • +

        DatabaseSaveFailedException

        +
        public DatabaseSaveFailedException(java.lang.String message,
        +                                   java.lang.String path)
        +
      • +
      + + + +
        +
      • +

        DatabaseSaveFailedException

        +
        public DatabaseSaveFailedException(java.lang.String message,
        +                                   java.lang.Throwable cause)
        +
      • +
      + + + +
        +
      • +

        DatabaseSaveFailedException

        +
        public DatabaseSaveFailedException(java.lang.String message,
        +                                   java.lang.String path,
        +                                   java.lang.Throwable cause)
        +
      • +
      + + + +
        +
      • +

        DatabaseSaveFailedException

        +
        public DatabaseSaveFailedException(java.lang.Throwable cause)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/collection/Database.html b/Lab5Core/build/docs/javadoc/common/collection/Database.html new file mode 100644 index 0000000..3fece58 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/collection/Database.html @@ -0,0 +1,269 @@ + + + + + +Database (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.collection
+

Interface Database

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    PeopleDatabase
    +
    +
    +
    +
    public interface Database
    +
    Интерфейс баз данных с методами load() и save()
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/collection/PeopleDatabase.html b/Lab5Core/build/docs/javadoc/common/collection/PeopleDatabase.html new file mode 100644 index 0000000..8e53de7 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/collection/PeopleDatabase.html @@ -0,0 +1,363 @@ + + + + + +PeopleDatabase (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.collection
+

Class PeopleDatabase

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • common.collection.PeopleDatabase
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Database
    +
    +
    +
    +
    public class PeopleDatabase
    +extends java.lang.Object
    +implements Database
    +
    Класс базы данных людей, реализующий интерфейс Database
    +
    +
    See Also:
    +
    Database
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      PeopleDatabase(java.util.logging.Logger logger) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.Stringinfo() 
      voidload() +
      Метод, инициализирующий базу данных из файла, находящемся по пути, указанном в + переменной окружения ENV_VAR
      +
      voidsave() +
      Метод, сохраняющий базу данных в файл, находящемся по пути, указанном в + переменной окружения ENV_VAR
      +
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PeopleDatabase

        +
        public PeopleDatabase(java.util.logging.Logger logger)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        info

        +
        public java.lang.String info()
        +
      • +
      + + + +
        +
      • +

        load

        +
        public void load()
        +          throws Database.DatabaseLoadFailedException
        +
        Метод, инициализирующий базу данных из файла, находящемся по пути, указанном в + переменной окружения ENV_VAR
        +
        +
        Specified by:
        +
        load in interface Database
        +
        Throws:
        +
        Database.DatabaseLoadFailedException - если переменная окружения ENV_VAR не задана, + файла не существует, либо отсутствуют права на запись или чтение
        +
        +
      • +
      + + + +
        +
      • +

        save

        +
        public void save()
        +          throws Database.DatabaseSaveFailedException
        +
        Метод, сохраняющий базу данных в файл, находящемся по пути, указанном в + переменной окружения ENV_VAR
        +
        +
        Specified by:
        +
        save in interface Database
        +
        Throws:
        +
        Database.DatabaseSaveFailedException - если переменная окружения ENV_VAR не задана, + файла не существует, либо отсутствуют права на запись или чтение, или если структура xml файла + была каким-либо образом нарушена
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/collection/package-frame.html b/Lab5Core/build/docs/javadoc/common/collection/package-frame.html new file mode 100644 index 0000000..6eb7126 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/collection/package-frame.html @@ -0,0 +1,28 @@ + + + + + +common.collection (Lab5Core 2.0 API) + + + + +

common.collection

+ + + diff --git a/Lab5Core/build/docs/javadoc/common/collection/package-summary.html b/Lab5Core/build/docs/javadoc/common/collection/package-summary.html new file mode 100644 index 0000000..b7745b7 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/collection/package-summary.html @@ -0,0 +1,177 @@ + + + + + +common.collection (Lab5Core 2.0 API) + + + + + + + + + + +
+

Package common.collection

+
+
+ +
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/collection/package-tree.html b/Lab5Core/build/docs/javadoc/common/collection/package-tree.html new file mode 100644 index 0000000..ec9297d --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/collection/package-tree.html @@ -0,0 +1,148 @@ + + + + + +common.collection Class Hierarchy (Lab5Core 2.0 API) + + + + + + + + + + +
+

Hierarchy For Package common.collection

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/commandline/Executable.html b/Lab5Core/build/docs/javadoc/common/commandline/Executable.html new file mode 100644 index 0000000..b3474e6 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/commandline/Executable.html @@ -0,0 +1,228 @@ + + + + + +Executable (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.commandline
+

Interface Executable

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    java.io.Serializable
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @FunctionalInterface
    +public interface Executable
    +extends java.io.Serializable
    +
  • +
+
+
+ +
+
+
    +
  • + + +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/commandline/Executables.html b/Lab5Core/build/docs/javadoc/common/commandline/Executables.html new file mode 100644 index 0000000..d675b32 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/commandline/Executables.html @@ -0,0 +1,471 @@ + + + + + +Executables (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.commandline
+

Enum Executables

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<Executables>
    • +
    • +
        +
      • common.commandline.Executables
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<Executables>
    +
    +
    +
    +
    public enum Executables
    +extends java.lang.Enum<Executables>
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Executables[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Executables c : Executables.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Executables valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getExecutable

        +
        public Executable getExecutable()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/commandline/package-frame.html b/Lab5Core/build/docs/javadoc/common/commandline/package-frame.html new file mode 100644 index 0000000..0157f03 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/commandline/package-frame.html @@ -0,0 +1,23 @@ + + + + + +common.commandline (Lab5Core 2.0 API) + + + + +

common.commandline

+
+

Interfaces

+ +

Enums

+ +
+ + diff --git a/Lab5Core/build/docs/javadoc/common/commandline/package-summary.html b/Lab5Core/build/docs/javadoc/common/commandline/package-summary.html new file mode 100644 index 0000000..3641aac --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/commandline/package-summary.html @@ -0,0 +1,154 @@ + + + + + +common.commandline (Lab5Core 2.0 API) + + + + + + + + + + +
+

Package common.commandline

+
+
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    Executable 
    +
  • +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    Executables 
    +
  • +
+
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/commandline/package-tree.html b/Lab5Core/build/docs/javadoc/common/commandline/package-tree.html new file mode 100644 index 0000000..3d0de5f --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/commandline/package-tree.html @@ -0,0 +1,146 @@ + + + + + +common.commandline Class Hierarchy (Lab5Core 2.0 API) + + + + + + + + + + +
+

Hierarchy For Package common.commandline

+Package Hierarchies: + +
+
+

Interface Hierarchy

+
    +
  • java.io.Serializable + +
  • +
+

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    • +
    +
  • +
+
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/commandline/response/CommandResult.html b/Lab5Core/build/docs/javadoc/common/commandline/response/CommandResult.html new file mode 100644 index 0000000..3144195 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/commandline/response/CommandResult.html @@ -0,0 +1,292 @@ + + + + + +CommandResult (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.commandline.response
+

Class CommandResult

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • common.commandline.response.CommandResult
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    public class CommandResult
    +extends java.lang.Object
    +implements java.io.Serializable
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      CommandResult(java.lang.String value, + Response response) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      ResponsegetResponse() 
      java.lang.StringgetValue() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CommandResult

        +
        public CommandResult(java.lang.String value,
        +                     Response response)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getValue

        +
        public java.lang.String getValue()
        +
      • +
      + + + +
        +
      • +

        getResponse

        +
        public Response getResponse()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/commandline/response/DefaultResponse.html b/Lab5Core/build/docs/javadoc/common/commandline/response/DefaultResponse.html new file mode 100644 index 0000000..d157cf4 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/commandline/response/DefaultResponse.html @@ -0,0 +1,428 @@ + + + + + +DefaultResponse (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.commandline.response
+

Enum DefaultResponse

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<DefaultResponse>
    • +
    • +
        +
      • common.commandline.response.DefaultResponse
      • +
      +
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static DefaultResponse[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (DefaultResponse c : DefaultResponse.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static DefaultResponse valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getMsg

        +
        public java.lang.String getMsg()
        +
        +
        Specified by:
        +
        getMsg in interface Response
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/commandline/response/PeopleDatabaseResponse.html b/Lab5Core/build/docs/javadoc/common/commandline/response/PeopleDatabaseResponse.html new file mode 100644 index 0000000..916834c --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/commandline/response/PeopleDatabaseResponse.html @@ -0,0 +1,368 @@ + + + + + +PeopleDatabaseResponse (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.commandline.response
+

Enum PeopleDatabaseResponse

+
+
+
    +
  • java.lang.Object
  • +
  • + +
  • +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.StringgetMsg() 
      static PeopleDatabaseResponsevalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static PeopleDatabaseResponse[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static PeopleDatabaseResponse[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (PeopleDatabaseResponse c : PeopleDatabaseResponse.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static PeopleDatabaseResponse valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getMsg

        +
        public java.lang.String getMsg()
        +
        +
        Specified by:
        +
        getMsg in interface Response
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/commandline/response/Response.html b/Lab5Core/build/docs/javadoc/common/commandline/response/Response.html new file mode 100644 index 0000000..43a1ac9 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/commandline/response/Response.html @@ -0,0 +1,227 @@ + + + + + +Response (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.commandline.response
+

Interface Response

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    java.io.Serializable
    +
    +
    +
    All Known Implementing Classes:
    +
    DefaultResponse, PeopleDatabaseResponse
    +
    +
    +
    +
    public interface Response
    +extends java.io.Serializable
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getMsg

        +
        java.lang.String getMsg()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/commandline/response/package-frame.html b/Lab5Core/build/docs/javadoc/common/commandline/response/package-frame.html new file mode 100644 index 0000000..92c3609 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/commandline/response/package-frame.html @@ -0,0 +1,28 @@ + + + + + +common.commandline.response (Lab5Core 2.0 API) + + + + +

common.commandline.response

+
+

Interfaces

+ +

Classes

+ +

Enums

+ +
+ + diff --git a/Lab5Core/build/docs/javadoc/common/commandline/response/package-summary.html b/Lab5Core/build/docs/javadoc/common/commandline/response/package-summary.html new file mode 100644 index 0000000..fc4f3b2 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/commandline/response/package-summary.html @@ -0,0 +1,173 @@ + + + + + +common.commandline.response (Lab5Core 2.0 API) + + + + + + + + + + +
+

Package common.commandline.response

+
+
+ +
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/commandline/response/package-tree.html b/Lab5Core/build/docs/javadoc/common/commandline/response/package-tree.html new file mode 100644 index 0000000..b69fa75 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/commandline/response/package-tree.html @@ -0,0 +1,155 @@ + + + + + +common.commandline.response Class Hierarchy (Lab5Core 2.0 API) + + + + + + + + + + +
+

Hierarchy For Package common.commandline.response

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • common.commandline.response.CommandResult (implements java.io.Serializable)
    • +
    +
  • +
+

Interface Hierarchy

+
    +
  • java.io.Serializable +
      +
    • common.commandline.response.Response
    • +
    +
  • +
+

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    • +
    +
  • +
+
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/data/Color.html b/Lab5Core/build/docs/javadoc/common/data/Color.html new file mode 100644 index 0000000..6edb537 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/data/Color.html @@ -0,0 +1,352 @@ + + + + + +Color (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.data
+

Enum Color

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<Color>
    • +
    • +
        +
      • common.data.Color
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<Color>
    +
    +
    +
    +
    public enum Color
    +extends java.lang.Enum<Color>
    +implements java.io.Serializable
    +
    Перечисление цветов
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      BLACK 
      BROWN 
      ORANGE 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static ColorvalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static Color[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        BLACK

        +
        public static final Color BLACK
        +
      • +
      + + + +
        +
      • +

        ORANGE

        +
        public static final Color ORANGE
        +
      • +
      + + + +
        +
      • +

        BROWN

        +
        public static final Color BROWN
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Color[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Color c : Color.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Color valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/data/Coordinates.html b/Lab5Core/build/docs/javadoc/common/data/Coordinates.html new file mode 100644 index 0000000..d9bced5 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/data/Coordinates.html @@ -0,0 +1,312 @@ + + + + + +Coordinates (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.data
+

Class Coordinates

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • common.data.Coordinates
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<Coordinates>
    +
    +
    +
    +
    public class Coordinates
    +extends java.lang.Object
    +implements java.lang.Comparable<Coordinates>, java.io.Serializable
    +
    Класс данных координат
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Coordinates(float x, + float y) +
      Конструктор с параметрами
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      intcompareTo(Coordinates other) 
      voidsetY(float y) +
      Сеттер для поля y
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Coordinates

        +
        public Coordinates(float x,
        +                   float y)
        +
        Конструктор с параметрами
        +
        +
        Parameters:
        +
        x - Координата X
        +
        y - Координата Y
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setY

        +
        public void setY(float y)
        +
        Сеттер для поля y
        +
        +
        Parameters:
        +
        y - Координата Y
        +
        +
      • +
      + + + +
        +
      • +

        compareTo

        +
        public int compareTo(Coordinates other)
        +
        +
        Specified by:
        +
        compareTo in interface java.lang.Comparable<Coordinates>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/data/Country.html b/Lab5Core/build/docs/javadoc/common/data/Country.html new file mode 100644 index 0000000..1b84ff8 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/data/Country.html @@ -0,0 +1,376 @@ + + + + + +Country (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.data
+

Enum Country

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<Country>
    • +
    • +
        +
      • common.data.Country
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<Country>
    +
    +
    +
    +
    public enum Country
    +extends java.lang.Enum<Country>
    +implements java.io.Serializable
    +
    Перечисление стран
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static CountryvalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static Country[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        UNITED_KINGDOM

        +
        public static final Country UNITED_KINGDOM
        +
      • +
      + + + +
        +
      • +

        GERMANY

        +
        public static final Country GERMANY
        +
      • +
      + + + +
        +
      • +

        CHINA

        +
        public static final Country CHINA
        +
      • +
      + + + +
        +
      • +

        THAILAND

        +
        public static final Country THAILAND
        +
      • +
      + + + +
        +
      • +

        JAPAN

        +
        public static final Country JAPAN
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Country[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Country c : Country.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Country valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/data/Location.html b/Lab5Core/build/docs/javadoc/common/data/Location.html new file mode 100644 index 0000000..7354ccc --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/data/Location.html @@ -0,0 +1,330 @@ + + + + + +Location (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.data
+

Class Location

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • common.data.Location
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<Location>
    +
    +
    +
    +
    public class Location
    +extends java.lang.Object
    +implements java.lang.Comparable<Location>, java.io.Serializable
    +
    Класс данных местоположения, реализует сортировку по умолчанию + по имени и расстоянию до точки (0; 0; 0)
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Location(double x, + float y, + long z, + java.lang.String name) +
      Конструктор с параметрами
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      intcompareTo(Location other) +
      Переопределенный метод сравнения двух местоположений, + сравнение производится по имени локации и расстоянию до точки (0; 0; 0)
      +
      voidsetName(java.lang.String name) +
      Сеттер для поля name
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Location

        +
        public Location(double x,
        +                float y,
        +                long z,
        +                java.lang.String name)
        +
        Конструктор с параметрами
        +
        +
        Parameters:
        +
        x - Координата X
        +
        y - Координата Y
        +
        z - Координата Z
        +
        name - Имя локации
        +
        Throws:
        +
        java.lang.NullPointerException - будет брошено в случае, если Z является null
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setName

        +
        public void setName(java.lang.String name)
        +
        Сеттер для поля name
        +
        +
        Parameters:
        +
        name - Имя локации
        +
        +
      • +
      + + + +
        +
      • +

        compareTo

        +
        public int compareTo(Location other)
        +
        Переопределенный метод сравнения двух местоположений, + сравнение производится по имени локации и расстоянию до точки (0; 0; 0)
        +
        +
        Specified by:
        +
        compareTo in interface java.lang.Comparable<Location>
        +
        Parameters:
        +
        other - Объект для сравнения
        +
        Returns:
        +
        Целое число - результат сравнения
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/data/Person.html b/Lab5Core/build/docs/javadoc/common/data/Person.html new file mode 100644 index 0000000..d3e7778 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/data/Person.html @@ -0,0 +1,420 @@ + + + + + +Person (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.data
+

Class Person

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • common.data.Person
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<Person>
    +
    +
    +
    +
    public class Person
    +extends java.lang.Object
    +implements java.lang.Comparable<Person>, java.io.Serializable
    +
    Класс данных человека, реализует сортировку по умолчанию по имени, номеру паспорта, + росту, национальности, местоположению и цвету глаз
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Person(@NonNull java.lang.String name, + @NonNull Coordinates coordinates, + java.lang.Integer height, + java.lang.String passportID, + @NonNull Color eyeColor, + @NonNull Country nationality, + Location location) +
      Конструктор с параметрами
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      intcompareTo(Person other) +
      Переопределенный метод сравнения двух людей, + сравнение производится по имени, номеру паспорта, + росту, национальности, местоположению и цвету глаз
      +
      java.lang.Stringformatted() 
      voidsetHeight(java.lang.Integer height) +
      Сеттер для поля height
      +
      voidsetName(java.lang.String name) +
      Сеттер для поля name
      +
      voidsetPassportID(java.lang.String passportID) +
      Сеттер для поля passportID
      +
      voidupdate(Person newPerson) +
      Метод, меняющий все значения полей человека (кроме id и creationDate) в соответствии + со значениями полей другого
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Person

        +
        public Person(@NonNull
        +              @NonNull java.lang.String name,
        +              @NonNull
        +              @NonNull Coordinates coordinates,
        +              java.lang.Integer height,
        +              java.lang.String passportID,
        +              @NonNull
        +              @NonNull Color eyeColor,
        +              @NonNull
        +              @NonNull Country nationality,
        +              Location location)
        +
        Конструктор с параметрами
        +
        +
        Parameters:
        +
        name - Имя человека
        +
        coordinates - Координаты человека
        +
        height - Высота человека
        +
        passportID - Номер паспорта человека
        +
        eyeColor - Цвет глаз человека
        +
        nationality - Национальность человека
        +
        location - Местоположение человека
        +
        Throws:
        +
        java.lang.NullPointerException - Если name, coordinates, eyeColor или nationality являются null
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        update

        +
        public void update(Person newPerson)
        +
        Метод, меняющий все значения полей человека (кроме id и creationDate) в соответствии + со значениями полей другого
        +
        +
        Parameters:
        +
        newPerson - человек, чьи поля будут присвоены текущему
        +
        +
      • +
      + + + +
        +
      • +

        setName

        +
        public void setName(java.lang.String name)
        +
        Сеттер для поля name
        +
        +
        Parameters:
        +
        name - Имя человека
        +
        +
      • +
      + + + +
        +
      • +

        setHeight

        +
        public void setHeight(java.lang.Integer height)
        +
        Сеттер для поля height
        +
        +
        Parameters:
        +
        height - Рост человека
        +
        +
      • +
      + + + +
        +
      • +

        setPassportID

        +
        public void setPassportID(java.lang.String passportID)
        +
        Сеттер для поля passportID
        +
        +
        Parameters:
        +
        passportID - Номер паспорта человека
        +
        +
      • +
      + + + +
        +
      • +

        formatted

        +
        public java.lang.String formatted()
        +
      • +
      + + + +
        +
      • +

        compareTo

        +
        public int compareTo(Person other)
        +
        Переопределенный метод сравнения двух людей, + сравнение производится по имени, номеру паспорта, + росту, национальности, местоположению и цвету глаз
        +
        +
        Specified by:
        +
        compareTo in interface java.lang.Comparable<Person>
        +
        Parameters:
        +
        other - Объект для сравнения
        +
        Returns:
        +
        Целое число - результат сравнения
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/data/package-frame.html b/Lab5Core/build/docs/javadoc/common/data/package-frame.html new file mode 100644 index 0000000..c161a63 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/data/package-frame.html @@ -0,0 +1,26 @@ + + + + + +common.data (Lab5Core 2.0 API) + + + + +

common.data

+
+

Classes

+ +

Enums

+ +
+ + diff --git a/Lab5Core/build/docs/javadoc/common/data/package-summary.html b/Lab5Core/build/docs/javadoc/common/data/package-summary.html new file mode 100644 index 0000000..9209a7b --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/data/package-summary.html @@ -0,0 +1,178 @@ + + + + + +common.data (Lab5Core 2.0 API) + + + + + + + + + + +
+

Package common.data

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Coordinates +
    Класс данных координат
    +
    Location +
    Класс данных местоположения, реализует сортировку по умолчанию + по имени и расстоянию до точки (0; 0; 0)
    +
    Person +
    Класс данных человека, реализует сортировку по умолчанию по имени, номеру паспорта, + росту, национальности, местоположению и цвету глаз
    +
    +
  • +
  • + + + + + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    Color +
    Перечисление цветов
    +
    Country +
    Перечисление стран
    +
    +
  • +
+
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/data/package-tree.html b/Lab5Core/build/docs/javadoc/common/data/package-tree.html new file mode 100644 index 0000000..af23486 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/data/package-tree.html @@ -0,0 +1,149 @@ + + + + + +common.data Class Hierarchy (Lab5Core 2.0 API) + + + + + + + + + + +
+

Hierarchy For Package common.data

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • common.data.Coordinates (implements java.lang.Comparable<T>, java.io.Serializable)
    • +
    • common.data.Location (implements java.lang.Comparable<T>, java.io.Serializable)
    • +
    • common.data.Person (implements java.lang.Comparable<T>, java.io.Serializable)
    • +
    +
  • +
+

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) +
        +
      • common.data.Country (implements java.io.Serializable)
      • +
      • common.data.Color (implements java.io.Serializable)
      • +
      +
    • +
    +
  • +
+
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/parser/Adapters.ColorAdapter.html b/Lab5Core/build/docs/javadoc/common/parser/Adapters.ColorAdapter.html new file mode 100644 index 0000000..6c58592 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/parser/Adapters.ColorAdapter.html @@ -0,0 +1,304 @@ + + + + + +Adapters.ColorAdapter (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.parser
+

Class Adapters.ColorAdapter

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,Color>
    • +
    • +
        +
      • common.parser.Adapters.ColorAdapter
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    Enclosing class:
    +
    Adapters
    +
    +
    +
    +
    public static class Adapters.ColorAdapter
    +extends javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,Color>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      ColorAdapter() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.Stringmarshal(Color v) 
      Colorunmarshal(java.lang.String v) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ColorAdapter

        +
        public ColorAdapter()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        unmarshal

        +
        public Color unmarshal(java.lang.String v)
        +                throws java.lang.Exception
        +
        +
        Specified by:
        +
        unmarshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,Color>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        marshal

        +
        public java.lang.String marshal(Color v)
        +                         throws java.lang.Exception
        +
        +
        Specified by:
        +
        marshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,Color>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/parser/Adapters.CoordinateYAdapter.html b/Lab5Core/build/docs/javadoc/common/parser/Adapters.CoordinateYAdapter.html new file mode 100644 index 0000000..d1bee3c --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/parser/Adapters.CoordinateYAdapter.html @@ -0,0 +1,304 @@ + + + + + +Adapters.CoordinateYAdapter (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.parser
+

Class Adapters.CoordinateYAdapter

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.Float>
    • +
    • +
        +
      • common.parser.Adapters.CoordinateYAdapter
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    Enclosing class:
    +
    Adapters
    +
    +
    +
    +
    public static class Adapters.CoordinateYAdapter
    +extends javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.Float>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      CoordinateYAdapter() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.Stringmarshal(java.lang.Float v) 
      java.lang.Floatunmarshal(java.lang.String v) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CoordinateYAdapter

        +
        public CoordinateYAdapter()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        unmarshal

        +
        public java.lang.Float unmarshal(java.lang.String v)
        +                          throws java.lang.Exception
        +
        +
        Specified by:
        +
        unmarshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.Float>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        marshal

        +
        public java.lang.String marshal(java.lang.Float v)
        +                         throws java.lang.Exception
        +
        +
        Specified by:
        +
        marshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.Float>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/parser/Adapters.CountryAdapter.html b/Lab5Core/build/docs/javadoc/common/parser/Adapters.CountryAdapter.html new file mode 100644 index 0000000..0baaefb --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/parser/Adapters.CountryAdapter.html @@ -0,0 +1,304 @@ + + + + + +Adapters.CountryAdapter (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.parser
+

Class Adapters.CountryAdapter

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,Country>
    • +
    • +
        +
      • common.parser.Adapters.CountryAdapter
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    Enclosing class:
    +
    Adapters
    +
    +
    +
    +
    public static class Adapters.CountryAdapter
    +extends javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,Country>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      CountryAdapter() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.Stringmarshal(Country v) 
      Countryunmarshal(java.lang.String v) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CountryAdapter

        +
        public CountryAdapter()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        unmarshal

        +
        public Country unmarshal(java.lang.String v)
        +                  throws java.lang.Exception
        +
        +
        Specified by:
        +
        unmarshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,Country>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        marshal

        +
        public java.lang.String marshal(Country v)
        +                         throws java.lang.Exception
        +
        +
        Specified by:
        +
        marshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,Country>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/parser/Adapters.HeightAdapter.html b/Lab5Core/build/docs/javadoc/common/parser/Adapters.HeightAdapter.html new file mode 100644 index 0000000..94ef19a --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/parser/Adapters.HeightAdapter.html @@ -0,0 +1,304 @@ + + + + + +Adapters.HeightAdapter (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.parser
+

Class Adapters.HeightAdapter

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.Integer>
    • +
    • +
        +
      • common.parser.Adapters.HeightAdapter
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    Enclosing class:
    +
    Adapters
    +
    +
    +
    +
    public static class Adapters.HeightAdapter
    +extends javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.Integer>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      HeightAdapter() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.Stringmarshal(java.lang.Integer v) 
      java.lang.Integerunmarshal(java.lang.String v) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HeightAdapter

        +
        public HeightAdapter()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        unmarshal

        +
        public java.lang.Integer unmarshal(java.lang.String v)
        +                            throws java.lang.Exception
        +
        +
        Specified by:
        +
        unmarshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.Integer>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        marshal

        +
        public java.lang.String marshal(java.lang.Integer v)
        +                         throws java.lang.Exception
        +
        +
        Specified by:
        +
        marshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.Integer>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/parser/Adapters.LocalDateAdapter.html b/Lab5Core/build/docs/javadoc/common/parser/Adapters.LocalDateAdapter.html new file mode 100644 index 0000000..8dbd1d1 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/parser/Adapters.LocalDateAdapter.html @@ -0,0 +1,304 @@ + + + + + +Adapters.LocalDateAdapter (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.parser
+

Class Adapters.LocalDateAdapter

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.time.LocalDate>
    • +
    • +
        +
      • common.parser.Adapters.LocalDateAdapter
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    Enclosing class:
    +
    Adapters
    +
    +
    +
    +
    public static class Adapters.LocalDateAdapter
    +extends javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.time.LocalDate>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      LocalDateAdapter() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.Stringmarshal(java.time.LocalDate v) 
      java.time.LocalDateunmarshal(java.lang.String v) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        LocalDateAdapter

        +
        public LocalDateAdapter()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        unmarshal

        +
        public java.time.LocalDate unmarshal(java.lang.String v)
        +                              throws java.lang.Exception
        +
        +
        Specified by:
        +
        unmarshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.time.LocalDate>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        marshal

        +
        public java.lang.String marshal(java.time.LocalDate v)
        +                         throws java.lang.Exception
        +
        +
        Specified by:
        +
        marshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.time.LocalDate>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/parser/Adapters.NameAdapter.html b/Lab5Core/build/docs/javadoc/common/parser/Adapters.NameAdapter.html new file mode 100644 index 0000000..fa07140 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/parser/Adapters.NameAdapter.html @@ -0,0 +1,304 @@ + + + + + +Adapters.NameAdapter (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.parser
+

Class Adapters.NameAdapter

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.String>
    • +
    • +
        +
      • common.parser.Adapters.NameAdapter
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    Enclosing class:
    +
    Adapters
    +
    +
    +
    +
    public static class Adapters.NameAdapter
    +extends javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.String>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      NameAdapter() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.Stringmarshal(java.lang.String v) 
      java.lang.Stringunmarshal(java.lang.String v) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        NameAdapter

        +
        public NameAdapter()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        unmarshal

        +
        public java.lang.String unmarshal(java.lang.String v)
        +                           throws java.lang.Exception
        +
        +
        Specified by:
        +
        unmarshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.String>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        marshal

        +
        public java.lang.String marshal(java.lang.String v)
        +                         throws java.lang.Exception
        +
        +
        Specified by:
        +
        marshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.String>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/parser/Adapters.PassportAdapter.html b/Lab5Core/build/docs/javadoc/common/parser/Adapters.PassportAdapter.html new file mode 100644 index 0000000..359f422 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/parser/Adapters.PassportAdapter.html @@ -0,0 +1,304 @@ + + + + + +Adapters.PassportAdapter (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.parser
+

Class Adapters.PassportAdapter

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.String>
    • +
    • +
        +
      • common.parser.Adapters.PassportAdapter
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    Enclosing class:
    +
    Adapters
    +
    +
    +
    +
    public static class Adapters.PassportAdapter
    +extends javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.String>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      PassportAdapter() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.Stringmarshal(java.lang.String v) 
      java.lang.Stringunmarshal(java.lang.String v) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PassportAdapter

        +
        public PassportAdapter()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        unmarshal

        +
        public java.lang.String unmarshal(java.lang.String v)
        +                           throws java.lang.Exception
        +
        +
        Specified by:
        +
        unmarshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.String>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        marshal

        +
        public java.lang.String marshal(java.lang.String v)
        +                         throws java.lang.Exception
        +
        +
        Specified by:
        +
        marshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.String>
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/parser/Adapters.html b/Lab5Core/build/docs/javadoc/common/parser/Adapters.html new file mode 100644 index 0000000..08cff8a --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/parser/Adapters.html @@ -0,0 +1,433 @@ + + + + + +Adapters (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.parser
+

Class Adapters

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • common.parser.Adapters
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class Adapters
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        DEFAULT_DATE

        +
        public static final java.time.LocalDate DEFAULT_DATE
        +
      • +
      + + + + + + + +
        +
      • +

        DEFAULT_COLOR

        +
        public static final Color DEFAULT_COLOR
        +
      • +
      + + + +
        +
      • +

        DEFAULT_COUNTRY

        +
        public static final Country DEFAULT_COUNTRY
        +
      • +
      + + + +
        +
      • +

        DEFAULT_NAME

        +
        public static final java.lang.String DEFAULT_NAME
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        DEFAULT_PASSPORT

        +
        public static final java.lang.String DEFAULT_PASSPORT
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        DEFAULT_COORDINATE

        +
        public static final int DEFAULT_COORDINATE
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        DEFAULT_COORDINATES

        +
        public static final Coordinates DEFAULT_COORDINATES
        +
      • +
      + + + +
        +
      • +

        DEFAULT_LOCATION

        +
        public static final Location DEFAULT_LOCATION
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Adapters

        +
        public Adapters()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/parser/ConnectionProperties.html b/Lab5Core/build/docs/javadoc/common/parser/ConnectionProperties.html new file mode 100644 index 0000000..d5b9365 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/parser/ConnectionProperties.html @@ -0,0 +1,281 @@ + + + + + +ConnectionProperties (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.parser
+

Class ConnectionProperties

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • common.parser.ConnectionProperties
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class ConnectionProperties
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static java.lang.StringgetHostname() 
      static intgetPort() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ConnectionProperties

        +
        public ConnectionProperties()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getHostname

        +
        public static java.lang.String getHostname()
        +
      • +
      + + + +
        +
      • +

        getPort

        +
        public static int getPort()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/parser/package-frame.html b/Lab5Core/build/docs/javadoc/common/parser/package-frame.html new file mode 100644 index 0000000..2def28f --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/parser/package-frame.html @@ -0,0 +1,27 @@ + + + + + +common.parser (Lab5Core 2.0 API) + + + + +

common.parser

+ + + diff --git a/Lab5Core/build/docs/javadoc/common/parser/package-summary.html b/Lab5Core/build/docs/javadoc/common/parser/package-summary.html new file mode 100644 index 0000000..7873591 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/parser/package-summary.html @@ -0,0 +1,171 @@ + + + + + +common.parser (Lab5Core 2.0 API) + + + + + + + + + + +
+

Package common.parser

+
+
+ +
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/parser/package-tree.html b/Lab5Core/build/docs/javadoc/common/parser/package-tree.html new file mode 100644 index 0000000..be4787c --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/parser/package-tree.html @@ -0,0 +1,146 @@ + + + + + +common.parser Class Hierarchy (Lab5Core 2.0 API) + + + + + + + + + + +
+

Hierarchy For Package common.parser

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/util/UtilFunctions.html b/Lab5Core/build/docs/javadoc/common/util/UtilFunctions.html new file mode 100644 index 0000000..4201da6 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/util/UtilFunctions.html @@ -0,0 +1,289 @@ + + + + + +UtilFunctions (Lab5Core 2.0 API) + + + + + + + + + + + +
+
common.util
+

Class UtilFunctions

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • common.util.UtilFunctions
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class UtilFunctions
    +extends java.lang.Object
    +
    Класс функций-утилит для избавления от повторяющихся участков кода и выноса их в методы для общего пользования
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static java.lang.DoubledoubleOrNull(java.lang.String number) 
      static <T extends java.lang.Enum<T>>
      T
      enumOrNull(java.lang.String value, + java.lang.Class<T> enumType) 
      static java.lang.FloatfloatOrNull(java.lang.String number) 
      static java.lang.IntegerintOrNull(java.lang.String number) 
      static java.lang.LonglongOrNull(java.lang.String number) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        intOrNull

        +
        public static java.lang.Integer intOrNull(java.lang.String number)
        +
      • +
      + + + +
        +
      • +

        longOrNull

        +
        public static java.lang.Long longOrNull(java.lang.String number)
        +
      • +
      + + + +
        +
      • +

        floatOrNull

        +
        public static java.lang.Float floatOrNull(java.lang.String number)
        +
      • +
      + + + +
        +
      • +

        doubleOrNull

        +
        public static java.lang.Double doubleOrNull(java.lang.String number)
        +
      • +
      + + + +
        +
      • +

        enumOrNull

        +
        public static <T extends java.lang.Enum<T>> T enumOrNull(java.lang.String value,
        +                                                         java.lang.Class<T> enumType)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/util/package-frame.html b/Lab5Core/build/docs/javadoc/common/util/package-frame.html new file mode 100644 index 0000000..fad8071 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/util/package-frame.html @@ -0,0 +1,19 @@ + + + + + +common.util (Lab5Core 2.0 API) + + + + +

common.util

+
+

Classes

+ +
+ + diff --git a/Lab5Core/build/docs/javadoc/common/util/package-summary.html b/Lab5Core/build/docs/javadoc/common/util/package-summary.html new file mode 100644 index 0000000..1893357 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/util/package-summary.html @@ -0,0 +1,141 @@ + + + + + +common.util (Lab5Core 2.0 API) + + + + + + + + + + +
+

Package common.util

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    UtilFunctions +
    Класс функций-утилит для избавления от повторяющихся участков кода и выноса их в методы для общего пользования
    +
    +
  • +
+
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/common/util/package-tree.html b/Lab5Core/build/docs/javadoc/common/util/package-tree.html new file mode 100644 index 0000000..0925422 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/common/util/package-tree.html @@ -0,0 +1,134 @@ + + + + + +common.util Class Hierarchy (Lab5Core 2.0 API) + + + + + + + + + + +
+

Hierarchy For Package common.util

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/constant-values.html b/Lab5Core/build/docs/javadoc/constant-values.html new file mode 100644 index 0000000..346777b --- /dev/null +++ b/Lab5Core/build/docs/javadoc/constant-values.html @@ -0,0 +1,171 @@ + + + + + +Constant Field Values (Lab5Core 2.0 API) + + + + + + + + + + +
+

Constant Field Values

+

Contents

+ +
+
+ + +

common.parser.*

+ +
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/deprecated-list.html b/Lab5Core/build/docs/javadoc/deprecated-list.html new file mode 100644 index 0000000..8c3c7cc --- /dev/null +++ b/Lab5Core/build/docs/javadoc/deprecated-list.html @@ -0,0 +1,121 @@ + + + + + +Deprecated List (Lab5Core 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Core/build/docs/javadoc/help-doc.html b/Lab5Core/build/docs/javadoc/help-doc.html new file mode 100644 index 0000000..ae707d4 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/help-doc.html @@ -0,0 +1,222 @@ + + + + + +API Help (Lab5Core 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    Overview

    +

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    +
  • +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Core/build/docs/javadoc/index-all.html b/Lab5Core/build/docs/javadoc/index-all.html new file mode 100644 index 0000000..8071929 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/index-all.html @@ -0,0 +1,531 @@ + + + + + +Index (Lab5Core 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
A C D E F G H I L M N P R S T U V  + + +

A

+
+
Adapters - Class in common.parser
+
 
+
Adapters() - Constructor for class common.parser.Adapters
+
 
+
Adapters.ColorAdapter - Class in common.parser
+
 
+
Adapters.CoordinateYAdapter - Class in common.parser
+
 
+
Adapters.CountryAdapter - Class in common.parser
+
 
+
Adapters.HeightAdapter - Class in common.parser
+
 
+
Adapters.LocalDateAdapter - Class in common.parser
+
 
+
Adapters.NameAdapter - Class in common.parser
+
 
+
Adapters.PassportAdapter - Class in common.parser
+
 
+
+ + + +

C

+
+
Color - Enum in common.data
+
+
Перечисление цветов
+
+
ColorAdapter() - Constructor for class common.parser.Adapters.ColorAdapter
+
 
+
CommandResult - Class in common.commandline.response
+
 
+
CommandResult(String, Response) - Constructor for class common.commandline.response.CommandResult
+
 
+
common.collection - package common.collection
+
 
+
common.commandline - package common.commandline
+
 
+
common.commandline.response - package common.commandline.response
+
 
+
common.data - package common.data
+
 
+
common.parser - package common.parser
+
 
+
common.util - package common.util
+
 
+
compareTo(Coordinates) - Method in class common.data.Coordinates
+
 
+
compareTo(Location) - Method in class common.data.Location
+
+
Переопределенный метод сравнения двух местоположений, + сравнение производится по имени локации и расстоянию до точки (0; 0; 0)
+
+
compareTo(Person) - Method in class common.data.Person
+
+
Переопределенный метод сравнения двух людей, + сравнение производится по имени, номеру паспорта, + росту, национальности, местоположению и цвету глаз
+
+
ConnectionProperties - Class in common.parser
+
 
+
ConnectionProperties() - Constructor for class common.parser.ConnectionProperties
+
 
+
Coordinates - Class in common.data
+
+
Класс данных координат
+
+
Coordinates(float, float) - Constructor for class common.data.Coordinates
+
+
Конструктор с параметрами
+
+
CoordinateYAdapter() - Constructor for class common.parser.Adapters.CoordinateYAdapter
+
 
+
Country - Enum in common.data
+
+
Перечисление стран
+
+
CountryAdapter() - Constructor for class common.parser.Adapters.CountryAdapter
+
 
+
+ + + +

D

+
+
Database - Interface in common.collection
+
+
Интерфейс баз данных с методами Database.load() и Database.save()
+
+
Database.DatabaseLoadFailedException - Exception in common.collection
+
 
+
Database.DatabaseSaveFailedException - Exception in common.collection
+
 
+
DatabaseLoadFailedException(String) - Constructor for exception common.collection.Database.DatabaseLoadFailedException
+
 
+
DatabaseLoadFailedException(String, String) - Constructor for exception common.collection.Database.DatabaseLoadFailedException
+
 
+
DatabaseLoadFailedException(String, Throwable) - Constructor for exception common.collection.Database.DatabaseLoadFailedException
+
 
+
DatabaseLoadFailedException(String, String, Throwable) - Constructor for exception common.collection.Database.DatabaseLoadFailedException
+
 
+
DatabaseLoadFailedException(Throwable) - Constructor for exception common.collection.Database.DatabaseLoadFailedException
+
 
+
DatabaseSaveFailedException(String) - Constructor for exception common.collection.Database.DatabaseSaveFailedException
+
 
+
DatabaseSaveFailedException(String, String) - Constructor for exception common.collection.Database.DatabaseSaveFailedException
+
 
+
DatabaseSaveFailedException(String, Throwable) - Constructor for exception common.collection.Database.DatabaseSaveFailedException
+
 
+
DatabaseSaveFailedException(String, String, Throwable) - Constructor for exception common.collection.Database.DatabaseSaveFailedException
+
 
+
DatabaseSaveFailedException(Throwable) - Constructor for exception common.collection.Database.DatabaseSaveFailedException
+
 
+
DEFAULT_COLOR - Static variable in class common.parser.Adapters
+
 
+
DEFAULT_COORDINATE - Static variable in class common.parser.Adapters
+
 
+
DEFAULT_COORDINATES - Static variable in class common.parser.Adapters
+
 
+
DEFAULT_COUNTRY - Static variable in class common.parser.Adapters
+
 
+
DEFAULT_DATE - Static variable in class common.parser.Adapters
+
 
+
DEFAULT_HEIGHT - Static variable in class common.parser.Adapters
+
 
+
DEFAULT_LOCATION - Static variable in class common.parser.Adapters
+
 
+
DEFAULT_NAME - Static variable in class common.parser.Adapters
+
 
+
DEFAULT_PASSPORT - Static variable in class common.parser.Adapters
+
 
+
DefaultResponse - Enum in common.commandline.response
+
 
+
doubleOrNull(String) - Static method in class common.util.UtilFunctions
+
 
+
+ + + +

E

+
+
enumOrNull(String, Class<T>) - Static method in class common.util.UtilFunctions
+
 
+
Executable - Interface in common.commandline
+
 
+
Executables - Enum in common.commandline
+
 
+
execute(Object[]) - Method in interface common.commandline.Executable
+
 
+
+ + + +

F

+
+
floatOrNull(String) - Static method in class common.util.UtilFunctions
+
 
+
formatted() - Method in class common.data.Person
+
 
+
+ + + +

G

+
+
getExecutable() - Method in enum common.commandline.Executables
+
 
+
getHostname() - Static method in class common.parser.ConnectionProperties
+
 
+
getMsg() - Method in enum common.commandline.response.DefaultResponse
+
 
+
getMsg() - Method in enum common.commandline.response.PeopleDatabaseResponse
+
 
+
getMsg() - Method in interface common.commandline.response.Response
+
 
+
getPort() - Static method in class common.parser.ConnectionProperties
+
 
+
getResponse() - Method in class common.commandline.response.CommandResult
+
 
+
getValue() - Method in class common.commandline.response.CommandResult
+
 
+
+ + + +

H

+
+
HeightAdapter() - Constructor for class common.parser.Adapters.HeightAdapter
+
 
+
+ + + +

I

+
+
info() - Method in class common.collection.PeopleDatabase
+
 
+
intOrNull(String) - Static method in class common.util.UtilFunctions
+
 
+
+ + + +

L

+
+
load() - Method in interface common.collection.Database
+
 
+
load() - Method in class common.collection.PeopleDatabase
+
+
Метод, инициализирующий базу данных из файла, находящемся по пути, указанном в + переменной окружения PeopleDatabase.ENV_VAR
+
+
LocalDateAdapter() - Constructor for class common.parser.Adapters.LocalDateAdapter
+
 
+
Location - Class in common.data
+
+
Класс данных местоположения, реализует сортировку по умолчанию + по имени и расстоянию до точки (0; 0; 0)
+
+
Location(double, float, long, String) - Constructor for class common.data.Location
+
+
Конструктор с параметрами
+
+
longOrNull(String) - Static method in class common.util.UtilFunctions
+
 
+
+ + + +

M

+
+
marshal(Color) - Method in class common.parser.Adapters.ColorAdapter
+
 
+
marshal(Float) - Method in class common.parser.Adapters.CoordinateYAdapter
+
 
+
marshal(Country) - Method in class common.parser.Adapters.CountryAdapter
+
 
+
marshal(Integer) - Method in class common.parser.Adapters.HeightAdapter
+
 
+
marshal(LocalDate) - Method in class common.parser.Adapters.LocalDateAdapter
+
 
+
marshal(String) - Method in class common.parser.Adapters.NameAdapter
+
 
+
marshal(String) - Method in class common.parser.Adapters.PassportAdapter
+
 
+
+ + + +

N

+
+
NameAdapter() - Constructor for class common.parser.Adapters.NameAdapter
+
 
+
+ + + +

P

+
+
PassportAdapter() - Constructor for class common.parser.Adapters.PassportAdapter
+
 
+
PeopleDatabase - Class in common.collection
+
+
Класс базы данных людей, реализующий интерфейс Database
+
+
PeopleDatabase(Logger) - Constructor for class common.collection.PeopleDatabase
+
 
+
PeopleDatabaseResponse - Enum in common.commandline.response
+
 
+
Person - Class in common.data
+
+
Класс данных человека, реализует сортировку по умолчанию по имени, номеру паспорта, + росту, национальности, местоположению и цвету глаз
+
+
Person(String, Coordinates, Integer, String, Color, Country, Location) - Constructor for class common.data.Person
+
+
Конструктор с параметрами
+
+
+ + + +

R

+
+
Response - Interface in common.commandline.response
+
 
+
+ + + +

S

+
+
save() - Method in interface common.collection.Database
+
 
+
save() - Method in class common.collection.PeopleDatabase
+
+
Метод, сохраняющий базу данных в файл, находящемся по пути, указанном в + переменной окружения PeopleDatabase.ENV_VAR
+
+
setHeight(Integer) - Method in class common.data.Person
+
+
Сеттер для поля height
+
+
setName(String) - Method in class common.data.Location
+
+
Сеттер для поля name
+
+
setName(String) - Method in class common.data.Person
+
+
Сеттер для поля name
+
+
setPassportID(String) - Method in class common.data.Person
+
+
Сеттер для поля passportID
+
+
setY(float) - Method in class common.data.Coordinates
+
+
Сеттер для поля y
+
+
+ + + +

T

+
+
toString() - Method in class common.collection.PeopleDatabase
+
 
+
+ + + +

U

+
+
unmarshal(String) - Method in class common.parser.Adapters.ColorAdapter
+
 
+
unmarshal(String) - Method in class common.parser.Adapters.CoordinateYAdapter
+
 
+
unmarshal(String) - Method in class common.parser.Adapters.CountryAdapter
+
 
+
unmarshal(String) - Method in class common.parser.Adapters.HeightAdapter
+
 
+
unmarshal(String) - Method in class common.parser.Adapters.LocalDateAdapter
+
 
+
unmarshal(String) - Method in class common.parser.Adapters.NameAdapter
+
 
+
unmarshal(String) - Method in class common.parser.Adapters.PassportAdapter
+
 
+
update(Person) - Method in class common.data.Person
+
+
Метод, меняющий все значения полей человека (кроме Person.id и Person.creationDate) в соответствии + со значениями полей другого
+
+
UtilFunctions - Class in common.util
+
+
Класс функций-утилит для избавления от повторяющихся участков кода и выноса их в методы для общего пользования
+
+
+ + + +

V

+
+
valueOf(String) - Static method in enum common.commandline.Executables
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum common.commandline.response.DefaultResponse
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum common.commandline.response.PeopleDatabaseResponse
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum common.data.Color
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum common.data.Country
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum common.commandline.Executables
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum common.commandline.response.DefaultResponse
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum common.commandline.response.PeopleDatabaseResponse
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum common.data.Color
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum common.data.Country
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
+A C D E F G H I L M N P R S T U V 
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Core/build/docs/javadoc/index.html b/Lab5Core/build/docs/javadoc/index.html new file mode 100644 index 0000000..8b1a157 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/index.html @@ -0,0 +1,75 @@ + + + + + +Lab5Core 2.0 API + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/Lab5Core/build/docs/javadoc/overview-frame.html b/Lab5Core/build/docs/javadoc/overview-frame.html new file mode 100644 index 0000000..456bfdb --- /dev/null +++ b/Lab5Core/build/docs/javadoc/overview-frame.html @@ -0,0 +1,25 @@ + + + + + +Overview List (Lab5Core 2.0 API) + + + + + + +

 

+ + diff --git a/Lab5Core/build/docs/javadoc/overview-summary.html b/Lab5Core/build/docs/javadoc/overview-summary.html new file mode 100644 index 0000000..3b52350 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/overview-summary.html @@ -0,0 +1,155 @@ + + + + + +Overview (Lab5Core 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Lab5Core 2.0 API

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
common.collection 
common.commandline 
common.commandline.response 
common.data 
common.parser 
common.util 
+
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Core/build/docs/javadoc/overview-tree.html b/Lab5Core/build/docs/javadoc/overview-tree.html new file mode 100644 index 0000000..380c7e9 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/overview-tree.html @@ -0,0 +1,193 @@ + + + + + +Class Hierarchy (Lab5Core 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    • +
    +
  • +
+
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Core/build/docs/javadoc/package-list b/Lab5Core/build/docs/javadoc/package-list new file mode 100644 index 0000000..0a83c9b --- /dev/null +++ b/Lab5Core/build/docs/javadoc/package-list @@ -0,0 +1,6 @@ +common.collection +common.commandline +common.commandline.response +common.data +common.parser +common.util diff --git a/Lab5Core/build/docs/javadoc/script.js b/Lab5Core/build/docs/javadoc/script.js new file mode 100644 index 0000000..b346356 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/Lab5Core/build/docs/javadoc/serialized-form.html b/Lab5Core/build/docs/javadoc/serialized-form.html new file mode 100644 index 0000000..03eb8fb --- /dev/null +++ b/Lab5Core/build/docs/javadoc/serialized-form.html @@ -0,0 +1,284 @@ + + + + + +Serialized Form (Lab5Core 2.0 API) + + + + + + + + + + +
+

Serialized Form

+
+
+
    +
  • +

    Package common.collection

    + +
  • +
  • +

    Package common.commandline

    +
  • +
  • +

    Package common.commandline.response

    + +
  • +
  • +

    Package common.data

    +
      +
    • + + +

      Class common.data.Coordinates extends java.lang.Object implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          x

          +
          float x
          +
          Координата X типа float
          +
        • +
        • +

          y

          +
          java.lang.Float y
          +
          Координата Y типа float, значение должно быть больше -816
          +
        • +
        +
      • +
      +
    • +
    • + + +

      Class common.data.Location extends java.lang.Object implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          x

          +
          double x
          +
          Координата X типа double
          +
        • +
        • +

          y

          +
          float y
          +
          Координата Y типа float
          +
        • +
        • +

          z

          +
          long z
          +
          Координата Z типа long, не может быть null
          +
        • +
        • +

          name

          +
          java.lang.String name
          +
          Имя локации, может быть null
          +
        • +
        +
      • +
      +
    • +
    • + + +

      Class common.data.Person extends java.lang.Object implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          id

          +
          java.lang.Long id
          +
          Id человека, не может быть null, значение поля должно быть больше 0, + значение этого поля должно быть уникальным, значение этого поля должно генерироваться автоматически
          +
        • +
        • +

          name

          +
          java.lang.String name
          +
          Имя человека, не может быть null, строка не может быть пустой
          +
        • +
        • +

          coordinates

          +
          Coordinates coordinates
          +
          Координаты человека, не может быть null
          +
        • +
        • +

          creationDate

          +
          java.time.LocalDate creationDate
          +
          Дата создания объекта, не может быть null, значение этого поля должно генерироваться автоматически
          +
        • +
        • +

          height

          +
          java.lang.Integer height
          +
          Рост человека, может быть null, значение поля должно быть больше 0
          +
        • +
        • +

          passportID

          +
          java.lang.String passportID
          +
          Номер паспорта человека, длина строки должна быть не меньше 8, поле может быть null
          +
        • +
        • +

          eyeColor

          +
          Color eyeColor
          +
          Цвет глаз человека, не может быть null
          +
        • +
        • +

          nationality

          +
          Country nationality
          +
          Национальность человека, не может быть null
          +
        • +
        • +

          location

          +
          Location location
          +
          Местоположение человека, может быть null
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+ + + + + + diff --git a/Lab5Core/build/docs/javadoc/stylesheet.css b/Lab5Core/build/docs/javadoc/stylesheet.css new file mode 100644 index 0000000..98055b2 --- /dev/null +++ b/Lab5Core/build/docs/javadoc/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/Lab5Core/build/libs/Lab5Core-2.0.jar b/Lab5Core/build/libs/Lab5Core-2.0.jar new file mode 100644 index 0000000..5437021 Binary files /dev/null and b/Lab5Core/build/libs/Lab5Core-2.0.jar differ diff --git a/Lab5Core/build/resources/main/connection.properties b/Lab5Core/build/resources/main/connection.properties new file mode 100644 index 0000000..a1e7224 --- /dev/null +++ b/Lab5Core/build/resources/main/connection.properties @@ -0,0 +1,2 @@ +hostname=localhost +port=1234 diff --git a/Lab5Core/build/tmp/compileJava/previous-compilation-data.bin b/Lab5Core/build/tmp/compileJava/previous-compilation-data.bin new file mode 100644 index 0000000..af2aa2c Binary files /dev/null and b/Lab5Core/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/Lab5Core/build/tmp/jar/MANIFEST.MF b/Lab5Core/build/tmp/jar/MANIFEST.MF new file mode 100644 index 0000000..59499bc --- /dev/null +++ b/Lab5Core/build/tmp/jar/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/Lab5Core/build/tmp/javadoc/javadoc.options b/Lab5Core/build/tmp/javadoc/javadoc.options new file mode 100644 index 0000000..387e206 --- /dev/null +++ b/Lab5Core/build/tmp/javadoc/javadoc.options @@ -0,0 +1,23 @@ +-classpath 'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\build\\classes\\java\\main;C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\build\\resources\\main;C:\\Users\\egor\\.gradle\\caches\\modules-2\\files-2.1\\org.projectlombok\\lombok\\1.18.22\\9c08ea24c6eb714e2d6170e8122c069a0ba9aacf\\lombok-1.18.22.jar' +-d 'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\build\\docs\\javadoc' +-doctitle 'Lab5Core 2.0 API' +-encoding 'UTF-8' +-notimestamp +-quiet +-windowtitle 'Lab5Core 2.0 API' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\collection\\Database.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\collection\\PeopleDatabase.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\commandline\\Executable.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\commandline\\Executables.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\commandline\\response\\CommandResult.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\commandline\\response\\DefaultResponse.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\commandline\\response\\PeopleDatabaseResponse.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\commandline\\response\\Response.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\data\\Color.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\data\\Coordinates.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\data\\Country.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\data\\Location.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\data\\Person.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\parser\\Adapters.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\parser\\ConnectionProperties.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\src\\main\\java\\common\\util\\UtilFunctions.java' diff --git a/src/main/java/ru/erius/lab5/collection/Database.java b/Lab5Core/src/main/java/common/collection/Database.java similarity index 97% rename from src/main/java/ru/erius/lab5/collection/Database.java rename to Lab5Core/src/main/java/common/collection/Database.java index 06bbbe1..f7ab56b 100644 --- a/src/main/java/ru/erius/lab5/collection/Database.java +++ b/Lab5Core/src/main/java/common/collection/Database.java @@ -1,4 +1,4 @@ -package ru.erius.lab5.collection; +package common.collection; /** * Интерфейс баз данных с методами {@link #load()} и {@link #save()} diff --git a/src/main/java/ru/erius/lab5/collection/PeopleDatabase.java b/Lab5Core/src/main/java/common/collection/PeopleDatabase.java similarity index 76% rename from src/main/java/ru/erius/lab5/collection/PeopleDatabase.java rename to Lab5Core/src/main/java/common/collection/PeopleDatabase.java index b3e1e30..e31df18 100644 --- a/src/main/java/ru/erius/lab5/collection/PeopleDatabase.java +++ b/Lab5Core/src/main/java/common/collection/PeopleDatabase.java @@ -1,8 +1,8 @@ -package ru.erius.lab5.collection; +package common.collection; import lombok.Getter; -import ru.erius.lab5.data.Person; -import ru.erius.lab5.parser.Adapters; +import common.data.Person; +import common.parser.Adapters; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; @@ -16,12 +16,13 @@ import java.io.File; import java.io.IOException; import java.time.LocalDate; import java.util.TreeSet; +import java.util.logging.Logger; import java.util.stream.Collectors; /** * Класс базы данных людей, реализующий интерфейс Database * - * @see ru.erius.lab5.collection.Database + * @see Database */ @XmlRootElement public class PeopleDatabase implements Database { @@ -31,6 +32,8 @@ public class PeopleDatabase implements Database { DEFAULT_FILE_NAME = "lab5.xml", TYPE = "TreeSet"; + @XmlTransient + private Logger logger = Logger.getLogger("Lab5Client"); @XmlTransient private JAXBContext context; @XmlTransient @@ -51,6 +54,12 @@ public class PeopleDatabase implements Database { } } + private PeopleDatabase() {} + + public PeopleDatabase(Logger logger) { + this.logger = logger; + } + public String info() { return String.format("Тип коллекции: %s \n" + "Дата инициализации: %s \n" + @@ -67,19 +76,19 @@ public class PeopleDatabase implements Database { */ @Override public void load() throws Database.DatabaseLoadFailedException { - System.out.println("Инициализация коллекции из файла..."); + logger.info("Инициализация коллекции из файла..."); String path = System.getenv(ENV_VAR); boolean envSet = true; if (path == null) { - System.out.println("Не найдена переменная окружения LAB5_PATH, создание файла в директории jar файла"); + logger.warning("Не найдена переменная окружения LAB5_PATH, создание файла в директории jar файла"); path = "."; envSet = false; } File file = new File(path); if (!file.exists() && envSet) { - System.out.println("Файл " + file.getAbsolutePath() + " не был найден, создание файла в директории jar файла"); + logger.warning("Файл " + file.getAbsolutePath() + " не был найден, создание файла в директории jar файла"); file = new File("."); } if (file.isDirectory()) @@ -95,9 +104,9 @@ public class PeopleDatabase implements Database { PeopleDatabase pd = (PeopleDatabase) unmarshaller.unmarshal(file); this.collection = pd.collection; this.initDate = pd.initDate; - System.out.println("Инициализация успешно выполнена"); + logger.info("Инициализация успешно выполнена"); } catch (JAXBException e) { - System.out.println("Не удалось загрузить коллекцию из файла " + file.getAbsolutePath() + ", он пуст, либо нарушена структура xml"); + logger.severe("Не удалось загрузить коллекцию из файла " + file.getAbsolutePath() + ", он пуст, либо нарушена структура xml"); } } @@ -112,16 +121,17 @@ public class PeopleDatabase implements Database { @Override public void save() throws Database.DatabaseSaveFailedException { if (!file.exists()) { - System.out.println("Файла " + file.getAbsolutePath() + " не существует, возможно он был удален, пытаюсь воссоздать файл..."); + logger.warning("Файла " + file.getAbsolutePath() + " не существует, возможно он был удален, пытаюсь воссоздать файл..."); try { file.createNewFile(); - System.out.println("Файл был успешно создан"); + logger.info("Файл был успешно создан"); } catch (IOException e) { throw new DatabaseSaveFailedException("Не удается создать файл заново, пожалуйста, сделайте это вручную и попробуйте еще раз"); } } try { Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.marshal(this, file); } catch (JAXBException e) { @@ -130,18 +140,18 @@ public class PeopleDatabase implements Database { } private File createFile(File file) { - System.out.println("Директория успешно найдена"); + logger.info("Директория успешно найдена"); file = new File(file.getAbsolutePath() + "/" + DEFAULT_FILE_NAME); boolean exists; try { exists = file.createNewFile(); } catch (IOException e) { e.printStackTrace(); - System.err.println("Что-то пошло не так"); + logger.severe("Что-то пошло не так"); System.exit(-1); return null; } - System.out.println(exists ? "Файл не найден, создание файла " + DEFAULT_FILE_NAME : "Файл успешно найден"); + logger.info(exists ? "Файл не найден, создание файла " + DEFAULT_FILE_NAME : "Файл успешно найден"); return file; } diff --git a/Lab5Core/src/main/java/common/commandline/Executable.java b/Lab5Core/src/main/java/common/commandline/Executable.java new file mode 100644 index 0000000..bffad8a --- /dev/null +++ b/Lab5Core/src/main/java/common/commandline/Executable.java @@ -0,0 +1,10 @@ +package common.commandline; + +import common.commandline.response.CommandResult; + +import java.io.Serializable; + +@FunctionalInterface +public interface Executable extends Serializable { + CommandResult execute(Object[] args); +} diff --git a/Lab5Core/src/main/java/common/commandline/Executables.java b/Lab5Core/src/main/java/common/commandline/Executables.java new file mode 100644 index 0000000..0d99a53 --- /dev/null +++ b/Lab5Core/src/main/java/common/commandline/Executables.java @@ -0,0 +1,117 @@ +package common.commandline; + +import common.collection.Database; +import common.collection.PeopleDatabase; +import common.commandline.response.CommandResult; +import common.commandline.response.DefaultResponse; +import common.commandline.response.PeopleDatabaseResponse; +import common.data.Person; + +import java.util.Collections; +import java.util.Optional; + +public enum Executables { + ADD(args -> { + PeopleDatabase peopleDatabase = (PeopleDatabase) args[0]; + Person person = (Person) args[1]; + boolean success = peopleDatabase.getCollection().add(person); + return new CommandResult(null, success ? DefaultResponse.OK : PeopleDatabaseResponse.FAILED_TO_ADD); + }), + ADD_IF_MAX(args -> { + PeopleDatabase peopleDatabase = (PeopleDatabase) args[0]; + Person person = (Person) args[1]; + Person last = peopleDatabase.getCollection().last(); + if (person.compareTo(last) > 0) return ADD.executable.execute(args); + return new CommandResult(null, PeopleDatabaseResponse.FAILED_TO_ADD); + }), + ADD_IF_MIN(args -> { + PeopleDatabase peopleDatabase = (PeopleDatabase) args[0]; + Person person = (Person) args[1]; + Person first = peopleDatabase.getCollection().first(); + if (person.compareTo(first) < 0) return ADD.executable.execute(args); + return new CommandResult(null, PeopleDatabaseResponse.FAILED_TO_ADD); + }), + CLEAR(args -> { + PeopleDatabase peopleDatabase = (PeopleDatabase) args[0]; + peopleDatabase.getCollection().clear(); + return new CommandResult(null, DefaultResponse.OK); + }), + FILTER_CONTAINS_NAME(args -> { + PeopleDatabase peopleDatabase = (PeopleDatabase) args[0]; + String name = (String) args[1]; + StringBuilder result = new StringBuilder("Список людей, в имени которых содержится " + name + ":\n"); + peopleDatabase.getCollection() + .stream() + .filter(p -> p.getName().contains(name)) + .forEach(p -> result.append(p.formatted()).append("\n")); + return new CommandResult(result.toString(), DefaultResponse.OK); + }), + INFO(args -> { + PeopleDatabase peopleDatabase = (PeopleDatabase) args[0]; + return new CommandResult(peopleDatabase.info(), DefaultResponse.OK); + }), + PRINT_FIELD_DESCENDING_LOCATION(args -> { + PeopleDatabase peopleDatabase = (PeopleDatabase) args[0]; + StringBuilder result = new StringBuilder("Список локаций в порядке убывания:\n"); + peopleDatabase.getCollection() + .stream() + .map(Person::getLocation) + .sorted(Collections.reverseOrder()) + .forEach(loc -> result.append(loc).append("\n")); + return new CommandResult(result.toString(), DefaultResponse.OK); + }), + REMOVE_BY_ID(args -> { + PeopleDatabase peopleDatabase = (PeopleDatabase) args[0]; + long id = (long) args[1]; + boolean success = peopleDatabase.getCollection().removeIf(p -> p.getId().equals(id)); + return new CommandResult(null, success ? DefaultResponse.OK : PeopleDatabaseResponse.ELEMENT_NOT_FOUND); + }), + SAVE(args -> { + PeopleDatabase peopleDatabase = (PeopleDatabase) args[0]; + try { + peopleDatabase.save(); + return new CommandResult(null, DefaultResponse.OK); + } catch (Database.DatabaseSaveFailedException e) { + return new CommandResult(e.getMessage(), PeopleDatabaseResponse.SAVE_FAILED); + } + }), + SHOW(args -> { + PeopleDatabase peopleDatabase = (PeopleDatabase) args[0]; + StringBuilder result = new StringBuilder("Элементы коллекции:\n"); + peopleDatabase.getCollection().forEach(p -> result.append(p.formatted())); + return new CommandResult(result.toString(), DefaultResponse.OK); + }), + SUM_OF_HEIGHT(args -> { + PeopleDatabase peopleDatabase = (PeopleDatabase) args[0]; + int sum = peopleDatabase.getCollection() + .stream() + .mapToInt(p -> p.getHeight() == null ? 0 : p.getHeight()) + .sum(); + return new CommandResult("Сумма ростов всех людей в коллекции - " + sum, DefaultResponse.OK); + }), + UPDATE(args -> { + PeopleDatabase peopleDatabase = (PeopleDatabase) args[0]; + long id = (long) args[1]; + Person person = (Person) args[2]; + Optional optionalPerson = peopleDatabase.getCollection() + .stream() + .filter(p -> p.getId().equals(id)) + .findFirst(); + if (!optionalPerson.isPresent()) return new CommandResult(null, PeopleDatabaseResponse.ELEMENT_NOT_FOUND); + Person oldPerson = optionalPerson.get(); + CommandResult result = REMOVE_BY_ID.executable.execute(new Object[]{ peopleDatabase, id }); + if (result.getResponse() != DefaultResponse.OK) return result; + oldPerson.update(person); + return ADD.executable.execute(new Object[]{ peopleDatabase, oldPerson }); + }); + + private final Executable executable; + + Executables(Executable executable) { + this.executable = executable; + } + + public Executable getExecutable() { + return executable; + } +} diff --git a/Lab5Core/src/main/java/common/commandline/response/CommandResult.java b/Lab5Core/src/main/java/common/commandline/response/CommandResult.java new file mode 100644 index 0000000..361fbce --- /dev/null +++ b/Lab5Core/src/main/java/common/commandline/response/CommandResult.java @@ -0,0 +1,22 @@ +package common.commandline.response; + +import java.io.Serializable; + +public class CommandResult implements Serializable { + + private final String value; + private final Response response; + + public CommandResult(String value, Response response) { + this.value = value; + this.response = response; + } + + public String getValue() { + return value; + } + + public Response getResponse() { + return response; + } +} diff --git a/Lab5Core/src/main/java/common/commandline/response/DefaultResponse.java b/Lab5Core/src/main/java/common/commandline/response/DefaultResponse.java new file mode 100644 index 0000000..16cb780 --- /dev/null +++ b/Lab5Core/src/main/java/common/commandline/response/DefaultResponse.java @@ -0,0 +1,24 @@ +package common.commandline.response; + +public enum DefaultResponse implements Response { + + OK("Команда выполнена успешно"), + FILE_NOT_FOUND("Файл не был найден"), + CLIENT_ONLY("Команда не предназначена для выполнения на сервере"), + SERVER_ERROR("Ошибка при связи по сетевому каналу"), + CLASS_NOT_FOUND("Класс не найден"), + TYPE_ERROR("Получен ответ не того типа"), + HOST_NOT_FOUND("Хоста не существует"), + UNKNOWN("Неизвестная ошибка"); + + private final String msg; + + DefaultResponse(String msg) { + this.msg = msg; + } + + @Override + public String getMsg() { + return msg; + } +} diff --git a/Lab5Core/src/main/java/common/commandline/response/PeopleDatabaseResponse.java b/Lab5Core/src/main/java/common/commandline/response/PeopleDatabaseResponse.java new file mode 100644 index 0000000..ff0233f --- /dev/null +++ b/Lab5Core/src/main/java/common/commandline/response/PeopleDatabaseResponse.java @@ -0,0 +1,19 @@ +package common.commandline.response; + +public enum PeopleDatabaseResponse implements Response { + + ELEMENT_NOT_FOUND("Элемент не был найден"), + SAVE_FAILED("Не удалось сохранить коллекцию"), + FAILED_TO_ADD("Не удалось добавить элемент в коллекцию"); + + private final String msg; + + PeopleDatabaseResponse(String msg) { + this.msg = msg; + } + + @Override + public String getMsg() { + return msg; + } +} diff --git a/Lab5Core/src/main/java/common/commandline/response/Response.java b/Lab5Core/src/main/java/common/commandline/response/Response.java new file mode 100644 index 0000000..51c2684 --- /dev/null +++ b/Lab5Core/src/main/java/common/commandline/response/Response.java @@ -0,0 +1,7 @@ +package common.commandline.response; + +import java.io.Serializable; + +public interface Response extends Serializable { + String getMsg(); +} diff --git a/Lab5Core/src/main/java/common/data/Color.java b/Lab5Core/src/main/java/common/data/Color.java new file mode 100644 index 0000000..7c60a04 --- /dev/null +++ b/Lab5Core/src/main/java/common/data/Color.java @@ -0,0 +1,12 @@ +package common.data; + +import java.io.Serializable; + +/** + * Перечисление цветов + */ +public enum Color implements Serializable { + BLACK, + ORANGE, + BROWN +} diff --git a/src/main/java/ru/erius/lab5/data/Coordinates.java b/Lab5Core/src/main/java/common/data/Coordinates.java similarity index 90% rename from src/main/java/ru/erius/lab5/data/Coordinates.java rename to Lab5Core/src/main/java/common/data/Coordinates.java index 65cd756..96a7b1e 100644 --- a/src/main/java/ru/erius/lab5/data/Coordinates.java +++ b/Lab5Core/src/main/java/common/data/Coordinates.java @@ -1,18 +1,19 @@ -package ru.erius.lab5.data; +package common.data; import lombok.*; -import ru.erius.lab5.parser.Adapters; +import common.parser.Adapters; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import java.io.Serializable; /** * Класс данных координат */ @Data @EqualsAndHashCode @ToString @XmlAccessorType(XmlAccessType.FIELD) -public class Coordinates implements Comparable { +public class Coordinates implements Comparable, Serializable { /** * Координата X типа float diff --git a/src/main/java/ru/erius/lab5/data/Country.java b/Lab5Core/src/main/java/common/data/Country.java similarity index 54% rename from src/main/java/ru/erius/lab5/data/Country.java rename to Lab5Core/src/main/java/common/data/Country.java index ecc3322..d888b3c 100644 --- a/src/main/java/ru/erius/lab5/data/Country.java +++ b/Lab5Core/src/main/java/common/data/Country.java @@ -1,9 +1,11 @@ -package ru.erius.lab5.data; +package common.data; + +import java.io.Serializable; /** * Перечисление стран */ -public enum Country { +public enum Country implements Serializable { UNITED_KINGDOM, GERMANY, CHINA, diff --git a/src/main/java/ru/erius/lab5/data/Location.java b/Lab5Core/src/main/java/common/data/Location.java similarity index 94% rename from src/main/java/ru/erius/lab5/data/Location.java rename to Lab5Core/src/main/java/common/data/Location.java index 20d4b28..8fe4119 100644 --- a/src/main/java/ru/erius/lab5/data/Location.java +++ b/Lab5Core/src/main/java/common/data/Location.java @@ -1,11 +1,12 @@ -package ru.erius.lab5.data; +package common.data; import lombok.*; -import ru.erius.lab5.parser.Adapters; +import common.parser.Adapters; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; +import java.io.Serializable; import java.util.Comparator; /** @@ -14,7 +15,7 @@ import java.util.Comparator; */ @Data @EqualsAndHashCode @ToString @XmlAccessorType(XmlAccessType.FIELD) -public class Location implements Comparable { +public class Location implements Comparable, Serializable { /** * Координата X типа double */ diff --git a/src/main/java/ru/erius/lab5/data/Person.java b/Lab5Core/src/main/java/common/data/Person.java similarity index 98% rename from src/main/java/ru/erius/lab5/data/Person.java rename to Lab5Core/src/main/java/common/data/Person.java index 998cf69..7055dba 100644 --- a/src/main/java/ru/erius/lab5/data/Person.java +++ b/Lab5Core/src/main/java/common/data/Person.java @@ -1,13 +1,14 @@ -package ru.erius.lab5.data; +package common.data; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NonNull; import lombok.ToString; -import ru.erius.lab5.parser.*; +import common.parser.Adapters; import javax.xml.bind.annotation.*; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import java.io.Serializable; import java.time.LocalDate; import java.util.*; @@ -18,7 +19,7 @@ import java.util.*; @Data @EqualsAndHashCode @ToString @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) -public class Person implements Comparable { +public class Person implements Comparable, Serializable { /** * Количество созданных людей, используется для задания * уникального id для каждого объекта данного класса diff --git a/src/main/java/ru/erius/lab5/parser/Adapters.java b/Lab5Core/src/main/java/common/parser/Adapters.java similarity index 96% rename from src/main/java/ru/erius/lab5/parser/Adapters.java rename to Lab5Core/src/main/java/common/parser/Adapters.java index 3f4e455..4ab80e1 100644 --- a/src/main/java/ru/erius/lab5/parser/Adapters.java +++ b/Lab5Core/src/main/java/common/parser/Adapters.java @@ -1,10 +1,10 @@ -package ru.erius.lab5.parser; +package common.parser; -import ru.erius.lab5.data.Color; -import ru.erius.lab5.data.Coordinates; -import ru.erius.lab5.data.Country; -import ru.erius.lab5.data.Location; -import ru.erius.lab5.util.UtilFunctions; +import common.data.Color; +import common.data.Coordinates; +import common.data.Country; +import common.data.Location; +import common.util.UtilFunctions; import javax.xml.bind.annotation.adapters.XmlAdapter; import java.time.LocalDate; diff --git a/Lab5Core/src/main/java/common/parser/ConnectionProperties.java b/Lab5Core/src/main/java/common/parser/ConnectionProperties.java new file mode 100644 index 0000000..3ecddb5 --- /dev/null +++ b/Lab5Core/src/main/java/common/parser/ConnectionProperties.java @@ -0,0 +1,61 @@ +package common.parser; + +import common.util.UtilFunctions; + +import java.io.*; +import java.util.Properties; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +public final class ConnectionProperties { + + private final static Properties properties = new Properties(); + private static final Logger logger = Logger.getLogger("Lab5"); + + static { + File file = new File("connection.properties"); + try { + if (file.exists()) { + logger.info("Файл найден, загружаем настройки подключения..."); + } + else { + logger.warning("Файл не найден, создание файла " + file.getName()); + BufferedReader reader = new BufferedReader(new InputStreamReader(ConnectionProperties.class.getClassLoader().getResource("connection.properties").openStream())); + String content = reader.lines().collect(Collectors.joining("\n")); + file.createNewFile(); + BufferedWriter writer = new BufferedWriter(new FileWriter(file)); + writer.write(content); + writer.close(); + reader.close(); + logger.info("Файл создан, загружаем настройки подключения"); + } + properties.load(new FileInputStream(file)); + logger.info("Настройки подключения загружены из файла " + file.getName()); + } catch (IOException e) { + e.printStackTrace(); + System.exit(-1); + } + } + + public static String getHostname() { + String result = properties.getProperty("hostname"); + if (result == null) { + logger.severe("Свойство hostname не было найдено, используем значение по умолчанию localhost"); + return "localhost"; + } else return result; + } + + public static int getPort() { + String resultStr = properties.getProperty("port"); + if (resultStr == null) { + logger.severe("Свойство port не было найден, используем значение по умолчанию 1234"); + return 1234; + } + Integer result = UtilFunctions.intOrNull(resultStr); + if (result == null) { + logger.severe("Порт должен быть целым числом, используем значение по умолчанию 1234"); + return 1234; + } + return result; + } +} diff --git a/src/main/java/ru/erius/lab5/util/UtilFunctions.java b/Lab5Core/src/main/java/common/util/UtilFunctions.java similarity index 98% rename from src/main/java/ru/erius/lab5/util/UtilFunctions.java rename to Lab5Core/src/main/java/common/util/UtilFunctions.java index 0fd7c47..971b5fe 100644 --- a/src/main/java/ru/erius/lab5/util/UtilFunctions.java +++ b/Lab5Core/src/main/java/common/util/UtilFunctions.java @@ -1,4 +1,4 @@ -package ru.erius.lab5.util; +package common.util; /** * Класс функций-утилит для избавления от повторяющихся участков кода и выноса их в методы для общего пользования diff --git a/Lab5Core/src/main/resources/connection.properties b/Lab5Core/src/main/resources/connection.properties new file mode 100644 index 0000000..a1e7224 --- /dev/null +++ b/Lab5Core/src/main/resources/connection.properties @@ -0,0 +1,2 @@ +hostname=localhost +port=1234 diff --git a/Lab5Server/build.gradle.kts b/Lab5Server/build.gradle.kts new file mode 100644 index 0000000..4f26dce --- /dev/null +++ b/Lab5Server/build.gradle.kts @@ -0,0 +1,40 @@ +plugins { + java + id("com.github.johnrengelman.shadow") version("7.1.2") +} + +group = "ru.erius.lab5" +version = "2.0" +val mainClass = "server.Lab5Server" + +repositories { + mavenCentral() +} + +dependencies { + testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") + implementation(project(":Lab5Core")) +} + +tasks.getByName("test") { + useJUnitPlatform() +} + +tasks.compileJava { + options.encoding = "UTF-8" +} + +tasks.javadoc { + options.encoding = "UTF-8" +} + +tasks.shadowJar { + archiveClassifier.set("") + manifest { + attributes( + "Manifest-Version" to "1.0", + "Main-Class" to mainClass + ) + } +} diff --git a/Lab5Server/build/classes/java/main/server/Lab5Server.class b/Lab5Server/build/classes/java/main/server/Lab5Server.class new file mode 100644 index 0000000..8dbd6ee Binary files /dev/null and b/Lab5Server/build/classes/java/main/server/Lab5Server.class differ diff --git a/Lab5Server/build/classes/java/main/server/net/UDPServer.class b/Lab5Server/build/classes/java/main/server/net/UDPServer.class new file mode 100644 index 0000000..1b41531 Binary files /dev/null and b/Lab5Server/build/classes/java/main/server/net/UDPServer.class differ diff --git a/Lab5Server/build/docs/javadoc/allclasses-frame.html b/Lab5Server/build/docs/javadoc/allclasses-frame.html new file mode 100644 index 0000000..e44ed3e --- /dev/null +++ b/Lab5Server/build/docs/javadoc/allclasses-frame.html @@ -0,0 +1,19 @@ + + + + + +All Classes (Lab5Server 2.0 API) + + + + +

All Classes

+ + + diff --git a/Lab5Server/build/docs/javadoc/allclasses-noframe.html b/Lab5Server/build/docs/javadoc/allclasses-noframe.html new file mode 100644 index 0000000..6446e9a --- /dev/null +++ b/Lab5Server/build/docs/javadoc/allclasses-noframe.html @@ -0,0 +1,19 @@ + + + + + +All Classes (Lab5Server 2.0 API) + + + + +

All Classes

+ + + diff --git a/Lab5Server/build/docs/javadoc/constant-values.html b/Lab5Server/build/docs/javadoc/constant-values.html new file mode 100644 index 0000000..320c4b7 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/constant-values.html @@ -0,0 +1,121 @@ + + + + + +Constant Field Values (Lab5Server 2.0 API) + + + + + + + + + + +
+

Constant Field Values

+

Contents

+
+ + + + + + diff --git a/Lab5Server/build/docs/javadoc/deprecated-list.html b/Lab5Server/build/docs/javadoc/deprecated-list.html new file mode 100644 index 0000000..e8f69c9 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/deprecated-list.html @@ -0,0 +1,121 @@ + + + + + +Deprecated List (Lab5Server 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Server/build/docs/javadoc/help-doc.html b/Lab5Server/build/docs/javadoc/help-doc.html new file mode 100644 index 0000000..11f49fd --- /dev/null +++ b/Lab5Server/build/docs/javadoc/help-doc.html @@ -0,0 +1,222 @@ + + + + + +API Help (Lab5Server 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    Overview

    +

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    +
  • +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Server/build/docs/javadoc/index-all.html b/Lab5Server/build/docs/javadoc/index-all.html new file mode 100644 index 0000000..e10f561 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/index-all.html @@ -0,0 +1,186 @@ + + + + + +Index (Lab5Server 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
C D L M R S U  + + +

C

+
+
connect() - Method in class server.net.UDPServer
+
 
+
+ + + +

D

+
+
disconnect() - Method in class server.net.UDPServer
+
 
+
+ + + +

L

+
+
Lab5Server - Class in server
+
 
+
Lab5Server() - Constructor for class server.Lab5Server
+
 
+
logger - Static variable in class server.Lab5Server
+
 
+
+ + + +

M

+
+
main(String[]) - Static method in class server.Lab5Server
+
 
+
+ + + +

R

+
+
receive(PeopleDatabase) - Method in class server.net.UDPServer
+
 
+
+ + + +

S

+
+
send(CommandResult, InetAddress, int) - Method in class server.net.UDPServer
+
 
+
server - package server
+
 
+
server.net - package server.net
+
 
+
+ + + +

U

+
+
UDPServer - Class in server.net
+
 
+
UDPServer(int, Logger) - Constructor for class server.net.UDPServer
+
 
+
UDPServer(String, int, Logger) - Constructor for class server.net.UDPServer
+
 
+
+C D L M R S U 
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Server/build/docs/javadoc/index.html b/Lab5Server/build/docs/javadoc/index.html new file mode 100644 index 0000000..83c8a99 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/index.html @@ -0,0 +1,75 @@ + + + + + +Lab5Server 2.0 API + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/Lab5Server/build/docs/javadoc/overview-frame.html b/Lab5Server/build/docs/javadoc/overview-frame.html new file mode 100644 index 0000000..9b124f9 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/overview-frame.html @@ -0,0 +1,21 @@ + + + + + +Overview List (Lab5Server 2.0 API) + + + + + +
+

Packages

+ +
+

 

+ + diff --git a/Lab5Server/build/docs/javadoc/overview-summary.html b/Lab5Server/build/docs/javadoc/overview-summary.html new file mode 100644 index 0000000..a7b567b --- /dev/null +++ b/Lab5Server/build/docs/javadoc/overview-summary.html @@ -0,0 +1,139 @@ + + + + + +Overview (Lab5Server 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Lab5Server 2.0 API

+
+
+ + + + + + + + + + + + + + + + +
Packages 
PackageDescription
server 
server.net 
+
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Server/build/docs/javadoc/overview-tree.html b/Lab5Server/build/docs/javadoc/overview-tree.html new file mode 100644 index 0000000..aa3892e --- /dev/null +++ b/Lab5Server/build/docs/javadoc/overview-tree.html @@ -0,0 +1,136 @@ + + + + + +Class Hierarchy (Lab5Server 2.0 API) + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/Lab5Server/build/docs/javadoc/package-list b/Lab5Server/build/docs/javadoc/package-list new file mode 100644 index 0000000..0941dd7 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/package-list @@ -0,0 +1,2 @@ +server +server.net diff --git a/Lab5Server/build/docs/javadoc/script.js b/Lab5Server/build/docs/javadoc/script.js new file mode 100644 index 0000000..b346356 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/Lab5Server/build/docs/javadoc/server/Lab5Server.html b/Lab5Server/build/docs/javadoc/server/Lab5Server.html new file mode 100644 index 0000000..d4c6a52 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/server/Lab5Server.html @@ -0,0 +1,304 @@ + + + + + +Lab5Server (Lab5Server 2.0 API) + + + + + + + + + + + +
+
server
+

Class Lab5Server

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • server.Lab5Server
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class Lab5Server
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      static java.util.logging.Loggerlogger 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Lab5Server() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        logger

        +
        public static final java.util.logging.Logger logger
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Lab5Server

        +
        public Lab5Server()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Server/build/docs/javadoc/server/net/UDPServer.html b/Lab5Server/build/docs/javadoc/server/net/UDPServer.html new file mode 100644 index 0000000..da32c41 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/server/net/UDPServer.html @@ -0,0 +1,329 @@ + + + + + +UDPServer (Lab5Server 2.0 API) + + + + + + + + + + + +
+
server.net
+

Class UDPServer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • server.net.UDPServer
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class UDPServer
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      UDPServer(int port, + java.util.logging.Logger logger) 
      UDPServer(java.lang.String hostname, + int port, + java.util.logging.Logger logger) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleanconnect() 
      voiddisconnect() 
      voidreceive(common.collection.PeopleDatabase peopleDatabase) 
      voidsend(common.commandline.response.CommandResult result, + java.net.InetAddress address, + int port) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UDPServer

        +
        public UDPServer(int port,
        +                 java.util.logging.Logger logger)
        +
      • +
      + + + +
        +
      • +

        UDPServer

        +
        public UDPServer(java.lang.String hostname,
        +                 int port,
        +                 java.util.logging.Logger logger)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        connect

        +
        public boolean connect()
        +
      • +
      + + + +
        +
      • +

        disconnect

        +
        public void disconnect()
        +
      • +
      + + + +
        +
      • +

        send

        +
        public void send(common.commandline.response.CommandResult result,
        +                 java.net.InetAddress address,
        +                 int port)
        +
      • +
      + + + +
        +
      • +

        receive

        +
        public void receive(common.collection.PeopleDatabase peopleDatabase)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/Lab5Server/build/docs/javadoc/server/net/package-frame.html b/Lab5Server/build/docs/javadoc/server/net/package-frame.html new file mode 100644 index 0000000..80ae5bb --- /dev/null +++ b/Lab5Server/build/docs/javadoc/server/net/package-frame.html @@ -0,0 +1,19 @@ + + + + + +server.net (Lab5Server 2.0 API) + + + + +

server.net

+
+

Classes

+ +
+ + diff --git a/Lab5Server/build/docs/javadoc/server/net/package-summary.html b/Lab5Server/build/docs/javadoc/server/net/package-summary.html new file mode 100644 index 0000000..c4433f5 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/server/net/package-summary.html @@ -0,0 +1,139 @@ + + + + + +server.net (Lab5Server 2.0 API) + + + + + + + + + + +
+

Package server.net

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    UDPServer 
    +
  • +
+
+ + + + + + diff --git a/Lab5Server/build/docs/javadoc/server/net/package-tree.html b/Lab5Server/build/docs/javadoc/server/net/package-tree.html new file mode 100644 index 0000000..ea27878 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/server/net/package-tree.html @@ -0,0 +1,134 @@ + + + + + +server.net Class Hierarchy (Lab5Server 2.0 API) + + + + + + + + + + +
+

Hierarchy For Package server.net

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object + +
  • +
+
+ + + + + + diff --git a/Lab5Server/build/docs/javadoc/server/package-frame.html b/Lab5Server/build/docs/javadoc/server/package-frame.html new file mode 100644 index 0000000..13a4e8c --- /dev/null +++ b/Lab5Server/build/docs/javadoc/server/package-frame.html @@ -0,0 +1,19 @@ + + + + + +server (Lab5Server 2.0 API) + + + + +

server

+
+

Classes

+ +
+ + diff --git a/Lab5Server/build/docs/javadoc/server/package-summary.html b/Lab5Server/build/docs/javadoc/server/package-summary.html new file mode 100644 index 0000000..65b6641 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/server/package-summary.html @@ -0,0 +1,139 @@ + + + + + +server (Lab5Server 2.0 API) + + + + + + + + + + +
+

Package server

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Lab5Server 
    +
  • +
+
+ + + + + + diff --git a/Lab5Server/build/docs/javadoc/server/package-tree.html b/Lab5Server/build/docs/javadoc/server/package-tree.html new file mode 100644 index 0000000..644dc45 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/server/package-tree.html @@ -0,0 +1,134 @@ + + + + + +server Class Hierarchy (Lab5Server 2.0 API) + + + + + + + + + + +
+

Hierarchy For Package server

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/Lab5Server/build/docs/javadoc/stylesheet.css b/Lab5Server/build/docs/javadoc/stylesheet.css new file mode 100644 index 0000000..98055b2 --- /dev/null +++ b/Lab5Server/build/docs/javadoc/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/Lab5Server/build/libs/Lab5Server-2.0.jar b/Lab5Server/build/libs/Lab5Server-2.0.jar new file mode 100644 index 0000000..9d96d09 Binary files /dev/null and b/Lab5Server/build/libs/Lab5Server-2.0.jar differ diff --git a/Lab5Server/build/libs/connection.properties b/Lab5Server/build/libs/connection.properties new file mode 100644 index 0000000..f5630d4 --- /dev/null +++ b/Lab5Server/build/libs/connection.properties @@ -0,0 +1,2 @@ +hostname=localhost +port=1234 \ No newline at end of file diff --git a/Lab5Server/build/libs/lab5.xml b/Lab5Server/build/libs/lab5.xml new file mode 100644 index 0000000..e69de29 diff --git a/Lab5Server/build/tmp/compileJava/previous-compilation-data.bin b/Lab5Server/build/tmp/compileJava/previous-compilation-data.bin new file mode 100644 index 0000000..fd05344 Binary files /dev/null and b/Lab5Server/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/Lab5Server/build/tmp/jar/MANIFEST.MF b/Lab5Server/build/tmp/jar/MANIFEST.MF new file mode 100644 index 0000000..3c951fd --- /dev/null +++ b/Lab5Server/build/tmp/jar/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: client.Lab5Server + diff --git a/Lab5Server/build/tmp/javadoc/javadoc.options b/Lab5Server/build/tmp/javadoc/javadoc.options new file mode 100644 index 0000000..91a1614 --- /dev/null +++ b/Lab5Server/build/tmp/javadoc/javadoc.options @@ -0,0 +1,9 @@ +-classpath 'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Server\\build\\classes\\java\\main;C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Server\\build\\resources\\main;C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Core\\build\\libs\\Lab5Core-2.0.jar' +-d 'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Server\\build\\docs\\javadoc' +-doctitle 'Lab5Server 2.0 API' +-encoding 'UTF-8' +-notimestamp +-quiet +-windowtitle 'Lab5Server 2.0 API' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Server\\src\\main\\java\\server\\Lab5Server.java' +'C:\\Users\\egor\\IdeaProjects\\Lab5\\Lab5Server\\src\\main\\java\\server\\net\\UDPServer.java' diff --git a/Lab5Server/build/tmp/shadowJar/MANIFEST.MF b/Lab5Server/build/tmp/shadowJar/MANIFEST.MF new file mode 100644 index 0000000..6f371b5 --- /dev/null +++ b/Lab5Server/build/tmp/shadowJar/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: server.Lab5Server + diff --git a/Lab5Server/src/main/java/server/Lab5Server.java b/Lab5Server/src/main/java/server/Lab5Server.java new file mode 100644 index 0000000..638e203 --- /dev/null +++ b/Lab5Server/src/main/java/server/Lab5Server.java @@ -0,0 +1,27 @@ +package server; + +import common.collection.Database; +import common.collection.PeopleDatabase; +import common.parser.ConnectionProperties; +import server.net.UDPServer; + +import java.util.logging.Logger; + +public class Lab5Server { + + public final static Logger logger = Logger.getLogger("Lab5Server"); + + public static void main(String[] args) { + PeopleDatabase peopleDatabase = new PeopleDatabase(logger); + try { + peopleDatabase.load(); + } catch (Database.DatabaseLoadFailedException e) { + System.out.println(e.getMessage()); + System.exit(-1); + } + UDPServer udp = new UDPServer(ConnectionProperties.getHostname(), ConnectionProperties.getPort(), logger); + if (!udp.connect()) System.exit(-1); + while (true) + udp.receive(peopleDatabase); + } +} diff --git a/Lab5Server/src/main/java/server/net/UDPServer.java b/Lab5Server/src/main/java/server/net/UDPServer.java new file mode 100644 index 0000000..ee09deb --- /dev/null +++ b/Lab5Server/src/main/java/server/net/UDPServer.java @@ -0,0 +1,96 @@ +package server.net; + +import common.collection.PeopleDatabase; +import common.commandline.Executable; +import common.commandline.response.CommandResult; +import common.commandline.response.DefaultResponse; + +import java.io.*; +import java.net.*; +import java.util.logging.Logger; + +public class UDPServer { + + private String hostname; + private final int port; + private DatagramSocket socket; + private final Logger logger; + + public UDPServer(int port, Logger logger) { + this.port = port; + this.logger = logger; + } + + public UDPServer(String hostname, int port, Logger logger) { + this.hostname = hostname; + this.port = port; + this.logger = logger; + } + + public boolean connect() { + logger.info("Подключаемся..."); + try { + InetAddress address = hostname == null ? InetAddress.getLocalHost() : InetAddress.getByName(hostname); + socket = new DatagramSocket(port); + logger.info("Подключение установлено"); + return true; + } catch (UnknownHostException e) { + logger.severe("Хост не найден"); + return false; + } catch (SocketException e) { + logger.severe("Не удалось открыть сокет"); + return false; + } + } + + public void disconnect() { + logger.info("Разрываем соединение..."); + socket.close(); + logger.info("Соединение разорвано"); + } + + public void send(CommandResult result, InetAddress address, int port) { + byte[] buffer; + try ( + ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream(); + ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteOutputStream) + ) { + objectOutputStream.writeObject(result); + buffer = byteOutputStream.toByteArray(); + DatagramPacket request = new DatagramPacket(buffer, buffer.length, address, port); + socket.send(request); + } catch (IOException e) { + logger.severe("Не удалось отправить данные клиенту, неполадки в соединении"); + } + logger.info("Результат отправлен клиенту"); + } + + public void receive(PeopleDatabase peopleDatabase) { + logger.info("Ожидаем отправки данных от клиента..."); + byte[] buffer = new byte[65535]; + DatagramPacket request = new DatagramPacket(buffer, buffer.length); + CommandResult result; + try (ByteArrayInputStream byteInputStream = new ByteArrayInputStream(buffer)) { + socket.receive(request); + logger.info("Данные получены, выполняем команду..."); + ObjectInputStream objectInputStream = new ObjectInputStream(byteInputStream); + Executable command = (Executable) objectInputStream.readObject(); + Object[] args = (Object[]) objectInputStream.readObject(); + objectInputStream.close(); + if (args[0] == null) args[0] = peopleDatabase; + result = command.execute(args); + } catch (IOException e) { + logger.info("Не удалось преобразовать полученные данные, данные были повреждены во время передачи"); + result = new CommandResult(null, DefaultResponse.SERVER_ERROR); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + logger.info("Не удалось преобразовать полученные данные, классов полученных объектов не существует"); + result = new CommandResult(null, DefaultResponse.CLASS_NOT_FOUND); + } catch (ClassCastException e) { + logger.info("Не удалось преобразовать полученные данные, ожидались объекты другого типа"); + result = new CommandResult(null, DefaultResponse.TYPE_ERROR); + } + logger.info("Команда выполнена, отправляем результат клиенту..."); + send(result, request.getAddress(), request.getPort()); + } +} diff --git a/build.gradle.kts b/build.gradle.kts index 16db861..550180a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,9 +2,8 @@ plugins { java } -group = "ru.erius" -version = "1.2" -val mainClass = "$group.${name.toLowerCase()}.$name" +group = "ru.erius.lab5" +version = "2.0" repositories { mavenCentral() @@ -13,8 +12,6 @@ repositories { dependencies { testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") - compileOnly("org.projectlombok:lombok:1.18.22") - annotationProcessor("org.projectlombok:lombok:1.18.22") } tasks.getByName("test") { @@ -22,18 +19,9 @@ tasks.getByName("test") { } tasks.compileJava { - options.encoding = "UTF-8" + options.encoding = "windows-1252" } tasks.javadoc { options.encoding = "UTF-8" } - -tasks.jar { - manifest { - attributes( - "Manifest-Version" to "1.0", - "Main-Class" to mainClass - ) - } -} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..005e033 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +org.gradle.jvmargs=-Dfile.encoding=UTF-8 diff --git a/lab5.xml b/lab5.xml new file mode 100644 index 0000000..e69de29 diff --git a/settings.gradle.kts b/settings.gradle.kts index 83cd3e8..99106f6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,2 +1,2 @@ rootProject.name = "Lab5" - +include("Lab5Client", "Lab5Server", "Lab5Core") diff --git a/src/main/java/ru/erius/lab5/Lab5.java b/src/main/java/ru/erius/lab5/Lab5.java deleted file mode 100644 index 7de6065..0000000 --- a/src/main/java/ru/erius/lab5/Lab5.java +++ /dev/null @@ -1,25 +0,0 @@ -package ru.erius.lab5; - -import ru.erius.lab5.collection.Database; -import ru.erius.lab5.collection.PeopleDatabase; -import ru.erius.lab5.commandline.CommandLineHandler; -import ru.erius.lab5.commandline.PeopleDatabaseCommands; - -public class Lab5 { - - public static void main(String[] args) { - CommandLineHandler cmd = CommandLineHandler.getInstance(); - - PeopleDatabaseCommands.registerDatabaseCommands(); - PeopleDatabase peopleDatabase = new PeopleDatabase(); - try { - peopleDatabase.load(); - } catch (Database.DatabaseLoadFailedException e) { - System.out.println(e.getMessage()); - System.exit(-1); - } - PeopleDatabaseCommands.setPeopleDatabase(peopleDatabase); - - cmd.start(); - } -} diff --git a/src/main/java/ru/erius/lab5/commandline/Command.java b/src/main/java/ru/erius/lab5/commandline/Command.java deleted file mode 100644 index 4690e9e..0000000 --- a/src/main/java/ru/erius/lab5/commandline/Command.java +++ /dev/null @@ -1,10 +0,0 @@ -package ru.erius.lab5.commandline; - -/** - * Функциональный интерфейс с одним методом {@link #execute(String[])}, - * используется для реализации шаблон проектирования Command - */ -@FunctionalInterface -public interface Command { - void execute(String[] args); -} diff --git a/src/main/java/ru/erius/lab5/commandline/DescriptiveCommand.java b/src/main/java/ru/erius/lab5/commandline/DescriptiveCommand.java deleted file mode 100644 index 39d2fa3..0000000 --- a/src/main/java/ru/erius/lab5/commandline/DescriptiveCommand.java +++ /dev/null @@ -1,15 +0,0 @@ -package ru.erius.lab5.commandline; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NonNull; - -/** - * Класс команд с описанием, оболочка для обычных команд, используются для корректной работы команды help - */ -@Data @AllArgsConstructor -public class DescriptiveCommand { - @NonNull - private final Command command; - private final String desc; -} diff --git a/src/main/java/ru/erius/lab5/commandline/PeopleDatabaseCommands.java b/src/main/java/ru/erius/lab5/commandline/PeopleDatabaseCommands.java deleted file mode 100644 index 36c1903..0000000 --- a/src/main/java/ru/erius/lab5/commandline/PeopleDatabaseCommands.java +++ /dev/null @@ -1,235 +0,0 @@ -package ru.erius.lab5.commandline; - -import ru.erius.lab5.collection.Database; -import ru.erius.lab5.collection.PeopleDatabase; -import ru.erius.lab5.data.*; -import ru.erius.lab5.util.UtilFunctions; - -import java.util.Arrays; -import java.util.Collections; -import java.util.Locale; -import java.util.Optional; - -import static ru.erius.lab5.commandline.CommandRegistry.*; - -/** - * Класс объявления всех команд, связанных с манипуляциями над объектом класса PeopleDatabase - * - * @see PeopleDatabase - */ -public final class PeopleDatabaseCommands { - - private static PeopleDatabase peopleDatabase; - private static final String COLORS = Arrays.toString(Color.values()), - COUNTRIES = Arrays.toString(Country.values()); - private static final CommandLineHandler CMD = CommandLineHandler.getInstance(); - - private PeopleDatabaseCommands() {} - - /** - * Метод добавления всех команд в регистр команд, обязательно вызывайте его в своей программе, - * если вам требуются данные команды - */ - public static void registerDatabaseCommands() { - registerCommand("info", args -> info(peopleDatabase), - "info : вывести в стандартный поток вывода информацию о коллекции (тип, дата инициализации, количество элементов и т.д.)"); - registerCommand("show", args -> show(peopleDatabase), - "show : вывести в стандартный поток вывода все элементы коллекции в строковом представлении"); - registerCommand("add", args -> add(peopleDatabase), - "add : добавить новый элемент в коллекцию"); - registerCommand("update", args -> update(peopleDatabase, args), - "update {id} : обновить значение элемента коллекции, {id} которого равен заданному"); - registerCommand("remove_by_id", args -> remove(peopleDatabase, args), - "remove_by_id {id} : удалить элемент из коллекции по его {id}"); - registerCommand("clear", args -> clear(peopleDatabase), - "clear : очистить коллекцию"); - registerCommand("save", args -> save(peopleDatabase), - "save : сохранить коллекцию в файл"); - registerCommand("add_if_max", args -> addIfMax(peopleDatabase), - "add_if_max : добавить новый элемент в коллекцию, если его значение превышает значение наибольшего элемента этой коллекции"); - registerCommand("add_if_min", args -> addIfMin(peopleDatabase), - "add_if_min : добавить новый элемент в коллекцию, если его значение меньше, чем у наименьшего элемента этой коллекции"); - registerCommand("sum_of_height", args -> sumOfHeight(peopleDatabase), - "sum_of_height : вывести сумму значений поля height для всех элементов коллекции"); - registerCommand("filter_contains_name", args -> filterContainsName(peopleDatabase, args), - "filter_contains_name {name} : вывести элементы, значение поля name которых содержит заданную подстроку"); - registerCommand("print_field_descending_location", args -> printFieldDescendingLocation(peopleDatabase), - "print_field_descending_location : вывести значения поля location всех элементов в порядке убывания"); - } - - public static void setPeopleDatabase(PeopleDatabase peopleDatabase) { - PeopleDatabaseCommands.peopleDatabase = peopleDatabase; - } - - public static void info(PeopleDatabase peopleDatabase) { - System.out.println(peopleDatabase.info()); - } - - public static void show(PeopleDatabase peopleDatabase) { - System.out.println("Элементы коллекции:\n"); - peopleDatabase.getCollection().forEach(p -> System.out.println(p.formatted())); - } - - public static void add(PeopleDatabase peopleDatabase) { - Person person = createPerson(); - boolean success = peopleDatabase.getCollection().add(person); - System.out.println(success ? "Человек успешно добавлен в коллекцию" : "Не удалось добавить человека в коллекцию"); - } - - public static void update(PeopleDatabase peopleDatabase, String[] args) { - Long id = getIdOrNull(args); - if (id == null) return; - - Optional optionalPerson = peopleDatabase.getCollection() - .stream() - .filter(p -> p.getId().equals(id)) - .findFirst(); - if (!optionalPerson.isPresent()) { - System.out.println("Человек с {id} " + id + " не был найден"); - return; - } - Person oldPerson = optionalPerson.get(); - peopleDatabase.getCollection().remove(oldPerson); - - Person newPerson = createPerson(); - oldPerson.update(newPerson); - peopleDatabase.getCollection().add(oldPerson); - System.out.println("Человек с {id} " + oldPerson.getId() + " был успешно изменен"); - } - - public static void remove(PeopleDatabase peopleDatabase, String[] args) { - Long id = getIdOrNull(args); - if (id == null) return; - boolean success = peopleDatabase.getCollection().removeIf(p -> p.getId().equals(id)); - System.out.println("Человек с {id} " + id + " " + (success ? "был успешно удален" : "не был найден")); - } - - public static void clear(PeopleDatabase peopleDatabase) { - peopleDatabase.getCollection().clear(); - System.out.println("Коллекция была очищена"); - } - - public static void save(PeopleDatabase peopleDatabase) { - try { - peopleDatabase.save(); - System.out.println("Коллекция была успешно сохранена"); - } catch (Database.DatabaseSaveFailedException e) { - System.out.println(e.getMessage()); - } - } - - public static void addIfMax(PeopleDatabase peopleDatabase) { - Person person = createPerson(); - Person last = peopleDatabase.getCollection().last(); - if (person.compareTo(last) > 0) { - peopleDatabase.getCollection().add(person); - System.out.println("Человек успешно добавлен в коллекцию"); - return; - } - System.out.println("Не удалось добавить человека в коллекцию"); - } - - public static void addIfMin(PeopleDatabase peopleDatabase) { - Person person = createPerson(); - Person first = peopleDatabase.getCollection().first(); - if (person.compareTo(first) < 0) { - peopleDatabase.getCollection().add(person); - System.out.println("Человек успешно добавлен в коллекцию"); - return; - } - System.out.println("Не удалось добавить человека в коллекцию"); - } - - public static void sumOfHeight(PeopleDatabase peopleDatabase) { - int sum = peopleDatabase.getCollection() - .stream() - .mapToInt(p -> p.getHeight() == null ? 0 : p.getHeight()) - .sum(); - System.out.println("Сумма ростов всех людей в коллекции - " + sum); - } - - public static void filterContainsName(PeopleDatabase peopleDatabase, String[] args) { - if (args.length < 1) { - System.out.println("Недостаточно данных"); - return; - } - - String name = args[0]; - System.out.println("Список людей, в имени которых содержится " + name + ":"); - peopleDatabase.getCollection() - .stream() - .filter(p -> p.getName().contains(name)) - .forEach(System.out::println); - } - - public static void printFieldDescendingLocation(PeopleDatabase peopleDatabase) { - System.out.println("Список локаций в порядке убывания"); - peopleDatabase.getCollection() - .stream() - .map(Person::getLocation) - .sorted(Collections.reverseOrder()) - .forEach(System.out::println); - } - - private static Long getIdOrNull(String[] args) { - if (args.length < 1) { - System.out.println("Недостаточно данных"); - return null; - } - - Long id = UtilFunctions.longOrNull(args[0]); - if (id == null) { - System.out.println("{id} должен быть целым числом"); - return null; - } - - return id; - } - - public static Person createPerson() { - System.out.println("Создание нового объекта класса Person"); - String name = CMD.awaitInput("Введите имя:", "Введите непустую строку", - input -> !input.isEmpty()); - Integer height = CMD.awaitInput("Введите рост:", "Введите целое число, большее нуля", - input -> { - Integer result = UtilFunctions.intOrNull(input); - return result != null && result > 0 || input.isEmpty(); - }, input -> input.isEmpty() ? null : Integer.parseInt(input)); - String passportID = CMD.awaitInput("Введите номер паспорта:", "Введите минимум 8 символов", - input -> input.length() >= 8 || input.isEmpty(), input -> input.isEmpty() ? null : input); - Color eyeColor = CMD.awaitInput("Введите цвет глаз " + COLORS + ":", "Введите один из предложенных цветов", - input -> UtilFunctions.enumOrNull(input.toUpperCase(Locale.ROOT), Color.class) != null, - input -> Color.valueOf(input.toUpperCase(Locale.ROOT))); - Country nationality = CMD.awaitInput("Введите национальность " + COUNTRIES + ":", "Введите одну из предложенных стран", - input -> UtilFunctions.enumOrNull(input.toUpperCase(Locale.ROOT), Country.class) != null, - input -> Country.valueOf(input.toUpperCase(Locale.ROOT))); - Location location = createLocation(); - Coordinates coordinates = createCoordinates(); - return new Person(name, coordinates, height, passportID, eyeColor, nationality, location); - } - - public static Location createLocation() { - System.out.println("Создание нового объекта класса Location"); - double x = CMD.awaitInput("Введите x:", "Введите дробное число", - input -> UtilFunctions.doubleOrNull(input) != null, Double::parseDouble); - float y = CMD.awaitInput("Введите y:", "Введите дробное число", - input -> UtilFunctions.floatOrNull(input) != null, Float::parseFloat); - long z = CMD.awaitInput("Введите z:", "Введите целое число", - input -> UtilFunctions.longOrNull(input) != null, Long::parseLong); - String name = CMD.awaitInput("Введите название:", "Строка не может быть пустой", - input -> true, input -> input.isEmpty() ? null : input); - return new Location(x, y, z, name); - } - - public static Coordinates createCoordinates() { - System.out.println("Создание нового объекта класса Coordinates"); - float x = CMD.awaitInput("Введите x:", "Введите дробное число", - input -> UtilFunctions.floatOrNull(input) != null, Float::parseFloat); - float y = CMD.awaitInput("Введите y:", "Введите дробное число, большее -816", - input -> { - Float result = UtilFunctions.floatOrNull(input); - return result != null && result > -816F; - }, Float::parseFloat); - return new Coordinates(x, y); - } -} diff --git a/src/main/java/ru/erius/lab5/data/Color.java b/src/main/java/ru/erius/lab5/data/Color.java deleted file mode 100644 index 3576102..0000000 --- a/src/main/java/ru/erius/lab5/data/Color.java +++ /dev/null @@ -1,10 +0,0 @@ -package ru.erius.lab5.data; - -/** - * Перечисление цветов - */ -public enum Color { - BLACK, - ORANGE, - BROWN -}