diff --git a/src/main/java/net/sf/javaanpr/intelligence/RecognizedPlate.java b/src/main/java/net/sf/javaanpr/intelligence/RecognizedPlate.java index 4c35228..ed48169 100644 --- a/src/main/java/net/sf/javaanpr/intelligence/RecognizedPlate.java +++ b/src/main/java/net/sf/javaanpr/intelligence/RecognizedPlate.java @@ -20,22 +20,46 @@ import java.util.Vector; +/** + * This class represents a number plate being recognized. As each character (represented by {@link RecognizedChar}) + * is recognized it gets added to the {@code RecognizedPlate}. + */ public class RecognizedPlate { private Vector chars; + /** + * Constructs a new {@code RecognizedPlate} with no {@code RecognizedChar}s. + */ public RecognizedPlate() { this.chars = new Vector(); } + /** + * Adds one instance of {@link RecognizedChar} to the list of {@code RecognizedChar}s which have been + * recognized for this plate. + * @param chr The new {@link RecognizedChar} to be added + */ public void addChar(RecognizedChar chr) { this.chars.add(chr); } + /** + * This method is for getting a specific {@link RecognizedChar} which has been added to this plate. + * @param i The index of the {@link RecognizedChar} to be returned + * @return The {@link RecognizedChar} which was the {@code i}th one to be added to this plate (starting from 0) + * @throws ArrayIndexOutOfBoundsException if {@code i} is larger than the number of {@code RecognizedChar}s added + * - 1 or {@code i} is less than 0. + */ public RecognizedChar getChar(int i) { return this.chars.elementAt(i); } + /** + * This method is for getting a string representation of all the {@code RecognizedChar}s added to this plate. + * @return A string is made up of the character stored in the first pattern of each {@link RecognizedChar} with + * a space in between each one. + */ public String getString() { String ret = new String(""); for (int i = 0; i < this.chars.size(); i++) { @@ -44,6 +68,9 @@ public String getString() { return ret; } + /** + * @return All the {@code RecognizedChar}s added to this plate + */ public Vector getChars() { return chars; }