Commits

Michael Ludwig committed b29d357

Update auto-formatting again (I think I have it pretty good this time around...)

  • Participants
  • Parent commits 34fa887

Comments (0)

Files changed (58)

src/main/java/com/lhkbob/entreri/Attribute.java

 @Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.ANNOTATION_TYPE)
-public @interface Attribute { }
+public @interface Attribute {}

src/main/java/com/lhkbob/entreri/Attributes.java

 import java.util.HashMap;
 import java.util.Map;
 
-
 public class Attributes {
     private final Map<Class<? extends Annotation>, Annotation> attrs;
 
 
         attrs = new HashMap<Class<? extends Annotation>, Annotation>();
 
-        for (Annotation a: f.getAnnotations()) {
+        for (Annotation a : f.getAnnotations()) {
             if (a.annotationType().getAnnotation(Attribute.class) != null) {
                 // the attribute is an annotation
                 attrs.put(a.annotationType(), a);

src/main/java/com/lhkbob/entreri/Component.java

     int index;
 
     /**
-     * Create a new Component stored in the given ComponentRepository, at the given
-     * array position within the ComponentRepository.
+     * Create a new Component stored in the given ComponentRepository, at the
+     * given array position within the ComponentRepository.
      * 
      * @param owner The ComponentRepository owner
      * @param index The index within the owner

src/main/java/com/lhkbob/entreri/ComponentData.java

  */
 package com.lhkbob.entreri;
 
-
 /**
  * <p>
  * ComponentData is used to define types of components that can be added to
     // to simplify implementation constructor requirements.
     ComponentRepository<T> owner;
 
-    protected ComponentData() { }
+    protected ComponentData() {}
 
     /**
      * Get the Entity that owns this ComponentData. This is a convenience for

src/main/java/com/lhkbob/entreri/ComponentDataFactory.java

 
 import java.util.Map;
 
-
 /**
  * <p>
  * ComponentDataFactory is a factory interface used to create instances of

src/main/java/com/lhkbob/entreri/ComponentIterator.java

         int entity;
         int component;
         int count = primary.owner.getMaxComponentIndex();
-        while(index < count - 1) {
+        while (index < count - 1) {
             index++; // always increment one
 
             found = true;
                 if (ignoreEnabled || primary.isEnabled()) {
                     for (int i = 0; i < required.length; i++) {
                         component = required[i].owner.getComponentIndex(entity);
-                        if (!required[i].setFast(component)
-                                || (!ignoreEnabled && !required[i].isEnabled())) {
+                        if (!required[i].setFast(component) || (!ignoreEnabled && !required[i].isEnabled())) {
                             found = false;
                             break;
                         }

src/main/java/com/lhkbob/entreri/ComponentRepository.java

 import com.lhkbob.entreri.property.IntProperty;
 
 /**
- * ComponentRepository manages storing all the componentDatas of a specific type for an
- * EntitySystem. It also controls the IndexedDataStore's for the type's set of
- * properties. It is package-private because its details are low-level and
- * complex.
+ * ComponentRepository manages storing all the componentDatas of a specific type
+ * for an EntitySystem. It also controls the IndexedDataStore's for the type's
+ * set of properties. It is package-private because its details are low-level
+ * and complex.
  * 
  * @author Michael Ludwig
  * @param <T> The type of component stored by the index
     private int idSeq;
 
     /**
-     * Create a ComponentRepository for the given system, that will store Components
-     * of the given type.
+     * Create a ComponentRepository for the given system, that will store
+     * Components of the given type.
      * 
      * @param system The owning system
      * @param type The type of component
      * @throws NullPointerException if system or type are null
      */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    public ComponentRepository(EntitySystem system, TypeId<T> type, ComponentDataFactory<T> factory) {
+    @SuppressWarnings({"rawtypes", "unchecked"})
+    public ComponentRepository(EntitySystem system, TypeId<T> type,
+                               ComponentDataFactory<T> factory) {
         if (system == null || type == null) {
             throw new NullPointerException("Arguments cannot be null");
         }
 
         declaredProperties = new ArrayList<PropertyStore<?>>();
         decoratedProperties = new ArrayList<PropertyStore<?>>(); // empty for now
-        for (Entry<?, PropertyFactory<?>> e: propertyFactories.entrySet()) {
+        for (Entry<?, PropertyFactory<?>> e : propertyFactories.entrySet()) {
             PropertyStore store = new PropertyStore(e.getValue(), e.getKey());
             declaredProperties.add(store);
         }
     }
 
     /**
-     * Ensure that this ComponentRepository has enough internal space to hold its
-     * entity-to-component mapping for the given number of entities.
+     * Ensure that this ComponentRepository has enough internal space to hold
+     * its entity-to-component mapping for the given number of entities.
      * 
      * @param numEntities The new number of entities
      */
     public void expandEntityIndex(int numEntities) {
         if (entityIndexToComponentRepository.length < numEntities) {
-            entityIndexToComponentRepository = Arrays.copyOf(entityIndexToComponentRepository, (int) (numEntities * 1.5f) + 1);
+            entityIndexToComponentRepository = Arrays.copyOf(entityIndexToComponentRepository,
+                                                             (int) (numEntities * 1.5f) + 1);
         }
     }
 
      *             index
      * @throws IllegalStateException if the template is not live
      */
-    @SuppressWarnings({ "unchecked", "rawtypes" })
+    @SuppressWarnings({"unchecked", "rawtypes"})
     public Component<T> addComponent(int entityIndex, Component<T> fromTemplate) {
         if (fromTemplate.getEntitySystem() != getEntitySystem()) {
             throw new IllegalArgumentException("Component not owned by expected EntitySystem");
     /**
      * <p>
      * Compact the data of this ComponentRepository to account for removals and
-     * additions to the index. This will ensure that all active componentDatas are
-     * packed into the underlying arrays, and that they will be accessed in the
-     * same order as iterating over the entities directly.
+     * additions to the index. This will ensure that all active componentDatas
+     * are packed into the underlying arrays, and that they will be accessed in
+     * the same order as iterating over the entities directly.
      * </p>
      * <p>
      * The map from old to new entity index must be used to properly update the
                     return -1; // push null o2 to end of array
                 } else if (o2 != null) {
                     return 1; // push null o1 to end of array
-                }
-                else {
+                } else {
                     return 0; // both null so they are "equal"
                 }
             }
         if (componentInsert < .6f * components.length) {
             int newSize = (int) (1.2f * componentInsert) + 1;
             components = Arrays.copyOf(components, newSize);
-            componentIndexToEntityIndex = Arrays.copyOf(componentIndexToEntityIndex, newSize);
+            componentIndexToEntityIndex = Arrays.copyOf(componentIndexToEntityIndex,
+                                                        newSize);
             resizePropertyStores(declaredProperties, newSize);
             resizePropertyStores(decoratedProperties, newSize);
         }
     }
 
     /**
-     * Decorate the type information of this ComponentRepository to add a property
-     * created by the given factory. The returned property will have default
-     * data assigned for each current Component in the index, and will have the
-     * default value assigned for each new Component. Decorators can then access
-     * the returned property to manipulate the decorated component data.
+     * Decorate the type information of this ComponentRepository to add a
+     * property created by the given factory. The returned property will have
+     * default data assigned for each current Component in the index, and will
+     * have the default value assigned for each new Component. Decorators can
+     * then access the returned property to manipulate the decorated component
+     * data.
      * 
      * @param <P> The type of property created
      * @param factory The factory that will create a unique Property instance
      * @return The property decorated onto the type of the index
      */
     public <P extends Property> P decorate(PropertyFactory<P> factory) {
-        int size = (declaredProperties.isEmpty() ? componentInsert
-                                                 : declaredProperties.get(0).property.getDataStore().size());
+        int size = (declaredProperties.isEmpty() ? componentInsert : declaredProperties.get(0).property.getDataStore()
+                                                                                                       .size());
 
         PropertyStore<P> pstore = new PropertyStore<P>(factory, "decorated");
 
      */
     public void undecorate(Property p) {
         Iterator<PropertyStore<?>> it = decoratedProperties.iterator();
-        while(it.hasNext()) {
+        while (it.hasNext()) {
             if (it.next().property == p) {
                 it.remove();
                 break;

src/main/java/com/lhkbob/entreri/Controller.java

     public void postProcess(double dt);
 
     /**
-     * Invoked when a Controller is added to an EntitySystem. This method
-     * should initialize any system-specific state used by the controller,
-     * such as ComponentIterators, ComponentData instances, or decorated
-     * properties.
+     * Invoked when a Controller is added to an EntitySystem. This method should
+     * initialize any system-specific state used by the controller, such as
+     * ComponentIterators, ComponentData instances, or decorated properties.
      * 
      * @param system The new EntitySystem this controller is attached to
      * @throws IllegalStateException if the controller is already attached to

src/main/java/com/lhkbob/entreri/ControllerManager.java

  */
 public class ControllerManager {
     /**
-     * The Phase enum represents the different phases of
-     * processing that an EntitySystem can go through during
-     * what is often considered a "frame".
+     * The Phase enum represents the different phases of processing that an
+     * EntitySystem can go through during what is often considered a "frame".
      */
     public static enum Phase {
         /**
          * The PREPROCESS phase is invoked before all other phases. All
          * controllers in a manager will have their
-         * {@link Controller#preProcess(double)} method called
-         * before moving to the next phase.
+         * {@link Controller#preProcess(double)} method called before moving to
+         * the next phase.
          */
         PREPROCESS,
 
         /**
          * The PROCESS phase is invoked between PREPROCESS and POSTPROCESS. All
          * controllers in the manager will have their
-         * {@link Controller#process(double)} method called before
-         * moving to the next phase.
+         * {@link Controller#process(double)} method called before moving to the
+         * next phase.
          */
         PROCESS,
 
         ProfileData c = profile.get(controller);
 
         if (c != null) {
-            switch(phase) {
+            switch (phase) {
             case POSTPROCESS:
                 return c.postprocessTime;
             case PREPROCESS:
      * @return The last total execution time of the controller
      */
     public long getExecutionTime(Controller controller) {
-        return getExecutionTime(controller, Phase.PREPROCESS) + getExecutionTime(controller, Phase.POSTPROCESS) + getExecutionTime(controller, Phase.PROCESS);
+        return getExecutionTime(controller, Phase.PREPROCESS) + getExecutionTime(controller,
+                                                                                 Phase.POSTPROCESS) + getExecutionTime(controller,
+                                                                                                                       Phase.PROCESS);
     }
 
     /**
         }
 
         currentPhase = phase;
-        switch(phase) {
+        switch (phase) {
         case PREPROCESS:
-            firePreProcess(dt); break;
+            firePreProcess(dt);
+            break;
         case PROCESS:
-            fireProcess(dt); break;
+            fireProcess(dt);
+            break;
         case POSTPROCESS:
             firePostProcess(dt);
             break;

src/main/java/com/lhkbob/entreri/DefaultFactory.java

 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
-
 /**
  * <p>
  * DefaultFactory is a type-level annotation that can be added to ComponentData

src/main/java/com/lhkbob/entreri/Entity.java

 import java.util.Iterator;
 import java.util.NoSuchElementException;
 
-
 /**
  * <p>
  * An Entity represents a collection of Components within an EntitySystem.
      * @return The current Component of type T attached to this entity
      * @throws NullPointerException if id is null
      */
-    public <T extends ComponentData<T>> Component<T> get(TypeId<T> componentId, boolean ignoreEnable) {
+    public <T extends ComponentData<T>> Component<T> get(TypeId<T> componentId,
+                                                         boolean ignoreEnable) {
         ComponentRepository<T> ci = system.getRepository(componentId);
         Component<T> c = ci.getComponent(ci.getComponentIndex(index));
 
 
     /**
      * <p>
-     * Add a new Component with a data type T to this Entity. If the Entity already has
-     * component of type T attached, that component is removed and a new one is
-     * created. Otherwise, a new instance is created with its default values and
-     * added to the system.
+     * Add a new Component with a data type T to this Entity. If the Entity
+     * already has component of type T attached, that component is removed and a
+     * new one is created. Otherwise, a new instance is created with its default
+     * values and added to the system.
      * </p>
      * 
      * @param <T> The parameterized type of component being added
      *             as this entity
      * @throws IllegalStateException if toClone is not a live component instance
      */
-    @SuppressWarnings({ "unchecked", "rawtypes" })
+    @SuppressWarnings({"unchecked", "rawtypes"})
     public <T extends ComponentData<T>> Component<T> add(Component<T> toClone) {
         if (toClone == null) {
             throw new NullPointerException("ComponentData template, toClone, cannot be null");
     }
 
     /*
-     * Iterator implementation that iterates over the components
-     * attached to an entity, based on entity index rather than reference
+     * Iterator implementation that iterates over the components attached to an
+     * entity, based on entity index rather than reference
      */
     private static class ComponentIterator implements Iterator<Component<?>> {
         private final int entityIndex;
         private ComponentRepository<?> currentIndex;
         private ComponentRepository<?> nextIndex;
 
-        public ComponentIterator(EntitySystem system, int entityIndex, boolean ignoreEnable) {
+        public ComponentIterator(EntitySystem system, int entityIndex,
+                                 boolean ignoreEnable) {
             this.entityIndex = entityIndex;
             this.ignoreEnable = ignoreEnable;
             indices = system.indexIterator();
         }
 
         private void advance() {
-            while(indices.hasNext()) {
+            while (indices.hasNext()) {
                 nextIndex = indices.next();
 
                 int index = nextIndex.getComponentIndex(entityIndex);
                 if (index != 0 && (ignoreEnable || nextIndex.isEnabled(index))) {
                     break;
-                }
-                else {
+                } else {
                     nextIndex = null; // must set to null if this was last element
                 }
             }

src/main/java/com/lhkbob/entreri/EntitySystem.java

 import java.util.List;
 import java.util.NoSuchElementException;
 
-
 /**
  * <p>
  * EntitySystem is the main container for the entities within a logical system
      *             for the given type
      */
     @SuppressWarnings("unchecked")
-    public <T extends ComponentData<T>> void setFactory(TypeId<T> id, ComponentDataFactory<T> factory) {
+    public <T extends ComponentData<T>> void setFactory(TypeId<T> id,
+                                                        ComponentDataFactory<T> factory) {
         if (id == null) {
             throw new NullPointerException("TypeId cannot be null");
         }
      *         subclasses of the input component data type
      * @throws NullPointerException if type is null
      */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @SuppressWarnings({"rawtypes", "unchecked"})
     public <T extends ComponentData<? extends T>> Collection<TypeId<? extends T>> getTypes(Class<T> type) {
         if (type == null) {
             throw new NullPointerException("Type cannot be null");
         manager.fireEntityAdd(newEntity);
 
         if (template != null) {
-            for (Component<?> c: template) {
+            for (Component<?> c : template) {
                 addFromTemplate(entityIndex, c.getTypeId(), c);
             }
         }
 
     /**
      * <p>
-     * Dynamically update the available properties of the given ComponentData type
-     * by adding a Property created by the given PropertyFactory. The property
-     * will be managed by the system as if it was a declared property of the
-     * component type.
+     * Dynamically update the available properties of the given ComponentData
+     * type by adding a Property created by the given PropertyFactory. The
+     * property will be managed by the system as if it was a declared property
+     * of the component type.
      * </p>
      * <p>
      * All components, current and new, will initially have their starting
      * @return The property that has decorated the given component type
      * @throws NullPointerException if type or factory are null
      */
-    public <T extends ComponentData<T>, P extends Property> P decorate(TypeId<T> type, PropertyFactory<P> factory) {
+    public <T extends ComponentData<T>, P extends Property> P decorate(TypeId<T> type,
+                                                                       PropertyFactory<P> factory) {
         ComponentRepository<?> index = getRepository(type);
         return index.decorate(factory);
     }
     }
 
     /**
-     * Return the ComponentRepository associated with the given type. Fails if the
-     * type is not registered
+     * Return the ComponentRepository associated with the given type. Fails if
+     * the type is not registered
      * 
      * @param <T> The ComponentData type
      * @param id The id for the component type
      * Create a new ComponentDataFactory for the given id, using the default
      * annotation if available.
      */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @SuppressWarnings({"rawtypes", "unchecked"})
     private <T extends ComponentData<T>> ComponentDataFactory<T> createDefaultFactory(TypeId<T> id) {
         DefaultFactory factoryAnnot = id.getType().getAnnotation(DefaultFactory.class);
         if (factoryAnnot != null) {
-            Class factoryType =  factoryAnnot.value();
+            Class factoryType = factoryAnnot.value();
             // check for supported constructors, priority: TypeId, Class, default
-            ComponentDataFactory<T> factory = (ComponentDataFactory<T>) attemptInstantiation(factoryType, id);
+            ComponentDataFactory<T> factory = (ComponentDataFactory<T>) attemptInstantiation(factoryType,
+                                                                                             id);
             if (factory == null) {
-                factory = (ComponentDataFactory<T>) attemptInstantiation(factoryType, id.getType());
+                factory = (ComponentDataFactory<T>) attemptInstantiation(factoryType,
+                                                                         id.getType());
             }
             if (factory == null) {
                 factory = (ComponentDataFactory<T>) attemptInstantiation(factoryType);
             }
             if (factory == null) {
-                throw new IllegalComponentDefinitionException(id.getType(), "Cannot instantiate default ComponentDataFactory of type: " + factoryType);
+                throw new IllegalComponentDefinitionException(id.getType(),
+                                                              "Cannot instantiate default ComponentDataFactory of type: " + factoryType);
             }
 
             return factory;
         return entities[entityIndex];
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    private <T extends ComponentData<T>> void addFromTemplate(int entityIndex, TypeId typeId, Component<T> c) {
+    @SuppressWarnings({"rawtypes", "unchecked"})
+    private <T extends ComponentData<T>> void addFromTemplate(int entityIndex,
+                                                              TypeId typeId,
+                                                              Component<T> c) {
         ComponentRepository index = getRepository(typeId);
         index.addComponent(entityIndex, c);
     }
         private void advance() {
             do {
                 index++;
-            } while(index < componentRepositories.length && componentRepositories[index] == null);
+            } while (index < componentRepositories.length && componentRepositories[index] == null);
             advanced = true;
         }
     }
         private void advance() {
             do {
                 index++; // always advance at least 1
-            } while(index < entities.length && entities[index] == null);
+            } while (index < entities.length && entities[index] == null);
             advanced = true;
         }
     }

src/main/java/com/lhkbob/entreri/Factory.java

 
 import com.lhkbob.entreri.property.IntProperty.DefaultInt;
 
-
 /**
  * <p>
  * The Factory annotation can be declared on a Property field in a ComponentData
  * @author Michael Ludwig
  */
 @Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.FIELD, ElementType.TYPE })
+@Target({ElementType.FIELD, ElementType.TYPE})
 public @interface Factory {
     /**
      * @return Class of the PropertyFactory to instantiate, must have an

src/main/java/com/lhkbob/entreri/IllegalComponentDefinitionException.java

     private static final long serialVersionUID = 1L;
 
     /**
-     * Create an exception that specifies the leaf-level class in a ComponentData
-     * type hierarchy has some problem with its definition
+     * Create an exception that specifies the leaf-level class in a
+     * ComponentData type hierarchy has some problem with its definition
      * 
      * @param type The leaf, concrete type
      * @param problem A generic error message to be tacked to the end of the
      *            final error message
      */
-    public IllegalComponentDefinitionException(Class<? extends ComponentData<?>> type, String problem) {
+    public IllegalComponentDefinitionException(Class<? extends ComponentData<?>> type,
+                                               String problem) {
         super("Type has illegal definition: " + type + ", error: " + problem);
     }
 }

src/main/java/com/lhkbob/entreri/IndexedDataStore.java

 
 /**
  * IndexedDataStore is a generic data storage interface representing packed,
- * random-access data storage for a property of a ComponentData. All Components of
- * the same type in the same EntitySystem will have their properties share the
- * IndexedDataStores so that iteration will have much better cache locality, and
- * will avoid the reorganization caused by Java's garbage collector.
+ * random-access data storage for a property of a ComponentData. All Components
+ * of the same type in the same EntitySystem will have their properties share
+ * the IndexedDataStores so that iteration will have much better cache locality,
+ * and will avoid the reorganization caused by Java's garbage collector.
  * 
  * @author Michael Ludwig
  */

src/main/java/com/lhkbob/entreri/Property.java

     /**
      * <p>
      * Return the IndexedDataStore holding this property's values. The data
-     * store may also hold other property values if the owning ComponentData is in
-     * an EntitySystem with many other components of the same type.
+     * store may also hold other property values if the owning ComponentData is
+     * in an EntitySystem with many other components of the same type.
      * </p>
      * <p>
-     * This should not be used by ComponentData implementations, and manipulating
-     * the IndexedDataStore outside of the EntitySystem code could cause
-     * unexpected behavior. Instead Property implementations should expose other
-     * ways to access their data; as an example see
+     * This should not be used by ComponentData implementations, and
+     * manipulating the IndexedDataStore outside of the EntitySystem code could
+     * cause unexpected behavior. Instead Property implementations should expose
+     * other ways to access their data; as an example see
      * {@link FloatProperty#getIndexedData()}.
      * </p>
      * <p>
      * </p>
      * <p>
      * This should only be called internally by the EntitySystem. Calling it
-     * within a ComponentData implementation or otherwise will result in undefined
-     * consequences.
+     * within a ComponentData implementation or otherwise will result in
+     * undefined consequences.
      * </p>
      * <p>
      * It can be assumed that the new store is not null.

src/main/java/com/lhkbob/entreri/PropertyFactory.java

  */
 package com.lhkbob.entreri;
 
-
 /**
  * <p>
  * A PropertyFactory is a simple factory that can be used to create Property
      * Copy the value from <tt>src</tt> at component index, <tt>srcIndex</tt> to
      * <tt>dst</tt> at <tt>dstIndex</tt>. This is used when a component is
      * created and cloned from a template with
-     * {@link Entity#add(com.lhkbob.entreri.Component)}. For many cases a
-     * plain copy-by-value or copy-by-reference is sufficient, but some
-     * component types might require more complicated cloning rules.
+     * {@link Entity#add(com.lhkbob.entreri.Component)}. For many cases a plain
+     * copy-by-value or copy-by-reference is sufficient, but some component
+     * types might require more complicated cloning rules.
      * 
      * @param src The source property that is being cloned
      * @param srcIndex The index into src of the component being cloned

src/main/java/com/lhkbob/entreri/ReflectionComponentDataFactory.java

 import java.util.List;
 import java.util.Map;
 
-
 /**
  * <p>
  * ReflectionComponentDataFactory is a factory for creating new instances of
         List<Field> fields = new ArrayList<Field>(getFields(type));
 
         Class<? super T> parent = type.getSuperclass();
-        while(!ComponentData.class.equals(parent)) {
+        while (!ComponentData.class.equals(parent)) {
             if (!Modifier.isAbstract(parent.getModifiers())) {
-                throw new IllegalComponentDefinitionException(type, "Parent class " + parent + " is not abstract");
+                throw new IllegalComponentDefinitionException(type,
+                                                              "Parent class " + parent + " is not abstract");
             }
 
             // this cast is safe since we're in the while loop
 
     private static <T extends ComponentData<?>> Map<Field, PropertyFactory<?>> getPropertyFactories(List<Field> fields) {
         Map<Field, PropertyFactory<?>> factories = new HashMap<Field, PropertyFactory<?>>();
-        for (Field f: fields) {
+        for (Field f : fields) {
             factories.put(f, createFactory(f));
         }
         return factories;
             // fall back to type declaration
             factoryType = type.getAnnotation(Factory.class).value();
         } else {
-            throw new IllegalComponentDefinitionException(forCType, "Cannot create PropertyFactory for " + type + ", no @Factory annotation on field or type");
+            throw new IllegalComponentDefinitionException(forCType,
+                                                          "Cannot create PropertyFactory for " + type + ", no @Factory annotation on field or type");
         }
 
         // verify that the PropertyFactory actually creates the right type
         try {
             Method create = factoryType.getMethod("create");
             if (!type.isAssignableFrom(create.getReturnType())) {
-                throw new IllegalComponentDefinitionException(forCType, "@Factory(" + factoryType + ") creates incorrect Property type: " + create.getReturnType() + ", required type: " + type);
+                throw new IllegalComponentDefinitionException(forCType,
+                                                              "@Factory(" + factoryType + ") creates incorrect Property type: " + create.getReturnType() + ", required type: " + type);
             }
         } catch (SecurityException e) {
             // should not happen
 
         if (factory == null) {
             // unable to create a PropertyFactory
-            throw new IllegalComponentDefinitionException(forCType, "Unable to create PropertyFactory for " + field);
+            throw new IllegalComponentDefinitionException(forCType,
+                                                          "Unable to create PropertyFactory for " + field);
         } else {
             return factory;
         }
     }
 
-    private static PropertyFactory<?> invokeConstructor(Class<? extends PropertyFactory<?>> type, Object... args) {
+    private static PropertyFactory<?> invokeConstructor(Class<? extends PropertyFactory<?>> type,
+                                                        Object... args) {
         Class<?>[] paramTypes = new Class<?>[args.length];
         for (int i = 0; i < args.length; i++) {
             paramTypes[i] = args[i].getClass();
         // are multiple constructors or it's not private with the correct arguments
         Constructor<?>[] ctors = type.getDeclaredConstructors();
         if (ctors.length != 1) {
-            throw new IllegalComponentDefinitionException(type, "ComponentData type must only define a single constructor");
+            throw new IllegalComponentDefinitionException(type,
+                                                          "ComponentData type must only define a single constructor");
         }
 
         Constructor<T> ctor = (Constructor<T>) ctors[0];
         if (!Modifier.isPrivate(ctor.getModifiers()) && !Modifier.isProtected(ctor.getModifiers())) {
-            throw new IllegalComponentDefinitionException(type, "ComponentData constructor must be private or protected");
+            throw new IllegalComponentDefinitionException(type,
+                                                          "ComponentData constructor must be private or protected");
         }
 
         Class<?>[] args = ctor.getParameterTypes();
         if (args.length != 0) {
-            throw new IllegalComponentDefinitionException(type, "ComponentData constructor does not have a default constructor");
+            throw new IllegalComponentDefinitionException(type,
+                                                          "ComponentData constructor does not have a default constructor");
         }
 
         // Found it, now make it accessible (which might throw a SecurityException)
 
         for (int i = 0; i < declared.length; i++) {
             int modifiers = declared[i].getModifiers();
-            if (Modifier.isStatic(modifiers))
-            {
+            if (Modifier.isStatic(modifiers)) {
                 continue; // ignore static fields
             }
 
-            if (declared[i].isAnnotationPresent(Unmanaged.class))
-            {
+            if (declared[i].isAnnotationPresent(Unmanaged.class)) {
                 continue; // ignore the field
             }
 
             if (!Property.class.isAssignableFrom(declared[i].getType())) {
-                throw new IllegalComponentDefinitionException(type, "ComponentData has non-Property field that is not unmanaged: " + declared[i]);
+                throw new IllegalComponentDefinitionException(type,
+                                                              "ComponentData has non-Property field that is not unmanaged: " + declared[i]);
             }
 
             if (!Modifier.isPrivate(modifiers) && !Modifier.isProtected(modifiers)) {
-                throw new IllegalComponentDefinitionException(type, "Field must be private or protected: " + declared[i]);
+                throw new IllegalComponentDefinitionException(type,
+                                                              "Field must be private or protected: " + declared[i]);
             }
 
             nonTransientFields.add(declared[i]);

src/main/java/com/lhkbob/entreri/Result.java

  * </p>
  * <p>
  * To receive computed results, Controllers override their
- * {@link Controller#report(Result)} and check incoming results for the
- * desired type of result. Every controller is notified of all results, they are
+ * {@link Controller#report(Result)} and check incoming results for the desired
+ * type of result. Every controller is notified of all results, they are
  * responsible for ignoring results they are not interested in.
  * </p>
  * 
      * <p>
      * Return true if this result is a "singleton" result. A singleton result is
      * a type of result that is only supplied once during the processing of a
-     * frame (i.e. at the end of the {@link Phase#POSTPROCESS} phase, it is reset).The
-     * ControllerManager verifies that singleton results are supplied at most
-     * once. Most results should return false. The returned value should be the
-     * same for every instance of a type, it should not depend on the state of
-     * the instance.
+     * frame (i.e. at the end of the {@link Phase#POSTPROCESS} phase, it is
+     * reset).The ControllerManager verifies that singleton results are supplied
+     * at most once. Most results should return false. The returned value should
+     * be the same for every instance of a type, it should not depend on the
+     * state of the instance.
      * </p>
      * <p>
      * Singleton results should only be used when the computation of the result

src/main/java/com/lhkbob/entreri/TypeId.java

 import java.lang.reflect.Modifier;
 import java.util.concurrent.ConcurrentHashMap;
 
-
 /**
  * <p>
- * TypeId is a dynamically assigned identifier unique to the desired component data
- * types. Every instance of a type T will use the same TypeId. TypeId is a
+ * TypeId is a dynamically assigned identifier unique to the desired component
+ * data types. Every instance of a type T will use the same TypeId. TypeId is a
  * glorified integer id assigned to set of class types that share a common
  * parent class. Each class will be assigned a unique id within the currently
  * executing JVM.
 public class TypeId<T extends ComponentData<T>> {
     // Use a ConcurrentHashMap to perform reads. It is still synchronized completely to do
     // an insert to make sure a type doesn't try to use two different id values.
-    private static final ConcurrentHashMap<Class<? extends ComponentData<?>>, TypeId<? extends ComponentData<?>>> typeMap
-                                                 = new ConcurrentHashMap<Class<? extends ComponentData<?>>, TypeId<? extends ComponentData<?>>>();
+    private static final ConcurrentHashMap<Class<? extends ComponentData<?>>, TypeId<? extends ComponentData<?>>> typeMap = new ConcurrentHashMap<Class<? extends ComponentData<?>>, TypeId<? extends ComponentData<?>>>();
 
     private static int idSeq = 0;
 
      * Return the unique TypeId instance for the given <tt>type</tt>. If a
      * TypeId hasn't yet been created a new one is instantiated with the next
      * numeric id in the internal id sequence. The new TypeId is stored for
-     * later, so that subsequent calls to {@link #get(Class)} with
-     * <tt>type</tt> will return the same instance. It is recommended that a
-     * ComponentData declare a static final <tt>ID</tt> holding its TypeId.
+     * later, so that subsequent calls to {@link #get(Class)} with <tt>type</tt>
+     * will return the same instance. It is recommended that a ComponentData
+     * declare a static final <tt>ID</tt> holding its TypeId.
      * </p>
      * <p>
      * This method does not validate the definition of the ComponentData because
-     * validation depends on the potentially customized ComponentDataFactory used
-     * by each EntitySystem.
-     * Additionally, abstract ComponentData types cannot have a TypeId assigned to
-     * them.
+     * validation depends on the potentially customized ComponentDataFactory
+     * used by each EntitySystem. Additionally, abstract ComponentData types
+     * cannot have a TypeId assigned to them.
      * </p>
      * 
      * @param <T> The ComponentData class type
         // error checking.  If we found one, we know it passed validation the first time, otherwise
         // we'll validate it before creating a new TypeId.
         TypeId<T> id = (TypeId<T>) typeMap.get(type);
-        if (id != null)
-        {
+        if (id != null) {
             return id; // Found an existing id
         }
 
             throw new IllegalArgumentException("Abstract classes cannot have TypeIds: " + type);
         }
 
-        synchronized(typeMap) {
+        synchronized (typeMap) {
             // Must create a new id, we lock completely to prevent concurrent get() on the
             // same type using two different ids.  One would get overridden and its returned TypeId
             // would be invalid.
             // - Double check, then, before creating a new id
             id = (TypeId<T>) typeMap.get(type);
-            if (id != null)
-            {
+            if (id != null) {
                 return id; // Someone else put in the type after we checked but before we locked
             }
 

src/main/java/com/lhkbob/entreri/Unmanaged.java

 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
-
 /**
  * Unmanaged is an annotation that can be applied to fields in a ComponentData
  * definition to make the field completely ignored by the EntitySystem creating
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.FIELD)
-public @interface Unmanaged { }
+public @interface Unmanaged {}

src/main/java/com/lhkbob/entreri/property/AbstractIndexedDataStore.java

 
 import com.lhkbob.entreri.IndexedDataStore;
 
-
 /**
  * <p>
  * AbstractIndexedDataStore is an implementation of IndexedDataStore that uses
 
     /**
      * Create an AbstractIndexedDataStore that will use <var>elementSize</var>
-     * array elements per ComponentData in the data store. This does not create a
-     * backing array, so concrete classes must allocate an initial array.
+     * array elements per ComponentData in the data store. This does not create
+     * a backing array, so concrete classes must allocate an initial array.
      * 
      * @param elementSize The number of array elements per property instance
      * @throws IllegalArgumentException if elementSize is less than 1
             throw new IllegalArgumentException("Destination store not compatible with this store, wrong element size: " + dstStore.elementSize);
         }
 
-        arraycopy(getArray(), srcOffset * elementSize, dstStore.getArray(), destOffset * elementSize, len * elementSize);
+        arraycopy(getArray(), srcOffset * elementSize, dstStore.getArray(),
+                  destOffset * elementSize, len * elementSize);
     }
 
     /**
      * @param dstOffset The element offset into the new array
      * @param len The number of array elements to copy
      */
-    protected void arraycopy(Object oldArray, int srcOffset, Object newArray, int dstOffset, int len) {
+    protected void arraycopy(Object oldArray, int srcOffset, Object newArray,
+                             int dstOffset, int len) {
         System.arraycopy(oldArray, srcOffset, newArray, dstOffset, len);
     }
 

src/main/java/com/lhkbob/entreri/property/BooleanProperty.java

 
     /**
      * Default boolean attribute for properties.
+     * 
      * @author Michael Ludwig
-     *
+     * 
      */
     @Attribute
     @Retention(RetentionPolicy.RUNTIME)

src/main/java/com/lhkbob/entreri/property/ByteDataStore.java

     private final byte[] array;
 
     /**
-     * Create a new ByteDataStore with the given number of elements per
-     * logical component, and backed by the given array. The array's length must
-     * be a multiple of element size.
+     * Create a new ByteDataStore with the given number of elements per logical
+     * component, and backed by the given array. The array's length must be a
+     * multiple of element size.
      * 
      * @param elementSize The number of elements per component
      * @param array Backing array

src/main/java/com/lhkbob/entreri/property/ByteProperty.java

 import com.lhkbob.entreri.Property;
 
 /**
- * ByteProperty is an implementation of Property that stores a single
- * byte value.
+ * ByteProperty is an implementation of Property that stores a single byte
+ * value.
  * 
  * @author Michael Ludwig
  */
 
     /**
      * Default byte attribute for properties.
+     * 
      * @author Michael Ludwig
-     *
+     * 
      */
     @Attribute
     @Retention(RetentionPolicy.RUNTIME)

src/main/java/com/lhkbob/entreri/property/CharDataStore.java

     private final char[] array;
 
     /**
-     * Create a new CharDataStore with the given number of elements per
-     * logical component, and backed by the given array. The array's length must
-     * be a multiple of element size.
+     * Create a new CharDataStore with the given number of elements per logical
+     * component, and backed by the given array. The array's length must be a
+     * multiple of element size.
      * 
      * @param elementSize The number of elements per component
      * @param array Backing array

src/main/java/com/lhkbob/entreri/property/CharProperty.java

     }
 
     /**
-     * Factory to create CharProperties. Properties annotated with
-     * DefaultChar will use that value as the default for all components.
+     * Factory to create CharProperties. Properties annotated with DefaultChar
+     * will use that value as the default for all components.
      * 
      * @author Michael Ludwig
      */
 
     /**
      * Default char attribute for properties.
+     * 
      * @author Michael Ludwig
-     *
+     * 
      */
     @Attribute
     @Retention(RetentionPolicy.RUNTIME)

src/main/java/com/lhkbob/entreri/property/DoubleProperty.java

 import com.lhkbob.entreri.Property;
 
 /**
- * DoubleProperty is an implementation of Property that stores a single
- * double value.
+ * DoubleProperty is an implementation of Property that stores a single double
+ * value.
  * 
  * @author Michael Ludwig
  */
 
     /**
      * Default double attribute for properties.
+     * 
      * @author Michael Ludwig
-     *
+     * 
      */
     @Attribute
     @Retention(RetentionPolicy.RUNTIME)

src/main/java/com/lhkbob/entreri/property/FloatDataStore.java

     private final float[] array;
 
     /**
-     * Create a new FloatDataStore with the given number of elements per
-     * logical component, and backed by the given array. The array's length must
-     * be a multiple of element size.
+     * Create a new FloatDataStore with the given number of elements per logical
+     * component, and backed by the given array. The array's length must be a
+     * multiple of element size.
      * 
      * @param elementSize The number of elements per component
      * @param array Backing array

src/main/java/com/lhkbob/entreri/property/FloatProperty.java

 import com.lhkbob.entreri.Property;
 
 /**
- * FloatProperty is an implementation of Property that stores a single
- * float value.
+ * FloatProperty is an implementation of Property that stores a single float
+ * value.
  * 
  * @author Michael Ludwig
  */
     }
 
     /**
-     * Factory to create FloatProperties. Properties annotated with
-     * DefaultFloat will use that value as the default for all components.
+     * Factory to create FloatProperties. Properties annotated with DefaultFloat
+     * will use that value as the default for all components.
      * 
      * @author Michael Ludwig
      */
 
     /**
      * Default float attribute for properties.
+     * 
      * @author Michael Ludwig
-     *
+     * 
      */
     @Attribute
     @Retention(RetentionPolicy.RUNTIME)

src/main/java/com/lhkbob/entreri/property/IntDataStore.java

     private final int[] array;
 
     /**
-     * Create a new IntDataStore with the given number of elements per
-     * logical component, and backed by the given array. The array's length must
-     * be a multiple of element size.
+     * Create a new IntDataStore with the given number of elements per logical
+     * component, and backed by the given array. The array's length must be a
+     * multiple of element size.
      * 
      * @param elementSize The number of elements per component
      * @param array Backing array

src/main/java/com/lhkbob/entreri/property/IntProperty.java

     /**
      * Return the backing int array of this property's IndexedDataStore. The
      * array may be longer than necessary for the number of components in the
-     * system.  Data can be accessed for a component directly using the
+     * system. Data can be accessed for a component directly using the
      * component's index.
      * 
      * @return The int data for all packed properties that this property has
     }
 
     /**
-     * Factory to create IntProperties. Properties annotated with
-     * DefaultInt will use that value as the default for all components.
+     * Factory to create IntProperties. Properties annotated with DefaultInt
+     * will use that value as the default for all components.
      * 
      * @author Michael Ludwig
      */
 
     /**
      * Default int attribute for properties.
+     * 
      * @author Michael Ludwig
-     *
+     * 
      */
     @Attribute
     @Retention(RetentionPolicy.RUNTIME)

src/main/java/com/lhkbob/entreri/property/LongDataStore.java

     private final long[] array;
 
     /**
-     * Create a new LongDataStore with the given number of elements per
-     * logical component, and backed by the given array. The array's length must
-     * be a multiple of element size.
+     * Create a new LongDataStore with the given number of elements per logical
+     * component, and backed by the given array. The array's length must be a
+     * multiple of element size.
      * 
      * @param elementSize The number of elements per component
      * @param array Backing array

src/main/java/com/lhkbob/entreri/property/LongProperty.java

 import com.lhkbob.entreri.Property;
 
 /**
- * LongProperty is an implementation of Property that stores a single
- * long value.
+ * LongProperty is an implementation of Property that stores a single long
+ * value.
  * 
  * @author Michael Ludwig
  */
     }
 
     /**
-     * Factory to create LongProperties. Properties annotated with
-     * DefaultLong will use that value as the default for all components.
+     * Factory to create LongProperties. Properties annotated with DefaultLong
+     * will use that value as the default for all components.
      * 
      * @author Michael Ludwig
      */
 
     /**
      * Default long attribute for properties.
+     * 
      * @author Michael Ludwig
-     *
+     * 
      */
     @Attribute
     @Retention(RetentionPolicy.RUNTIME)

src/main/java/com/lhkbob/entreri/property/ObjectProperty.java

      * @param dflt The default value assigned to each component and element
      * @return A PropertyFactory for ObjectProperty
      */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @SuppressWarnings({"rawtypes", "unchecked"})
     public static <T> PropertyFactory<ObjectProperty<T>> factory(T dflt) {
         PropertyFactory superRaw = new Factory(dflt);
         return superRaw;

src/main/java/com/lhkbob/entreri/property/ShortDataStore.java

     private final short[] array;
 
     /**
-     * Create a new ShortDataStore with the given number of elements per
-     * logical component, and backed by the given array. The array's length must
-     * be a multiple of element size.
+     * Create a new ShortDataStore with the given number of elements per logical
+     * component, and backed by the given array. The array's length must be a
+     * multiple of element size.
      * 
      * @param elementSize The number of elements per component
      * @param array Backing array

src/main/java/com/lhkbob/entreri/property/ShortProperty.java

     }
 
     /**
-     * Factory to create ShortProperties. Properties annotated with
-     * DefaultShort will use that value as the default for all components.
+     * Factory to create ShortProperties. Properties annotated with DefaultShort
+     * will use that value as the default for all components.
      * 
      * @author Michael Ludwig
      */
 
     /**
      * Default short attribute for properties.
+     * 
      * @author Michael Ludwig
-     *
+     * 
      */
     @Attribute
     @Retention(RetentionPolicy.RUNTIME)

src/test/java/com/lhkbob/entreri/AdvancedIteratorTest.java

 
     private void doTestIterator(Iterator<Entity> it) {
         int i = 0;
-        while(it.hasNext()) {
+        while (it.hasNext()) {
             Assert.assertEquals(entityIds.get(i), Integer.valueOf(it.next().getId()));
             i++;
         }
     // assumes it has objData in it
     private void doTestObjectComponentIterator(ComponentIterator it) {
         int i = 0;
-        while(it.next()) {
+        while (it.next()) {
             Assert.assertEquals(entityObjValues.get(i), objData.getObject());
             i++;
         }
     // assumes it has floatData in it
     private void doTestFloatComponentIterator(ComponentIterator it) {
         int i = 0;
-        while(it.next()) {
-            Assert.assertEquals(entityFloatValues.get(i).floatValue(), floatData.getFloat(), .0001f);
+        while (it.next()) {
+            Assert.assertEquals(entityFloatValues.get(i).floatValue(),
+                                floatData.getFloat(), .0001f);
             i++;
         }
 
     // assumes it has floatData and objData as required
     private void doTestBulkComponentIterator(ComponentIterator it) {
         int i = 0;
-        while(it.next()) {
+        while (it.next()) {
             Assert.assertEquals(entityCombinedObjValues.get(i), objData.getObject());
-            Assert.assertEquals(entityCombinedFloatValues.get(i).floatValue(), floatData.getFloat(), .0001f);
+            Assert.assertEquals(entityCombinedFloatValues.get(i).floatValue(),
+                                floatData.getFloat(), .0001f);
             i++;
         }
 
     private void doIteratorRemove(Iterator<Entity> it) {
         int i = 0;
         Iterator<Integer> ids = entityIds.iterator();
-        while(it.hasNext()) {
+        while (it.hasNext()) {
             it.next();
             ids.next();
             if (i > ENTITY_COUNT / 2) {
             i++;
         }
 
-
         // this invalidates all of the value lists, but that is okay
     }
 

src/test/java/com/lhkbob/entreri/ComponentRepositoryTest.java

     @Test
     public void testFactorySetValue() {
         EntitySystem system = new EntitySystem();
-        MultiPropertyComponent c = system.addEntity().add(TypeId.get(MultiPropertyComponent.class)).getData();
+        MultiPropertyComponent c = system.addEntity()
+                                         .add(TypeId.get(MultiPropertyComponent.class))
+                                         .getData();
         Assert.assertEquals(FloatPropertyFactory.DEFAULT, c.getFactoryFloat(), .0001f);
     }
 
         Entity e = system.addEntity();
         IntComponent c = e.add(TypeId.get(IntComponent.class)).getData();
 
-        FloatProperty decorated = system.decorate(TypeId.get(IntComponent.class), new FloatPropertyFactory());
+        FloatProperty decorated = system.decorate(TypeId.get(IntComponent.class),
+                                                  new FloatPropertyFactory());
         decorated.getIndexedData()[c.getIndex()] = 1f;
 
         int count = 0;
-        for (Entity entity: system) {
+        for (Entity entity : system) {
             Assert.assertTrue(entity.get(c));
             count++;
 
         Entity e = system.addEntity();
         IntComponent c = e.add(TypeId.get(IntComponent.class)).getData();
 
-        FloatProperty decorated = system.decorate(TypeId.get(IntComponent.class), new FloatPropertyFactory());
+        FloatProperty decorated = system.decorate(TypeId.get(IntComponent.class),
+                                                  new FloatPropertyFactory());
         decorated.getIndexedData()[c.getIndex()] = 1f;
 
         Entity e2 = system.addEntity();
         decorated.getIndexedData()[c2.getIndex()] = 2f;
 
         int count = 0;
-        for (Entity entity: system) {
+        for (Entity entity : system) {
             IntComponent c3 = entity.get(TypeId.get(IntComponent.class)).getData();
             count++;
 
     public void testUndecorateValidProperty() {
         EntitySystem system = new EntitySystem();
 
-        FloatProperty decorated = system.decorate(TypeId.get(IntComponent.class), new FloatPropertyFactory());
+        FloatProperty decorated = system.decorate(TypeId.get(IntComponent.class),
+                                                  new FloatPropertyFactory());
         system.undecorate(TypeId.get(IntComponent.class), decorated);
     }
 

src/test/java/com/lhkbob/entreri/ControllerManagerTest.java

         doTestReportResult(new SingletonResultImpl(), new ResultImpl());
     }
 
-    @Test(expected=IllegalStateException.class)
+    @Test(expected = IllegalStateException.class)
     public void testReportMultipleSingletonResults() {
         doTestReportResult(new SingletonResultImpl(), new SingletonResultImpl());
     }
 
-    @Test(expected=IllegalStateException.class)
+    @Test(expected = IllegalStateException.class)
     public void testReportOutOfPhase() {
         Result result = new ResultImpl();
 
         system.getControllerManager().addController(supplier);
         system.getControllerManager().addController(receiver);
 
-        Assert.assertArrayEquals(new Result[] { result }, supplier.resultsToReport);
+        Assert.assertArrayEquals(new Result[] {result}, supplier.resultsToReport);
         Assert.assertTrue(receiver.reportedResults.isEmpty());
 
         // process twice
 
         @Override
         public void process(double dt) {
-            for (Result r: resultsToReport) {
+            for (Result r : resultsToReport) {
                 getEntitySystem().getControllerManager().report(r);
             }
         }
             reportedResults.add(result);
         }
 
-
         @Override
         public EntitySystem getEntitySystem() {
             return system;

src/test/java/com/lhkbob/entreri/EntityTest.java

         c.getData().setInt(2);
 
         int count = 0;
-        for (Entity e2: system) {
+        for (Entity e2 : system) {
             Assert.assertSame(e, e2);
             Assert.assertSame(c, e2.get(TypeId.get(IntComponent.class)));
-            Assert.assertEquals(2, e2.get(TypeId.get(IntComponent.class)).getData().getInt());
+            Assert.assertEquals(2, e2.get(TypeId.get(IntComponent.class)).getData()
+                                     .getInt());
             count++;
         }
 
 
         boolean intFound = false;
         boolean floatFound = false;
-        for(Component<?> c: e) {
+        for (Component<?> c : e) {
             if (ic == c) {
                 Assert.assertFalse(intFound);
                 intFound = true;
         boolean floatFound = false;
         boolean objFound = false;
         Iterator<Component<?>> it = e.iterator(true);
-        while(it.hasNext()) {
+        while (it.hasNext()) {
             Component<?> c = it.next();
             if (ic == c) {
                 Assert.assertFalse(intFound);
         Component<FloatComponent> fc = e.add(TypeId.get(FloatComponent.class));
 
         Iterator<Component<?>> it = e.iterator();
-        while(it.hasNext()) {
+        while (it.hasNext()) {
             Component<?> c = it.next();
             if (c.getTypeId() == TypeId.get(IntComponent.class)) {
                 Assert.assertSame(ic, c);

src/test/java/com/lhkbob/entreri/IteratorTest.java

         it.reset();
 
         int count = 0;
-        while(it.next()) {
+        while (it.next()) {
             count++;
             Assert.assertSame(e1, cd.getEntity());
         }
         e2.add(TypeId.get(IntComponent.class)).setEnabled(false);
 
         ComponentIterator it = new ComponentIterator(system);
-        it.addRequired(cd)
-        .setIgnoreEnabled(true)
-        .reset();
+        it.addRequired(cd).setIgnoreEnabled(true).reset();
 
         boolean hasE1 = false;
         boolean hasE2 = false;
-        while(it.next()) {
+        while (it.next()) {
             if (e1 == cd.getEntity()) {
                 Assert.assertFalse(hasE1);
                 hasE1 = true;

src/test/java/com/lhkbob/entreri/ReflectionComponentDataFactoryTest.java

         doInvalidComponentDefinitionTest(PublicConstructorComponent.class);
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @SuppressWarnings({"rawtypes", "unchecked"})
     private void doValidComponentDefinitionTest(Class type) {
         new ReflectionComponentDataFactory(type).getPropertyFactories();
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @SuppressWarnings({"rawtypes", "unchecked"})
     private void doInvalidComponentDefinitionTest(Class type) {
         try {
             new ReflectionComponentDataFactory(type);
             Assert.fail("Expected IllegalComponentDefinitionException");
-        } catch(IllegalComponentDefinitionException e) {
+        } catch (IllegalComponentDefinitionException e) {
             // expected
         }
     }
 
         // for this test convert it to a string key map
         Map<String, PropertyFactory<?>> props = new HashMap<String, PropertyFactory<?>>();
-        for (Entry<?, PropertyFactory<?>> e: origProps.entrySet()) {
+        for (Entry<?, PropertyFactory<?>> e : origProps.entrySet()) {
             props.put(((Field) e.getKey()).getName(), e.getValue());
         }
 
         Assert.assertTrue(props.containsKey("longProp"));
         Assert.assertTrue(props.get("longProp").create() instanceof LongProperty);
         LongProperty longProp = (LongProperty) props.get("longProp").create();
-        ((PropertyFactory<LongProperty>) props.get("longProp")).setDefaultValue(longProp, 0);
+        ((PropertyFactory<LongProperty>) props.get("longProp")).setDefaultValue(longProp,
+                                                                                0);
         long[] longData = longProp.getIndexedData();
         Assert.assertEquals(1, longData.length);
         Assert.assertEquals(Long.MAX_VALUE, longData[0]);
         Assert.assertTrue(props.containsKey("floatProp"));
         Assert.assertTrue(props.get("floatProp").create() instanceof FloatProperty);
         FloatProperty floatProp = (FloatProperty) props.get("floatProp").create();
-        ((PropertyFactory<FloatProperty>) props.get("floatProp")).setDefaultValue(floatProp, 0);
+        ((PropertyFactory<FloatProperty>) props.get("floatProp")).setDefaultValue(floatProp,
+                                                                                  0);
         float[] floatData = floatProp.getIndexedData();
         Assert.assertEquals(1, floatData.length);
         Assert.assertEquals(0.5f, floatData[0], .0001f);
         }
 
         UnmanagedFieldComponent c = system.createDataInstance(id);
-        for (Entity e: system) {
+        for (Entity e : system) {
             Assert.assertTrue(e.get(c));
             float f = c.getFloat();
             Assert.assertEquals(0, f, .0001f);

src/test/java/com/lhkbob/entreri/SystemTest.java

         Entity e = system.addEntity();
 
         int componentCount = 0;
-        for (@SuppressWarnings("unused") Component<?> c: e) {
+        for (@SuppressWarnings("unused") Component<?> c : e) {
             componentCount++;
         }
 
         Assert.assertTrue(e.isLive());
 
         int entityCount = 0;
-        for (Entity entity: system) {
+        for (Entity entity : system) {
             entityCount++;
             Assert.assertSame(e, entity);
         }
         try {
             system.addEntity(template);
             Assert.fail();
-        } catch(IllegalArgumentException e) {
+        } catch (IllegalArgumentException e) {
             // expected
         }
     }
 
         int count = 0;
         Iterator<Entity> it = system.iterator();
-        while(it.hasNext()) {
+        while (it.hasNext()) {
             Entity e = it.next();
-            Assert.assertNotNull(e.get(TypeId.get(MultiPropertyComponent.class)).getData());
+            Assert.assertNotNull(e.get(TypeId.get(MultiPropertyComponent.class))
+                                  .getData());
             count++;
         }
 
         List<Float> cs = new ArrayList<Float>();
         for (int i = 0; i < 100; i++) {
             es.add(system.addEntity());
-            MultiPropertyComponent c = es.get(es.size() - 1).add(TypeId.get(MultiPropertyComponent.class)).getData();
+            MultiPropertyComponent c = es.get(es.size() - 1)
+                                         .add(TypeId.get(MultiPropertyComponent.class))
+                                         .getData();
             float f = (float) Math.random();
             float f2 = (float) Math.random();
             c.setFloat(f);
         int i = 0;
         Iterator<Entity> it = es.iterator();
         Iterator<Float> ft = cs.iterator();
-        while(it.hasNext()) {
+        while (it.hasNext()) {
             Entity e = it.next();
             ft.next(); // always advance once
             if (i % 2 == 0) {
                 system.removeEntity(e);
 
                 ft.remove();
-                ft.next(); ft.remove(); // remove 2nd element
+                ft.next();
+                ft.remove(); // remove 2nd element
             } else {
                 ft.next(); // advance past 2nd element
             }
         it = es.iterator();
         Iterator<Entity> si = system.iterator();
         ft = cs.iterator();
-        while(it.hasNext() && si.hasNext()) {
+        while (it.hasNext() && si.hasNext()) {
             Entity e = si.next();
             Assert.assertEquals(it.next(), e);
-            Assert.assertEquals(ft.next().floatValue(), e.get(TypeId.get(MultiPropertyComponent.class)).getData().getFloat(), .0001f);
-            Assert.assertEquals(ft.next().floatValue(), e.get(TypeId.get(MultiPropertyComponent.class)).getData().getFactoryFloat(), .0001f);
+            Assert.assertEquals(ft.next().floatValue(),
+                                e.get(TypeId.get(MultiPropertyComponent.class)).getData()
+                                 .getFloat(), .0001f);
+            Assert.assertEquals(ft.next().floatValue(),
+                                e.get(TypeId.get(MultiPropertyComponent.class)).getData()
+                                 .getFactoryFloat(), .0001f);
         }
         Assert.assertFalse(it.hasNext());
         Assert.assertFalse(si.hasNext());
         List<Float> cs = new ArrayList<Float>();
         for (int i = 0; i < 100; i++) {
             es.add(system.addEntity());
-            MultiPropertyComponent c = es.get(es.size() - 1).add(TypeId.get(MultiPropertyComponent.class)).getData();
+            MultiPropertyComponent c = es.get(es.size() - 1)
+                                         .add(TypeId.get(MultiPropertyComponent.class))
+                                         .getData();
             float f = (float) Math.random();
             float f2 = (float) Math.random();
             c.setFloat(f);
         // remove a bunch of components from the entities
         int i = 0;
         Iterator<Entity> it = es.iterator();
-        while(it.hasNext()) {
+        while (it.hasNext()) {
             Entity e = it.next();
             if (i % 2 == 0) {
                 e.remove(TypeId.get(MultiPropertyComponent.class));
         i = 0;
         it = es.iterator();
         Iterator<Float> ft = cs.iterator();
-        while(it.hasNext()) {
+        while (it.hasNext()) {
             Entity e = it.next();
             Component<MultiPropertyComponent> c = e.get(TypeId.get(MultiPropertyComponent.class));
 
         it = es.iterator();
         Iterator<Entity> si = system.iterator();
         ft = cs.iterator();
-        while(it.hasNext() && si.hasNext()) {
+        while (it.hasNext() && si.hasNext()) {
             Entity e = si.next();
             Assert.assertEquals(it.next(), e);
-            Assert.assertEquals(ft.next().floatValue(), e.get(TypeId.get(MultiPropertyComponent.class)).getData().getFloat(), .0001f);
-            Assert.assertEquals(ft.next().floatValue(), e.get(TypeId.get(MultiPropertyComponent.class)).getData().getFactoryFloat(), .0001f);
+            Assert.assertEquals(ft.next().floatValue(),
+                                e.get(TypeId.get(MultiPropertyComponent.class)).getData()
+                                 .getFloat(), .0001f);
+            Assert.assertEquals(ft.next().floatValue(),
+                                e.get(TypeId.get(MultiPropertyComponent.class)).getData()
+                                 .getFactoryFloat(), .0001f);
         }
         Assert.assertFalse(it.hasNext());
         Assert.assertFalse(si.hasNext());

src/test/java/com/lhkbob/entreri/component/BadConstructorComponent.java

  * @author Michael Ludwig
  */
 public class BadConstructorComponent extends ComponentData<BadConstructorComponent> {
-    protected BadConstructorComponent(EntitySystem system, int index, Object extraArgument) {
-    }
+    protected BadConstructorComponent(EntitySystem system, int index, Object extraArgument) {}
 }