package id.ac.itb.sigit.pengenalanpola;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Sigit on 22/09/2015.
 */
public class CharDef {
    private String character;
    private String chainCode;
    private List<String> subChainCode=new ArrayList<>();

    public String getCharacter() {
        return character;
    }

    public void setCharacter(String character) {
        this.character = character;
    }

    public String getChainCode() {
        return chainCode;
    }

    public void setChainCode(String chainCode) {
        this.chainCode = chainCode;
    }

    public List<String> getSubChainCode() {
        return subChainCode;
    }


}

@@ -208,24 +208,90 @@
  chainCode;%0A
+    private String dirChainCode;%0A    private String relChainCode;%0A
     private 
@@ -736,11 +736,1047 @@
 %0A    %7D%0A%0A
+    public String getDirChainCode() %7B%0A        return dirChainCode;%0A    %7D%0A%0A    public String getRelChainCode() %7B%0A        return relChainCode;%0A    %7D%0A%0A    public void calcDirChainCode()%7B%0A        dirChainCode = %22%22;%0A%0A        for(int i=1; i %3C chainCode.length(); i++)%7B%0A            int a = Integer.parseInt(chainCode.charAt(i) + %22%22);%0A            int b = Integer.parseInt(chainCode.charAt(i - 1) + %22%22);%0A%0A            if(a == b)%7B%0A%0A            %7Delse if(a %3C b)%7B%0A                dirChainCode = dirChainCode + %22-%22;%0A            %7Delse%7B%0A                dirChainCode = dirChainCode + %22+%22;%0A            %7D%0A        %7D%0A    %7D%0A%0A    public void calcRelChainCode()%7B%0A        relChainCode = %22%22;%0A%0A        for(int i=1; i %3C chainCode.length(); i++)%7B%0A            int a = Integer.parseInt(chainCode.charAt(i) + %22%22);%0A            int b = Integer.parseInt(chainCode.charAt(i - 1) + %22%22);%0A%0A            if(a %3C b)%7B%0A                relChainCode = relChainCode + (a - b + 8);%0A            %7Delse%7B%0A                relChainCode = relChainCode + (a - b);%0A            %7D%0A        %7D%0A    %7D%0A
 %0A%7D%0A

Add Directional Chain Code & Relative Chain Code