Class VerifyPerceptionCategoryMethods
java.lang.Object
org.opentrafficsim.road.gtu.perception.VerifyPerceptionCategoryMethods
public class VerifyPerceptionCategoryMethods
extends java.lang.Object
Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version Jul 22, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
Constructors Constructor Description VerifyPerceptionCategoryMethods() -
Method Summary
Modifier and Type Method Description static voidmain(java.lang.String[] args)voidperceptionCategoryTest()Check that all sub-classes of AbstractPerceptionCategory have for data namedTestField:testField*property of any type.
-
Constructor Details
-
VerifyPerceptionCategoryMethods
public VerifyPerceptionCategoryMethods()
-
-
Method Details
-
perceptionCategoryTest
public final void perceptionCategoryTest()Check that all sub-classes of AbstractPerceptionCategory have for data namedTestField:testField*property of any type. Data may be organized e.g. per lane, so type is not forced to beTimeStampedObject. Data may also be stored as e.g.testFieldLeftandtestFieldRight, hence the*.
If the field is not found, wrappedAbstractPerceptionCategoryfields are checked. If either has the property the test succeeds. Methods should still be in place as forwards to the wrapped category.updateTestFieldmethod- For boolean:
isTestFieldmethod returningboolean.isTestFieldTimeStampedmethod returningTimeStampedObject.
- For non-boolean:
getTestFieldmethod not returningvoid.getTimeStampedTestFieldmethod returningTimeStampedObject.
is*(boolean).is*TimeStamped(boolean).get*(non-boolean).getTimeStamped*(non-boolean).
*is subtracted as field name, with first character made upper or lower case as by convention. -
main
public static void main(java.lang.String[] args)- Parameters:
args- arguments
-