Improve Javadoc

This commit is contained in:
baislsl 2018-02-19 22:01:14 +08:00
parent d78434fed8
commit 991ba320a6
30 changed files with 88 additions and 80 deletions

View File

@ -52,12 +52,12 @@ import org.slf4j.LoggerFactory;
* whether the data is coming from the cache or the DB (i.e. separation of concern). The AppManager * whether the data is coming from the cache or the DB (i.e. separation of concern). The AppManager
* ({@link AppManager}) handles the transaction of data to-and-from the underlying data store * ({@link AppManager}) handles the transaction of data to-and-from the underlying data store
* (depending on the preferred caching policy/strategy). * (depending on the preferred caching policy/strategy).
* * <p>
* <i>App --> AppManager --> CacheStore/LRUCache/CachingPolicy --> DBManager</i> * <i>{@literal App --> AppManager --> CacheStore/LRUCache/CachingPolicy --> DBManager} </i>
* </p> * </p>
* *
* @see CacheStore * @see CacheStore
* @See LRUCache * @see LruCache
* @see CachingPolicy * @see CachingPolicy
* *
*/ */

View File

@ -31,7 +31,7 @@ import java.util.stream.Stream;
/** /**
* An in memory implementation of {@link CustomerDao}, which stores the customers in JVM memory * An in memory implementation of {@link CustomerDao}, which stores the customers in JVM memory
* and data is lost when the application exits. * and data is lost when the application exits.
* <br/> * <br>
* This implementation is useful as temporary database or for testing. * This implementation is useful as temporary database or for testing.
*/ */
public class InMemoryCustomerDao implements CustomerDao { public class InMemoryCustomerDao implements CustomerDao {

View File

@ -34,8 +34,7 @@ import java.time.LocalDateTime;
/** /**
* The Data Bus pattern * The Data Bus pattern
* <p> * <p>
* <p>{@see http://wiki.c2.com/?DataBusPattern}</p> * @see <a href="http://wiki.c2.com/?DataBusPattern">http://wiki.c2.com/?DataBusPattern</a>
* <p>
* <p>The Data-Bus pattern provides a method where different parts of an application may * <p>The Data-Bus pattern provides a method where different parts of an application may
* pass messages between each other without needing to be aware of the other's existence.</p> * pass messages between each other without needing to be aware of the other's existence.</p>
* <p>Similar to the {@code ObserverPattern}, members register themselves with the {@link DataBus} * <p>Similar to the {@code ObserverPattern}, members register themselves with the {@link DataBus}

View File

@ -33,7 +33,7 @@ import com.iluwatar.eda.model.User;
/** /**
* An event-driven architecture (EDA) is a framework that orchestrates behavior around the * An event-driven architecture (EDA) is a framework that orchestrates behavior around the
* production, detection and consumption of events as well as the responses they evoke. An event is * production, detection and consumption of events as well as the responses they evoke. An event is
* any identifiable occurrence that has significance for system hardware or software. <p/> The * any identifiable occurrence that has significance for system hardware or software. <p> The
* example below uses an {@link EventDispatcher} to link/register {@link Event} objects to their * example below uses an {@link EventDispatcher} to link/register {@link Event} objects to their
* respective handlers once an {@link Event} is dispatched, it's respective handler is invoked and * respective handlers once an {@link Event} is dispatched, it's respective handler is invoked and
* the {@link Event} is handled accordingly. * the {@link Event} is handled accordingly.

View File

@ -45,7 +45,7 @@ public class App {
/** /**
* Program entry point. * Program entry point.
* *
* @param args @param args command line args * @param args command line args
*/ */
public static void main(String[] args) { public static void main(String[] args) {
WeaponFactory factory = WeaponFactory.factory(builder -> { WeaponFactory factory = WeaponFactory.factory(builder -> {

View File

@ -67,7 +67,7 @@ public class App {
* @see UserGroup * @see UserGroup
* @see Service * @see Service
* @see PropertiesFeatureToggleVersion * @see PropertiesFeatureToggleVersion
* @see com.iluwatar.featuretoggle.pattern.tieredversion.TieredFeatureToggleVersion; * @see com.iluwatar.featuretoggle.pattern.tieredversion.TieredFeatureToggleVersion
*/ */
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -47,7 +47,7 @@ public interface Service {
/** /**
* Returns if the welcome message to be displayed will be the enhanced version. * Returns if the welcome message to be displayed will be the enhanced version.
* *
* @return Boolean {@value true} if enhanced. * @return Boolean {@code true} if enhanced.
*/ */
boolean isEnhanced(); boolean isEnhanced();

View File

@ -91,7 +91,7 @@ public class PropertiesFeatureToggleVersion implements Service {
* see the value of the boolean that was set in the constructor * see the value of the boolean that was set in the constructor
* {@link PropertiesFeatureToggleVersion#PropertiesFeatureToggleVersion(Properties)} * {@link PropertiesFeatureToggleVersion#PropertiesFeatureToggleVersion(Properties)}
* *
* @return Boolean value {@value true} if enhanced. * @return Boolean value {@code true} if enhanced.
*/ */
@Override @Override
public boolean isEnhanced() { public boolean isEnhanced() {

View File

@ -65,7 +65,7 @@ public class TieredFeatureToggleVersion implements Service {
* is driven by the user group. This method is a little redundant. However can be used to show that there is an * is driven by the user group. This method is a little redundant. However can be used to show that there is an
* enhanced version available. * enhanced version available.
* *
* @return Boolean value {@value true} if enhanced. * @return Boolean value {@code true} if enhanced.
*/ */
@Override @Override
public boolean isEnhanced() { public boolean isEnhanced() {

View File

@ -32,7 +32,7 @@ import java.util.Queue;
* Guarded Queue is an implementation for Guarded Suspension Pattern * Guarded Queue is an implementation for Guarded Suspension Pattern
* Guarded suspension pattern is used to handle a situation when you want to execute a method * Guarded suspension pattern is used to handle a situation when you want to execute a method
* on an object which is not in a proper state. * on an object which is not in a proper state.
* @see http://java-design-patterns.com/patterns/guarded-suspension/ * @see <a href="http://java-design-patterns.com/patterns/guarded-suspension/">http://java-design-patterns.com/patterns/guarded-suspension/</a>
*/ */
public class GuardedQueue { public class GuardedQueue {
private static final Logger LOGGER = LoggerFactory.getLogger(GuardedQueue.class); private static final Logger LOGGER = LoggerFactory.getLogger(GuardedQueue.class);

View File

@ -33,31 +33,31 @@ import java.util.concurrent.LinkedBlockingQueue;
* {@link AsyncTask} and {@link AsynchronousService}. * {@link AsyncTask} and {@link AsynchronousService}.
* *
* <p> * <p>
* <i>PROBLEM</i> <br/> * <i>PROBLEM</i> <br>
* A concurrent system have a mixture of short duration, mid duration and long duration tasks. Mid * A concurrent system have a mixture of short duration, mid duration and long duration tasks. Mid
* or long duration tasks should be performed asynchronously to meet quality of service * or long duration tasks should be performed asynchronously to meet quality of service
* requirements. * requirements.
* *
* <p> * <p>
* <i>INTENT</i> <br/> * <i>INTENT</i> <br>
* The intent of this pattern is to separate the the synchronous and asynchronous processing in the * The intent of this pattern is to separate the the synchronous and asynchronous processing in the
* concurrent application by introducing two intercommunicating layers - one for sync and one for * concurrent application by introducing two intercommunicating layers - one for sync and one for
* async. This simplifies the programming without unduly affecting the performance. * async. This simplifies the programming without unduly affecting the performance.
* *
* <p> * <p>
* <i>APPLICABILITY</i> <br/> * <i>APPLICABILITY</i> <br>
* UNIX network subsystems - In operating systems network operations are carried out * UNIX network subsystems - In operating systems network operations are carried out
* asynchronously with help of hardware level interrupts.<br/> * asynchronously with help of hardware level interrupts.<br>
* CORBA - At the asynchronous layer one thread is associated with each socket that is connected * CORBA - At the asynchronous layer one thread is associated with each socket that is connected
* to the client. Thread blocks waiting for CORBA requests from the client. On receiving request it * to the client. Thread blocks waiting for CORBA requests from the client. On receiving request it
* is inserted in the queuing layer which is then picked up by synchronous layer which processes the * is inserted in the queuing layer which is then picked up by synchronous layer which processes the
* request and sends response back to the client.<br/> * request and sends response back to the client.<br>
* Android AsyncTask framework - Framework provides a way to execute long running blocking * Android AsyncTask framework - Framework provides a way to execute long running blocking
* calls, such as downloading a file, in background threads so that the UI thread remains free to * calls, such as downloading a file, in background threads so that the UI thread remains free to
* respond to user inputs.<br/> * respond to user inputs.<br>
* *
* <p> * <p>
* <i>IMPLEMENTATION</i> <br/> * <i>IMPLEMENTATION</i> <br>
* The main method creates an asynchronous service which does not block the main thread while the * The main method creates an asynchronous service which does not block the main thread while the
* task is being performed. The main thread continues its work which is similar to Async Method * task is being performed. The main thread continues its work which is similar to Async Method
* Invocation pattern. The difference between them is that there is a queuing layer between * Invocation pattern. The difference between them is that there is a queuing layer between

View File

@ -50,13 +50,13 @@ import com.iluwatar.hexagonal.sampledata.SampleData;
* from the services it uses.<p> * from the services it uses.<p>
* *
* The primary ports for the application are console interfaces * The primary ports for the application are console interfaces
* {@link ConsoleAdministration} through which the lottery round is * {@link com.iluwatar.hexagonal.administration.ConsoleAdministration} through which the lottery round is
* initiated and run and {@link ConsoleLottery} that allows players to * initiated and run and {@link com.iluwatar.hexagonal.service.ConsoleLottery} that allows players to
* submit lottery tickets for the draw.<p> * submit lottery tickets for the draw.<p>
* *
* The secondary ports that application core uses are {@link WireTransfers} * The secondary ports that application core uses are {@link com.iluwatar.hexagonal.banking.WireTransfers}
* which is a banking service, {@link LotteryEventLog} that delivers * which is a banking service, {@link com.iluwatar.hexagonal.eventlog.LotteryEventLog} that delivers
* eventlog as lottery events occur and {@link LotteryTicketRepository} * eventlog as lottery events occur and {@link com.iluwatar.hexagonal.database.LotteryTicketRepository}
* that is the storage for the lottery tickets. * that is the storage for the lottery tickets.
* *
*/ */

View File

@ -51,14 +51,14 @@ import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchThemeProvid
* See: * See:
* *
* <pre> * <pre>
* &lt;filter> * &lt;filter&gt;
* &lt;filter-name>wicket&lt;/filter-name> * &lt;filter-name&gt;wicket&lt;/filter-name&gt;
* &lt;filter-class>org.apache.wicket.protocol.http.WicketFilter&lt;/filter-class> * &lt;filter-class&gt;org.apache.wicket.protocol.http.WicketFilter&lt;/filter-class&gt;
* &lt;init-param> * &lt;init-param&gt;
* &lt;param-name>applicationClassName&lt;/param-name> * &lt;param-name&gt;applicationClassName&lt;/param-name&gt;
* &lt;param-value>webapp.SimpleApplication&lt;/param-value> * &lt;param-value&gt;webapp.SimpleApplication&lt;/param-value&gt;
* &lt;/init-param> * &lt;/init-param&gt;
* &lt;/filter> * &lt;/filter&gt;
* </pre> * </pre>
* *
*/ */
@ -69,7 +69,7 @@ public class SimpleApplication extends IsisWicketApplication {
/** /**
* uncomment for a (slightly hacky) way of allowing logins using query args, eg: * uncomment for a (slightly hacky) way of allowing logins using query args, eg:
* *
* <tt>?user=sven&pass=pass</tt> * <tt>{@code ?user=sven&pass=pass}</tt>
* *
* <p> * <p>
* for demos only, obvious. * for demos only, obvious.

View File

@ -26,7 +26,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
/** /**
* Generic observer inspired by Java Generics and Collection by Naftalin & Wadler * Generic observer inspired by Java Generics and Collection by {@literal Naftalin & Wadler}
* *
* @param <S> Subject * @param <S> Subject
* @param <O> Observer * @param <O> Observer

View File

@ -39,13 +39,13 @@ import com.iluwatar.reactor.framework.ThreadPoolDispatcher;
* Service where it listens on multiple TCP or UDP sockets for incoming log requests. * Service where it listens on multiple TCP or UDP sockets for incoming log requests.
* *
* <p> * <p>
* <i>INTENT</i> <br/> * <i>INTENT</i> <br>
* The Reactor design pattern handles service requests that are delivered concurrently to an * The Reactor design pattern handles service requests that are delivered concurrently to an
* application by one or more clients. The application can register specific handlers for processing * application by one or more clients. The application can register specific handlers for processing
* which are called by reactor on specific events. * which are called by reactor on specific events.
* *
* <p> * <p>
* <i>PROBLEM</i> <br/> * <i>PROBLEM</i> <br>
* Server applications in a distributed system must handle multiple clients that send them service * Server applications in a distributed system must handle multiple clients that send them service
* requests. Following forces need to be resolved: * requests. Following forces need to be resolved:
* <ul> * <ul>
@ -56,31 +56,36 @@ import com.iluwatar.reactor.framework.ThreadPoolDispatcher;
* </ul> * </ul>
* *
* <p> * <p>
* <i>PARTICIPANTS</i> <br/> * <i>PARTICIPANTS</i> <br>
* <ul> * <ul>
* <li>Synchronous Event De-multiplexer</li> {@link NioReactor} plays the role of synchronous event * <li>Synchronous Event De-multiplexer
* de-multiplexer. It waits for events on multiple channels registered to it in an event loop.
*
* <p> * <p>
* <li>Initiation Dispatcher</li> {@link NioReactor} plays this role as the application specific * {@link NioReactor} plays the role of synchronous event de-multiplexer.
* {@link ChannelHandler}s are registered to the reactor. * It waits for events on multiple channels registered to it in an event loop.
* * </p>
* </li>
* <li>Initiation Dispatcher
* <p> * <p>
* <li>Handle</li> {@link AbstractNioChannel} acts as a handle that is registered to the reactor. * {@link NioReactor} plays this role as the application specific {@link ChannelHandler}s are registered to the reactor.
* </p>
* </li>
* <li>Handle
* <p>
* {@link AbstractNioChannel} acts as a handle that is registered to the reactor.
* When any events occur on a handle, reactor calls the appropriate handler. * When any events occur on a handle, reactor calls the appropriate handler.
* * </p>
* </li>
* <li>Event Handler
* <p> * <p>
* <li>Event Handler</li> {@link ChannelHandler} acts as an event handler, which is bound to a * {@link ChannelHandler} acts as an event handler, which is bound to a
* channel and is called back when any event occurs on any of its associated handles. Application * channel and is called back when any event occurs on any of its associated handles. Application
* logic resides in event handlers. * logic resides in event handlers.
* </p>
* </li>
* </ul> * </ul>
*
* <p>
* The application utilizes single thread to listen for requests on all ports. It does not create a * The application utilizes single thread to listen for requests on all ports. It does not create a
* separate thread for each client, which provides better scalability under load (number of clients * separate thread for each client, which provides better scalability under load (number of clients
* increase). * increase).
*
* <p>
* The example uses Java NIO framework to implement the Reactor. * The example uses Java NIO framework to implement the Reactor.
* *
*/ */

View File

@ -108,7 +108,7 @@ public class AppClient {
* Creates a new TCP logging client. * Creates a new TCP logging client.
* *
* @param clientName the name of the client to be sent in logging requests. * @param clientName the name of the client to be sent in logging requests.
* @param port the port on which client will send logging requests. * @param serverPort the port on which client will send logging requests.
*/ */
public TcpLoggingClient(String clientName, int serverPort) { public TcpLoggingClient(String clientName, int serverPort) {
this.clientName = clientName; this.clientName = clientName;

View File

@ -141,7 +141,7 @@ public abstract class AbstractNioChannel {
* when this method returns. It will be written when the channel is flushed. * when this method returns. It will be written when the channel is flushed.
* *
* <p> * <p>
* This method is used by the {@link ChannelHandler} to send reply back to the client. <br/> * This method is used by the {@link ChannelHandler} to send reply back to the client. <br>
* Example: * Example:
* *
* <pre> * <pre>

View File

@ -28,7 +28,7 @@ import java.nio.channels.SelectionKey;
* Represents the event dispatching strategy. When {@link NioReactor} senses any event on the * Represents the event dispatching strategy. When {@link NioReactor} senses any event on the
* registered {@link AbstractNioChannel}s then it de-multiplexes the event type, read or write or * registered {@link AbstractNioChannel}s then it de-multiplexes the event type, read or write or
* connect, and then calls the {@link Dispatcher} to dispatch the read events. This decouples the * connect, and then calls the {@link Dispatcher} to dispatch the read events. This decouples the
* I/O processing from application specific processing. <br/> * I/O processing from application specific processing. <br>
* Dispatcher should call the {@link ChannelHandler} associated with the channel on which event * Dispatcher should call the {@link ChannelHandler} associated with the channel on which event
* occurred. * occurred.
* *

View File

@ -37,7 +37,7 @@ import java.nio.channels.SelectionKey;
public class SameThreadDispatcher implements Dispatcher { public class SameThreadDispatcher implements Dispatcher {
/** /**
* Dispatches the read event in the context of caller thread. <br/> * Dispatches the read event in the context of caller thread. <br>
* Note this is a blocking call. It returns only after the associated handler has handled the read * Note this is a blocking call. It returns only after the associated handler has handled the read
* event. * event.
*/ */

View File

@ -47,7 +47,7 @@ public class ThreadPoolDispatcher implements Dispatcher {
/** /**
* Submits the work of dispatching the read event to worker pool, where it gets picked up by * Submits the work of dispatching the read event to worker pool, where it gets picked up by
* worker threads. <br/> * worker threads. <br>
* Note that this is a non-blocking call and returns immediately. It is not guaranteed that the * Note that this is a non-blocking call and returns immediately. It is not guaranteed that the
* event has been handled by associated handler. * event has been handled by associated handler.
*/ */

View File

@ -50,9 +50,9 @@ public class ReaderWriterLock implements ReadWriteLock {
/** /**
* Global mutex is used to indicate that whether reader or writer gets the lock in the moment. * Global mutex is used to indicate that whether reader or writer gets the lock in the moment.
* <p> * <p>
* 1. When it contains the reference of {@link readerLock}, it means that the lock is acquired by the reader, another * 1. When it contains the reference of {@link #readerLock}, it means that the lock is acquired by the reader, another
* reader can also do the read operation concurrently. <br> * reader can also do the read operation concurrently. <br>
* 2. When it contains the reference of reference of {@link writerLock}, it means that the lock is acquired by the * 2. When it contains the reference of reference of {@link #writerLock}, it means that the lock is acquired by the
* writer exclusively, no more reader or writer can get the lock. * writer exclusively, no more reader or writer can get the lock.
* <p> * <p>
* This is the most important field in this class to control the access for reader/writer. * This is the most important field in this class to control the access for reader/writer.

View File

@ -33,13 +33,13 @@ import org.slf4j.LoggerFactory;
* In RAII resource is tied to object lifetime: resource allocation is done during object creation * In RAII resource is tied to object lifetime: resource allocation is done during object creation
* while resource deallocation is done during object destruction. * while resource deallocation is done during object destruction.
* <p> * <p>
* In Java RAII is achieved with try-with-resources statement and interfaces {@link Closeable} and * In Java RAII is achieved with try-with-resources statement and interfaces {@link java.io.Closeable} and
* {@link AutoCloseable}. The try-with-resources statement ensures that each resource is closed at * {@link AutoCloseable}. The try-with-resources statement ensures that each resource is closed at
* the end of the statement. Any object that implements {@link java.lang.AutoCloseable}, which * the end of the statement. Any object that implements {@link java.lang.AutoCloseable}, which
* includes all objects which implement {@link java.io.Closeable}, can be used as a resource. * includes all objects which implement {@link java.io.Closeable}, can be used as a resource.
* *
* In this example, {@link SlidingDoor} implements {@link AutoCloseable} and {@link TreasureChest} * In this example, {@link SlidingDoor} implements {@link AutoCloseable} and {@link TreasureChest}
* implements {@link Closeable}. Running the example, we can observe that both resources are * implements {@link java.io.Closeable}. Running the example, we can observe that both resources are
* automatically closed. * automatically closed.
* <p> * <p>
* http://docs.oracle.com/javase/7/docs/technotes/guides/language/try-with-resources.html * http://docs.oracle.com/javase/7/docs/technotes/guides/language/try-with-resources.html

View File

@ -24,7 +24,7 @@ package com.iluwatar.servicelocator;
/** /**
* This is going to be the parent service interface which we will use to create our services. All * This is going to be the parent service interface which we will use to create our services. All
* services will have a <li>service name</li> <li>unique id</li> <li>execution work flow</li> * services will have a <ul><li>service name</li> <li>unique id</li> <li>execution work flow</li></ul>
* *
* @author saifasif * @author saifasif
* *

View File

@ -28,18 +28,18 @@ import org.slf4j.LoggerFactory;
/** /**
* Singleton pattern ensures that the class can have only one existing instance per Java classloader * Singleton pattern ensures that the class can have only one existing instance per Java classloader
* instance and provides global access to it. * instance and provides global access to it.
* <p/> * <p>
* One of the risks of this pattern is that bugs resulting from setting a singleton up in a * One of the risks of this pattern is that bugs resulting from setting a singleton up in a
* distributed environment can be tricky to debug, since it will work fine if you debug with a * distributed environment can be tricky to debug, since it will work fine if you debug with a
* single classloader. Additionally, these problems can crop up a while after the implementation of * single classloader. Additionally, these problems can crop up a while after the implementation of
* a singleton, since they may start out synchronous and only become async with time, so you it may * a singleton, since they may start out synchronous and only become async with time, so you it may
* not be clear why you are seeing certain changes in behaviour. * not be clear why you are seeing certain changes in behaviour.
* <p/> * <p>
* There are many ways to implement the Singleton. The first one is the eagerly initialized instance * There are many ways to implement the Singleton. The first one is the eagerly initialized instance
* in {@link IvoryTower}. Eager initialization implies that the implementation is thread safe. If * in {@link IvoryTower}. Eager initialization implies that the implementation is thread safe. If
* you can afford giving up control of the instantiation moment, then this implementation will suit * you can afford giving up control of the instantiation moment, then this implementation will suit
* you fine. * you fine.
* <p/> * <p>
* The other option to implement eagerly initialized Singleton is enum based Singleton. The example * The other option to implement eagerly initialized Singleton is enum based Singleton. The example
* is found in {@link EnumIvoryTower}. At first glance the code looks short and simple. However, you * is found in {@link EnumIvoryTower}. At first glance the code looks short and simple. However, you
* should be aware of the downsides including committing to implementation strategy, extending the * should be aware of the downsides including committing to implementation strategy, extending the
@ -47,16 +47,16 @@ import org.slf4j.LoggerFactory;
* Overflow: * Overflow:
* http://programmers.stackexchange.com/questions/179386/what-are-the-downsides-of-implementing * http://programmers.stackexchange.com/questions/179386/what-are-the-downsides-of-implementing
* -a-singleton-with-javas-enum * -a-singleton-with-javas-enum
* <p/> * <p>
* {@link ThreadSafeLazyLoadedIvoryTower} is a Singleton implementation that is initialized on * {@link ThreadSafeLazyLoadedIvoryTower} is a Singleton implementation that is initialized on
* demand. The downside is that it is very slow to access since the whole access method is * demand. The downside is that it is very slow to access since the whole access method is
* synchronized. * synchronized.
* <p/> * <p>
* Another Singleton implementation that is initialized on demand is found in * Another Singleton implementation that is initialized on demand is found in
* {@link ThreadSafeDoubleCheckLocking}. It is somewhat faster than * {@link ThreadSafeDoubleCheckLocking}. It is somewhat faster than
* {@link ThreadSafeLazyLoadedIvoryTower} since it doesn't synchronize the whole access method but * {@link ThreadSafeLazyLoadedIvoryTower} since it doesn't synchronize the whole access method but
* only the method internals on specific conditions. * only the method internals on specific conditions.
* <p/> * <p>
* Yet another way to implement thread safe lazily initialized Singleton can be found in * Yet another way to implement thread safe lazily initialized Singleton can be found in
* {@link InitializingOnDemandHolderIdiom}. However, this implementation requires at least Java 8 * {@link InitializingOnDemandHolderIdiom}. However, this implementation requires at least Java 8
* API level to work. * API level to work.

View File

@ -24,9 +24,9 @@ package com.iluwatar.singleton;
/** /**
* Double check locking * Double check locking
* <p/> * <p>
* http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html * http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
* <p/> * <p>
* Broken under Java 1.4. * Broken under Java 1.4.
* *
* @author mortezaadi@gmail.com * @author mortezaadi@gmail.com

View File

@ -29,16 +29,16 @@ import org.slf4j.LoggerFactory;
* Step Builder Pattern * Step Builder Pattern
* *
* <p> * <p>
* <b>Intent</b> <br/> * <b>Intent</b> <br>
* An extension of the Builder pattern that fully guides the user through the creation of the object * An extension of the Builder pattern that fully guides the user through the creation of the object
* with no chances of confusion. <br/> * with no chances of confusion. <br>
* The user experience will be much more improved by the fact that he will only see the next step * The user experience will be much more improved by the fact that he will only see the next step
* methods available, NO build method until is the right time to build the object. * methods available, NO build method until is the right time to build the object.
* *
* <p> * <p>
* <b>Implementation</b> * <b>Implementation</b> <br>
* <ul>
* The concept is simple: * The concept is simple:
* <ul>
* *
* <li>Write creational steps inner classes or interfaces where each method knows what can be * <li>Write creational steps inner classes or interfaces where each method knows what can be
* displayed next.</li> * displayed next.</li>
@ -49,13 +49,13 @@ import org.slf4j.LoggerFactory;
* </ul> * </ul>
* *
* <p> * <p>
* <b>Applicability</b> <br/> * <b>Applicability</b> <br>
* Use the Step Builder pattern when the algorithm for creating a complex object should be * Use the Step Builder pattern when the algorithm for creating a complex object should be
* independent of the parts that make up the object and how they're assembled the construction * independent of the parts that make up the object and how they're assembled the construction
* process must allow different representations for the object that's constructed when in the * process must allow different representations for the object that's constructed when in the
* process of constructing the order is important. * process of constructing the order is important.
* <p> * <p>
* http://rdafbn.blogspot.co.uk/2012/07/step-builder-pattern_28.html * @see <a href="http://rdafbn.blogspot.co.uk/2012/07/step-builder-pattern_28.html">http://rdafbn.blogspot.co.uk/2012/07/step-builder-pattern_28.html</a>
*/ */
public class App { public class App {

View File

@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
/** /**
* *
* Worker implements {@link Runnable} and thus can be executed by {@link ExecutorService} * Worker implements {@link Runnable} and thus can be executed by {@link java.util.concurrent.ExecutorService}
* *
*/ */
public class Worker implements Runnable { public class Worker implements Runnable {

View File

@ -72,7 +72,6 @@ public class App {
/** /**
* Make calls to the B2BService dummy API * Make calls to the B2BService dummy API
* @param service an instance of B2BService
*/ */
private static void makeServiceCalls(Tenant tenant) { private static void makeServiceCalls(Tenant tenant) {
Throttler timer = new ThrottleTimerImpl(10); Throttler timer = new ThrottleTimerImpl(10);

View File

@ -25,7 +25,9 @@ package com.iluwatar.value.object;
/** /**
* HeroStat is a value object * HeroStat is a value object
* *
* {@link http://docs.oracle.com/javase/8/docs/api/java/lang/doc-files/ValueBased.html} * @see <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/doc-files/ValueBased.html">
* http://docs.oracle.com/javase/8/docs/api/java/lang/doc-files/ValueBased.html
* </a>
*/ */
public class HeroStat { public class HeroStat {

View File

@ -37,8 +37,11 @@ public class HeroStatTest {
/** /**
* Tester for equals() and hashCode() methods of a class. Using guava's EqualsTester. * Tester for equals() and hashCode() methods of a class. Using guava's EqualsTester.
* *
* @see http://static.javadoc.io/com.google.guava/guava-testlib/19.0/com/google/common/testing/ * @see <a href="http://static.javadoc.io/com.google.guava/guava-testlib/19.0/com/google/common/testing/EqualsTester.html">
* EqualsTester.html * http://static.javadoc.io/com.google.guava/guava-testlib/19.0/com/google/common/testing/EqualsTester.html
* </a>
*
*
*/ */
@Test @Test
public void testEquals() { public void testEquals() {