Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/main/java/net/sf/javaanpr/intelligence/SyntaxAnalysisMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,23 @@

package net.sf.javaanpr.intelligence;

/**
* Enum to represent the three different syntax analysis modes used when parsing a recognized plate.
* @see Parser
*/
public enum SyntaxAnalysisMode {
DO_NOT_PARSE,
ONLY_EQUAL_LENGTH,
EQUAL_OR_SHORTER_LENGTH;

/**
* This method is used to convert an integer to an enum constant of this type.
* 0 maps to {@code DO_NOT_PARSE}, 1 maps to {@code ONLY_EQUAL_LENGTH} and
* 2 maps to {@code EQUAL_OR_SHORTER_LENGTH}.
* @param syntaxAnalysisModeInt An integer which should be converted to SyntaxAnalysisMode
* @return SyntaxAnalysisMode A constant of this enum type which represents syntaxAnalysisModeInt
* @throws IllegalArgumentException If given an integer which isn't 0, 1 or 2
*/
public static SyntaxAnalysisMode getSyntaxAnalysisModeFromInt(int syntaxAnalysisModeInt) {
switch (syntaxAnalysisModeInt) {
case 0:
Expand Down