<commit_before>package util;

import java.util.Calendar;
import java.util.Date;

/*
 * Date 관리용 커스텀 클래스.
 * DB에서 Date 타입 컬럼 요청시 SELECT to_char(date, 'YYYYMMDDHH24MI') FROM table
 * Constructor 
 * 1) String type의 YYYYMMDDHH24MI
 * 2) int year, int month, int day
 * 3) Calendar 객체
 * 
 * 2017.10.17 / coding by K
 */

public class CocoaDate {
	private int year;
	private int month;
	private int date;
	private int startDay;
	private int lastDate;
	private int hour;
	private int minute;
	private Calendar originCal;
	private Calendar renewCal;
	
	public CocoaDate(Calendar cal) {
		setDefault(cal.get(cal.YEAR), cal.get(cal.MONTH)+1, cal.get(cal.DATE), cal.get(cal.HOUR), cal.get(cal.MINUTE));
		setRenewCal(cal);
	}
	
	public CocoaDate(int year, int month, int date) {
		Calendar cal = Calendar.getInstance();
		cal.set(year, month-1, date);
		setDefault(cal.get(cal.YEAR), cal.get(cal.MONTH)+1, cal.get(cal.DATE), cal.get(cal.HOUR), cal.get(cal.MINUTE));
		setRenewCal(cal);
	}
	
	public CocoaDate(String sql_date) {
		//YYYYMMDDHHMM
		//012345678901
		int year = Integer.parseInt(sql_date.substring(0, 4));
		int month = Integer.parseInt(sql_date.substring(4, 6));
		int date = Integer.parseInt(sql_date.substring(6, 8));
		int hour = Integer.parseInt(sql_date.substring(8, 10));
		int minute = Integer.parseInt(sql_date.substring(10));
		Calendar cal = Calendar.getInstance();<commit_msg>#00051 CocoaDate update<commit_after>package util;

import java.util.Calendar;
import java.util.Date;

/*
 * Date 관리용 커스텀 클래스.
 * DB에서 Date 타입 컬럼 요청시 SELECT to_char(date, 'YYYYMMDDHH24MI') FROM table
 * Constructor 
 * 1) String type의 YYYYMMDDHH24MI
 * 2) int year, int month, int day
 * 3) Calendar 객체
 * 
 * 2017.10.17 / coding by K
 */

public class CocoaDate {
	private int year;
	private int month;
	private int date;
	private int startDay;
	private int lastDate;
	private int hour;
	private int minute;
	private Calendar originCal;
	private Calendar renewCal;
	
	public CocoaDate() { //인자값 없이 CocoaDate 생성시 현재시간으로 생성
		Calendar cal = Calendar.getInstance();
		setDefault(cal.get(cal.YEAR), cal.get(cal.MONTH)+1, cal.get(cal.DATE), cal.get(cal.HOUR), cal.get(cal.MINUTE));
		setRenewCal(cal);
	}
	
	public CocoaDate(Calendar cal) {
		setDefault(cal.get(cal.YEAR), cal.get(cal.MONTH)+1, cal.get(cal.DATE), cal.get(cal.HOUR), cal.get(cal.MINUTE));
		setRenewCal(cal);
	}
	
	public CocoaDate(int year, int month, int date) {
		Calendar cal = Calendar.getInstance();
		cal.set(year, month-1, date);
		setDefault(cal.get(cal.YEAR), cal.get(cal.MONTH)+1, cal.get(cal.DATE), cal.get(cal.HOUR), cal.get(cal.MINUTE));
		setRenewCal(cal);
	}
	
	public CocoaDate(String sql_date) {
		//YYYYMMDDHHMM
		//012345678901
		int year = Integer.parseInt(sql_date.substring(0, 4));
		int month = Integer.parseInt(sql_date.substring(4, 6));
		int date = Integer.parseInt(sql_date.substring(6, 8));
		int hour = Integer.parseInt(sql_date.substring(8, 10));
		int minute = Integer.parseInt(sql_date.substring(10));
		Calendar cal = Calendar.getInstance();
{'fraction_non_alphanumeric': 0.13700891383294816, 'fraction_numerical': 0.029052492571805876, 'mean_word_length': 4.410714285714286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3272587', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1198, 'n_words': 266}