This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level31.lesson02.home01; | |
import java.io.*; | |
import java.util.*; | |
/* Проход по дереву файлов | |
1. На вход метода main подаются два параметра. | |
Первый - path - путь к директории, второй - resultFileAbsolutePath - имя файла, который будет содержать результат. | |
2. Для каждого файла в директории path и в ее всех вложенных поддиректориях выполнить следующее: | |
2.1. Если у файла длина в байтах больше 50, то удалить его. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level30.lesson15.big01; | |
import java.io.Closeable; | |
import java.io.IOException; | |
import java.io.ObjectInputStream; | |
import java.io.ObjectOutputStream; | |
import java.net.Socket; | |
import java.net.SocketAddress; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level30.lesson08.home01; | |
public class Pair { | |
private int x; | |
private int y; | |
public Pair(int x, int y) { | |
this.x = x; | |
this.y = y; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level30.lesson08.task01; | |
/* Найдем число 2 в максимальной степени | |
Реализуйте логику метода maxPowerOf2, | |
который должен возвращать число 2 в максимальной степени, которое получается поместить в переданное число | |
Аргументом maxPowerOf2 может быть только положительное число | |
Используйте только операции: 1)побитовые сдвиги, 2) присваивание, 3) побитовое ИЛИ | |
Не оставляйте комментарии | |
*/ | |
public class Solution { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level30.lesson06.home01; | |
import java.util.concurrent.RecursiveTask; | |
/** | |
* Created by FarAway on 10.03.2016. | |
*/ | |
public class BinaryRepresentationTask extends RecursiveTask<String> { | |
private int x; | |
public BinaryRepresentationTask(int x) { this.x = x;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level30.lesson06.task01; | |
import java.util.ArrayList; | |
import java.util.List; | |
/* Такие хитрые исключения! | |
Исправьте реализацию метода checkAFlag, чтобы во всех случаях он не приводил к бросанию исключений. | |
Сохраните логику вывода данных. | |
Метод main не участвует в тестировании. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level30.lesson04.home01; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.TransferQueue; | |
/** | |
* Created by FarAway on 10.03.2016. | |
*/ | |
public class Consumer implements Runnable { | |
private TransferQueue<ShareItem> queue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level30.lesson02.home01; | |
import java.util.Objects; | |
public class Number { | |
private NumerationSystem numerationSystem; | |
private String digit; | |
public Number(NumerationSystem numerationSystem, String digit) { | |
this.numerationSystem = numerationSystem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level29.lesson15.big01.car; | |
/** | |
* Created by FarAway on 09.03.2016. | |
*/ | |
public class Cabriolet extends Car { | |
public Cabriolet(int numberOfPassengers) { | |
super(Car.CABRIOLET, numberOfPassengers); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level29.lesson09.bonus01; | |
import java.util.concurrent.*; | |
/* Argument and Value are generic types*/ | |
public class CacheComputeManager<Argument, Value> implements Computable<Argument, Value> { | |
private final ConcurrentHashMap<Argument, Future<Value>> cache = new ConcurrentHashMap<>(); | |
private final Computable<Argument, Value> computable; | |
private final ExecutorService service = Executors.newFixedThreadPool(5); |
NewerOlder