util
-
Blocking Queue example to execute commands
import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; private BlockingQueue<Command> workQueue = new LinkedBlockingQueue<Command>(); public void addCommand(Command command) { workQueue.offer(command); } public Object call()…
Read More » -
Reentrant Lock example of a task runner
With this example we are going to demonstrate how to implement a ReentrantLock of a task runner. The ReentrantLock is…
Read More » -
Reentrant ReadWriteLock example of value calculator
This is an example of how to use a ReentrantReadWriteLock of a value calculator. We have implemented a method that…
Read More » -
Semaphores example limiting URL connections
In this example we shall show you how to use a Semaphore for limiting URL connections. We have implemented a…
Read More » -
Exchanger example passing logs to a background logger
With this example we are going to demonstrate how to create an Exchanger passing logs to a background logger. We…
Read More » -
Store preferences to user space
This is an example of how to store Preferences to user space. The Preferences class allows applications to store and retrieve…
Read More » -
Read preferences from user space
In this example we shall show you how to read the Preferences from user space. To read the Preferences from…
Read More » -
Simple validation example
In this example we shall show you how to make a simple validation of a String, using a Matcher against…
Read More » -
Find duplication in strings example
With this example we are going to demonstrate how to find duplication in Strings. In order to check if there…
Read More » -
Determine if a string matches a pattern exactly
This is an example of how to determine if a String matches to a Pattern exactly. Using a Matcher to…
Read More »