knu project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

64 lines
1.8 KiB

/*************************************************************************************************
* 프로그램명 : MTable.java 프로그램설명 : 집계문서의 표 기본정보 처리 작성자 : 강원중 작성일 : 2003.12.03 변경일 : 2004.09.16
**************************************************************************************************/
package kr.co.kihyun.moumi.doc.table;
import kr.co.kihyun.moumi.MoumiConfig;
public class MTable {
public final static int STATIC = 0;
public final static int DYNA = 1;
public final static int DYNATOTLINE = 2;
public final static String[] formType = { MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.staticTable"), MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.dynaTable") };
public static String getTypeName(boolean isDyna) {
if (isDyna != true) {
return formType[0];
} else {
return formType[1];
}
}
public static String getTypeName(int typeNum) {
if (typeNum < 0 || typeNum >= formType.length) {
return "";
}
return formType[typeNum];
}
// 테이블 수 구하는 로직
public static int getTableCount(String form) {
// ban lower case form = form.toLowerCase();
int tableSu = 0;
int fiTable = 0;
while (true) {
fiTable = form.indexOf("<table", fiTable);
if (fiTable == -1)
break;
tableSu = tableSu + 1;
fiTable = fiTable + 7;
}
return tableSu;
}
public static String getTables(String form) {
// ban lower case form = form.toLowerCase();
int startIndex = 0;
int endIndex = 0;
String strTag = "<table";
String endTag = "</table>";
startIndex = form.indexOf(strTag);
endIndex = form.lastIndexOf(endTag);
if (startIndex < 1 || endIndex < 1) {
return form;
}
return form.substring(startIndex, endIndex + endTag.length());
}
}