package sikd.sikd5.sikd5bean.query;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

import sikd.sikd5.sikd5bean.tabel.simpatik.Posisikasakunrinci;
import sikd.sikd5.sikd5bean.tabel.simpatik.Refsimpatik;

public class PosisiKasAkunPerPemda extends Refsimpatik implements Serializable {
	/**
	 * @author : agus
	 * @tanggal : Jan 25, 2019
	 */
	double nilai;
	List<Posisikasakunrinci> posisikasakunrincis = new ArrayList<>();
	String style;
	String detil;

	public double getNilai() {
		return nilai;
	}

	public void setNilai(double nilai) {

		this.nilai = nilai;
	}

	public List<Posisikasakunrinci> getPosisikasakunrincis() {
		return posisikasakunrincis;
	}

	public void setPosisikasakunrincis(List<Posisikasakunrinci> posisikasakunrincis) {
		this.posisikasakunrincis = posisikasakunrincis;
	}

	public String getStyleUraian() {
		//font-weight: bold;padding-left: 15px;
		String hasil = "";
		if (getKdakun() != null) {
			String[] pjakun = getKdakun().split(Pattern.quote("."));
			int pad = 10*pjakun.length;
			if (detil.equals("H")) {
				hasil = "font-weight: bold;padding-left: "+pad+"px;";
			}else {
				hasil = "padding-left: "+pad+"px;";
			}
		}
		return hasil;

	}
	public String getStyleAngka() {
		//font-weight: bold;padding-left: 15px;
		String hasil = "";
		if (getKdakun() != null) {
//			String[] pjakun = getKdakun().split(Pattern.quote("."));
			if (detil.equals("H")) {
				hasil = "font-weight: bold;padding-left: 0px;";
			}else {
				hasil = "";
			}
		}
		return hasil;

	}
	public String getUrakun() {
		String hasil = "";
		if (super.getUrakun()==null) {
			hasil = super.getKdakun();
		}else {
			hasil = super.getUrakun();
		}
			return hasil;
	}

	public String getDetil() {
		return detil;
	}

	public void setDetil(String detil) {
		this.detil = detil;
	}
	
}
