public class SimEntityFactory
extends java.lang.Object
Contains static methods that support making exact copies of SimEntity instances. Each copy should have parameters that are identical to the ones in the original. It is up to each SimEntity to ensure that appropriate copies are made by the respective setter methods, if needed.
It is crucial that a SimEntity to be copied in this way adhere to the Simkit conventions (which are essentially Javabeans). Specifically, it should
Modifier and Type | Field and Description |
---|---|
protected static java.util.Map<java.lang.Class<?>,java.beans.BeanInfo> |
cache |
private static java.util.logging.Logger |
LOGGER |
Constructor and Description |
---|
SimEntityFactory() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<SimEntity> |
createCopies(SimEntity original,
int quantity)
Creates multiple copies in a List.
|
static SimEntity |
createCopy(SimEntity original)
Creates a copy of the given SimEntity object.As noted, it should conform
to Simkit's conventions (zero-argument constructor, setter/getter pairs
for each parameter, but not for state variables)
|
static java.util.Map<java.lang.String,java.lang.Object> |
getParameters(SimEntity simEntity) |
static boolean |
isProperty(java.beans.PropertyDescriptor propertyDescriptor) |
private static final java.util.logging.Logger LOGGER
protected static final java.util.Map<java.lang.Class<?>,java.beans.BeanInfo> cache
public static java.util.List<SimEntity> createCopies(SimEntity original, int quantity)
original
- Given SimEntity to make copiesquantity
- Number of copies to createjava.lang.IllegalArgumentException
- if quantity ≤ 0public static SimEntity createCopy(SimEntity original)
original
- Given SimEntitypublic static boolean isProperty(java.beans.PropertyDescriptor propertyDescriptor)
propertyDescriptor
- Given PropertyDescriptorpublic static java.util.Map<java.lang.String,java.lang.Object> getParameters(SimEntity simEntity)
simEntity
- Given SimEntity