org.yccheok.numrecognition
Class ChainCode

java.lang.Object
  extended by org.yccheok.numrecognition.ChainCode

public class ChainCode
extends java.lang.Object

The ChainCode class represents a chain code object.


Field Summary
private  java.util.List chainCodes
          Hold a list of codes.
 
Constructor Summary
ChainCode()
          Creates a new instance of ChainCode with size 0.
 
Method Summary
 void addCode(int i)
          Inserts the code with value i at the end of the chain code.
 int getCode(int index)
          Returns the element at the specified position in this chain code.
 java.util.List getCodes()
          Returns list of codes.
 int size()
          Returns the size of this chain code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chainCodes

private final java.util.List chainCodes
Hold a list of codes.

Constructor Detail

ChainCode

public ChainCode()
Creates a new instance of ChainCode with size 0.

Method Detail

addCode

public void addCode(int i)
Inserts the code with value i at the end of the chain code.

Parameters:
i - Value to be inserted in the end of the list.

getCodes

public java.util.List getCodes()
Returns list of codes.

Returns:
A list of code.

getCode

public int getCode(int index)
Returns the element at the specified position in this chain code.

Parameters:
index - Index of element to return.
Returns:
The value of the element.

size

public int size()
Returns the size of this chain code.

Returns:
Size of this chain code.