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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package org; | |
import java.util.LinkedList; | |
import java.util.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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package org; | |
import java.util.LinkedList; | |
import java.util.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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package org; | |
import java.util.LinkedList; | |
import java.util.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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package org; | |
import java.util.LinkedList; | |
import java.util.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 org; | |
import java.util.LinkedList; | |
import java.util.Queue; | |
public class Queues { | |
public static <E> Queue<E> split(Queue<E> queue) { | |
Queue<E> myQueue = new LinkedList<>(); | |
if (queue.isEmpty()) { | |
return myQueue; |
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
import java.util.*; | |
public class SetListPerformanceTest { | |
static final int N = 50000; | |
public static void main(String[] args) { | |
// Add numbers 0, 1, 2, ..., N - 1 to the array list | |
List<Integer> list = new ArrayList<Integer>(); | |
for (int i = 0; i < N; i++) | |
list.add(i); |
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
import java.util.concurrent.ArrayBlockingQueue; | |
import java.util.concurrent.BlockingQueue; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import org.common.AppLogger; | |
import org.processor.DataFilter; | |
import org.processor.FileReader; | |
import org.processor.FileWriter; |
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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package org.processor; | |
import org.common.AppLogger; | |
import java.io.BufferedWriter; | |
import java.io.File; |
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
public enum Planet { | |
MERCURY (3.303e+23, 2.4397e6), | |
VENUS (4.869e+24, 6.0518e6), | |
EARTH (5.976e+24, 6.37814e6), | |
MARS (6.421e+23, 3.3972e6), | |
JUPITER (1.9e+27, 7.1492e7), | |
SATURN (5.688e+26, 6.0268e7), | |
URANUS (8.686e+25, 2.5559e7), | |
NEPTUNE (1.024e+26, 2.4746e7); |
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
public enum Planet { | |
MERCURY (3.303e+23, 2.4397e6), | |
VENUS (4.869e+24, 6.0518e6), | |
EARTH (5.976e+24, 6.37814e6), | |
MARS (6.421e+23, 3.3972e6), | |
JUPITER (1.9e+27, 7.1492e7), | |
SATURN (5.688e+26, 6.0268e7), | |
URANUS (8.686e+25, 2.5559e7), | |
NEPTUNE (1.024e+26, 2.4746e7); |
OlderNewer