esoe
2 years ago
commit
694a338b3a
7 changed files with 178 additions and 0 deletions
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 |
||||
http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
||||
<!-- parent pom --> |
||||
<parent> |
||||
<artifactId>education</artifactId> |
||||
<groupId>ru.molokoin</groupId> |
||||
<version>1.0</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<!-- country info --> |
||||
<groupId>ru.molokoin.education</groupId> |
||||
<artifactId>book</artifactId> |
||||
<version>1.0</version> |
||||
<packaging>jar</packaging> |
||||
|
||||
</project> |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
package book.ru.molokoin; |
||||
|
||||
public class App { |
||||
|
||||
} |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 |
||||
http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
||||
<!-- parent pom --> |
||||
<parent> |
||||
<artifactId>education</artifactId> |
||||
<groupId>ru.molokoin</groupId> |
||||
<version>1.0</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<!-- country info --> |
||||
<groupId>ru.molokoin.education</groupId> |
||||
<artifactId>country</artifactId> |
||||
<version>1.0</version> |
||||
<packaging>jar</packaging> |
||||
|
||||
</project> |
@ -0,0 +1,53 @@
@@ -0,0 +1,53 @@
|
||||
package country.ru.molokoin; |
||||
|
||||
public class Area { |
||||
private String name; |
||||
private int population; |
||||
private int square; |
||||
|
||||
Area(){} |
||||
Area(String name, int population, int square){ |
||||
setName(name); |
||||
setPopulation(population); |
||||
setSquare(square); |
||||
} |
||||
|
||||
/** |
||||
* @param name the name to set |
||||
*/ |
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
/** |
||||
* @param population the population to set |
||||
*/ |
||||
public void setPopulation(int population) { |
||||
this.population = population; |
||||
} |
||||
/** |
||||
* @param square the square to set |
||||
*/ |
||||
public void setSquare(int square) { |
||||
if (square < 0) throw new IllegalArgumentException("площадь не может быть отрицательной ..."); |
||||
this.square = square; |
||||
} |
||||
|
||||
/** |
||||
* @return the name |
||||
*/ |
||||
public String getName() { |
||||
return name; |
||||
} |
||||
/** |
||||
* @return the population |
||||
*/ |
||||
public int getPopulation() { |
||||
return population; |
||||
} |
||||
/** |
||||
* @return the square |
||||
*/ |
||||
public int getSquare() { |
||||
return square; |
||||
} |
||||
} |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
package country.ru.molokoin; |
||||
|
||||
public class Country extends Area{ |
||||
private Area capital; |
||||
|
||||
Country(String name, int population, int square, String capitalName, int capitalPopulation, int capitalSquare){ |
||||
setCapital(capitalName, capitalPopulation, capitalSquare); |
||||
setName(name); |
||||
setPopulation(population); |
||||
setSquare(square); |
||||
} |
||||
|
||||
/** |
||||
* @param сapital the сapital to set |
||||
*/ |
||||
public void setCapital(String name, int population, int square) { |
||||
this.capital = new Area(name, population, square); |
||||
} |
||||
|
||||
/** |
||||
* @return the сapital |
||||
*/ |
||||
public Area getCapital() { |
||||
return capital; |
||||
} |
||||
|
||||
public static void main(String[] args) { |
||||
System.out.println("Country.main()"); |
||||
|
||||
} |
||||
} |
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
package country.ru.molokoin; |
||||
|
||||
public class Map { |
||||
private Country[] map;// = new Country[5];
|
||||
public void initDefaults(){ |
||||
map = new Country[5]; |
||||
map[0].setName("Russia"); |
||||
} |
||||
public static void main(String[] args) { |
||||
System.out.println("App.main()"); |
||||
} |
||||
} |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 |
||||
http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<!-- parent pom --> |
||||
<groupId>ru.molokoin</groupId> |
||||
<artifactId>education</artifactId> |
||||
<packaging>pom</packaging> |
||||
<version>1.0</version> |
||||
|
||||
<!-- sub modules --> |
||||
<modules> |
||||
<module>country</module> |
||||
<module>book</module> |
||||
</modules> |
||||
|
||||
<build> |
||||
<plugins> |
||||
<plugin> |
||||
<groupId>org.apache.maven.plugins</groupId> |
||||
<artifactId>maven-surefire-plugin</artifactId> |
||||
<version>2.22.0</version> |
||||
</plugin> |
||||
<plugin> |
||||
<groupId>org.apache.maven.plugins</groupId> |
||||
<artifactId>maven-dependency-plugin</artifactId> |
||||
<version>3.1.1</version> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
|
||||
</project> |
Loading…
Reference in new issue