Permalink
Browse files

comments

  • Loading branch information...
1 parent 759ac00 commit e0c8b696a968c0c82461277eb54933dc51f316b0 @rinde committed May 30, 2012
@@ -4,26 +4,33 @@
package com.google.common.collect;
import java.io.Serializable;
+import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import com.google.common.base.Supplier;
/**
- * @author Rinde van Lon (rinde.vanlon@cs.kuleuven.be)
+ * Similar to {@link HashBasedTable} but with a predictable iteration order,
+ * this is similar to the relation between {@link HashMap} and
+ * {@link LinkedHashMap}.<br/>
+ * <br/>
*
- * Currently (February 2012) Guava does not have this class itself. This
- * class must reside in the com.google.common.collect package since
- * the {@link StandardTable} class has package visibility.
+ * Currently (February 2012) Guava does not have this class itself. This class
+ * must reside in the <code>com.google.common.collect</code> package since the
+ * {@link StandardTable} class has package visibility.
+ * @param <R> row
+ * @param <C> column
+ * @param <V> value
+ * @author Rinde van Lon (rinde.vanlon@cs.kuleuven.be)
*/
public class LinkedHashBasedTable<R, C, V> extends StandardTable<R, C, V> {
private static final long serialVersionUID = 0L;
private static class Factory<C, V> implements Supplier<Map<C, V>>, Serializable {
- public Factory() {
- }
+ public Factory() {}
@Override
public Map<C, V> get() {
@@ -37,8 +44,8 @@ public Factory() {
return new LinkedHashBasedTable<R, C, V>(new LinkedHashMap<R, Map<C, V>>(), new Factory<C, V>());
}
- LinkedHashBasedTable(Map<R, Map<C, V>> backingMap, Factory<C, V> factory) {
- super(backingMap, factory);
+ LinkedHashBasedTable(Map<R, Map<C, V>> pBackingMap, Factory<C, V> pFactory) {
+ super(pBackingMap, pFactory);
}
}
@@ -6,17 +6,16 @@
* Limited simulator API that provides an API for simulation elements (e.g.,
* agents)
* @author Bartosz Michalik <bartosz.michalik@cs.kuleuven.be>
+ * @author Rinde van Lon <rinde.vanlon@cs.kuleuven.be>
* @since 2.0
*
*/
public interface SimulatorAPI {
/**
- * Register a given entity in the simulator.
- * During registration the object is provided all features it requires
- * (declared by interfaces)
- * and bound to the required models (if they were registered in the
- * simulator before)
+ * Register a given entity in the simulator. During registration the object
+ * is provided all features it requires (declared by interfaces) and bound
+ * to the required models (if they were registered in the simulator before)
* @param o object to register
* @return <code>true</code> when registration of the object in the
* simulator was successful
@@ -27,8 +26,8 @@
/**
* Unregister and object from simulator
- * @param o
- * @return
+ * @param o The object to be unregistered.
+ * @return True if the object could be unregistered, false otherwise.
*/
public boolean unregister(Object o);
@@ -1,12 +1,10 @@
package rinde.sim.core;
-import rinde.sim.core.model.RoadUser;
-
/**
- * An interface that declares that a given simulation entity (e.g. agent)
+ * An interface that declares that a given simulation entity (e.g. agent)
* requires the ability to get access to Simulator API
* @author Bartosz Michalik <bartosz.michalik@cs.kuleuven.be>
- *
+ *
*/
public interface SimulatorUser {
void setSimulator(SimulatorAPI api);
@@ -11,18 +11,16 @@
/**
* Send the tick to the tick listener
- *
- * @param currentTime
- * @param timeStep
+ * @param currentTime The current time.
+ * @param timeStep The time step.
*/
public void tick(final long currentTime, final long timeStep);
/**
* Allow the tick listener to perform action after all tick listeners were
* informed about tick {@link TickListener#tick(long, long)}.
- *
- * @param currentTime
- * @param timeStep
+ * @param currentTime The current time.
+ * @param timeStep The time step.
*/
public void afterTick(final long currentTime, final long timeStep);
}
@@ -3,15 +3,15 @@
/**
* Basic implementation that have a getSupportedType method implemented
* @author Bartosz Michalik <bartosz.michalik@cs.kuleuven.be>
- *
- * @param <T>
+ *
+ * @param <T> The type of the supported type of the model.
*/
public abstract class AbstractModel<T> implements Model<T> {
- private Class<T> clazz;
-
- protected AbstractModel(Class<T> clazz) {
- this.clazz = clazz;
+ private final Class<T> clazz;
+
+ protected AbstractModel(Class<T> pClazz) {
+ this.clazz = pClazz;
}
@Override
@@ -2,30 +2,27 @@
/**
* @author Bartosz Michalik <bartosz.michalik@cs.kuleuven.be>
- *
- * @param <T>
- * basic type of element supported by model
+ * @param <T> basic type of element supported by model
*/
public interface Model<T> {
/**
* Register element in a model
- *
- * @param element
- * the <code>! null</code> should be imposed
+ * @param element the <code>! null</code> should be imposed
* @return true if the object was successfully registered
*/
boolean register(T element);
/**
* Unregister element from a model
- *
- * @param element
- * the <code>! null</code> should be imposed
+ * @param element the <code>! null</code> should be imposed
* @return true if the unregistration changed the model (element was part of
* the model and it was succesfully removed)
*/
boolean unregister(T element);
+ /**
+ * @return The class of the type supported by this model.
+ */
Class<T> getSupportedType();
}

0 comments on commit e0c8b69

Please sign in to comment.