SwipeVirtual.java 2.38 KB
Newer Older
TongZuu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
package com.csc.library.timeattendance;

import com.csc.library.timeinterface.SwipeRecord;
import com.csc.library.utilities.MyLog;
import java.util.Iterator;
import java.util.Vector;

import com.csc.library.utilities.CscCalendar;

/*
 * 㹡ҧšٴѵ 㹡óշٴ Ҩӧҹ͡Сѹ
 */
public class SwipeVirtual implements SwipeRecord {

	private CscCalendar swipeDate = null;
	private Vector reserve = new Vector();
	private long recordNo = 0;
	private String source = "";

	public SwipeVirtual() {
		super();
	}

	public SwipeVirtual(CscCalendar d, String reserve) {
		super();
		this.setDate(d);
		this.setReserveCode(reserve);
	}

	public CscCalendar getDate() {
		return swipeDate;
	}

	public float getTime() {
		return swipeDate.getCSCTime();
	}

	public Vector getReserveCode() {
		return this.reserve;
	}

	public void setReserveCode(Object o) {
		this.reserve.add(o);
	}

	public void setDate(CscCalendar d) {
		this.swipeDate = d;
	}

	public boolean isReserved() {
		boolean result = true;
		if (this.reserve.size() > 0)
			result = false;
		return result;
	}

	public String getSwipeType() { // IN OR OUT
		String result = "";
		return result;
	}
	
	public void setSource(String source) {
		this.source = source;
	}
	
	public String getSource() { 
		//Look from systemcode ---> SWIPE_SOURCE
		return "9";
	}

	public String getMachineName() {
		//String result = "System";
		//return result;
		return "System";
	}

	public String getJobCode() {
		//String result = "";
		//return result;
		return "";
	}

	public String getTimeCode() { //
		 //String result = "Server";
		//return result;
		return "Server";
	}

	public long getRecordNo() { 
		return this.recordNo;
	}

	public void setRecordNo(long rec) {
		this.recordNo = rec;
	}

	public String getStringRecordNo() { 
		return String.valueOf(this.recordNo);
	}

	public String toString() {
		String result = "";
		result = String.valueOf(this.getRecordNo()) + "\t : "
				+ this.getDate().getDDMMYYYYHHMMSS() 
				+ "[" + this.getReserveList() + "]" + "\n";
		return result;
	}

	public String getReserveList() {
		String result = "";
		Shift s;
		String key;
		for (Iterator IT = this.reserve.iterator(); IT.hasNext();) {
			key = (String) IT.next().toString();
			result += key + ",";
		}
		return result;
	}
	
}