Skip to content

Commit

Permalink
Изменена структура
Browse files Browse the repository at this point in the history
  • Loading branch information
Pastor committed Dec 4, 2024
1 parent 99a0595 commit 72cbc0d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<module>vol3</module>
<module>vol4</module>
<module>vol5</module>
<module>vol6</module>
</modules>

<dependencyManagement>
Expand Down
15 changes: 15 additions & 0 deletions vol6/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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>
<groupId>ru.mifi.practice</groupId>
<artifactId>AaDS</artifactId>
<version>2024.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>vol6</artifactId>
<name>vol6</name>
<description>Модуль №6. Деревья</description>

</project>
32 changes: 32 additions & 0 deletions vol6/src/main/java/ru/mifi/practice/vol6/Counter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package ru.mifi.practice.vol5;

import java.util.concurrent.atomic.AtomicInteger;

public interface Counter {
void increment();

void reset();

static Counter create() {
return new Default();
}

final class Default implements Counter {
private final AtomicInteger count = new AtomicInteger(0);

@Override
public void increment() {
count.incrementAndGet();
}

@Override
public void reset() {
count.set(0);
}

@Override
public String toString() {
return String.valueOf(count.intValue());
}
}
}

0 comments on commit 72cbc0d

Please sign in to comment.