当前位置: 首页>>代码示例>>Java>>正文


Java DateUtil.format方法代码示例

本文整理汇总了Java中scouter.util.DateUtil.format方法的典型用法代码示例。如果您正苦于以下问题:Java DateUtil.format方法的具体用法?Java DateUtil.format怎么用?Java DateUtil.format使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scouter.util.DateUtil的用法示例。


在下文中一共展示了DateUtil.format方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getColumnText

import scouter.util.DateUtil; //导入方法依赖的package包/类
public String getColumnText(Object element, int columnIndex) {
	if (element instanceof DirObject) {
		DirObject obj = (DirObject) element;
		switch (columnIndex) {
		case 0:
			int lastIndex = obj.name.lastIndexOf("/");
			if (lastIndex < 0) {
				lastIndex = obj.name.lastIndexOf("\\");
			}
			if (lastIndex > -1) {
				return obj.name.substring(lastIndex + 1);
			} else {
				return obj.name;
			}
		case 1:
			return ScouterUtil.humanReadableByteCount(obj.size, true);
		case 2:
			return DateUtil.format(obj.lastModified,
					"yyyy-MM-dd HH:mm:ss");
		}
	}
	return null;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:24,代码来源:ServerFileManagementView.java

示例2: setInput

import scouter.util.DateUtil; //导入方法依赖的package包/类
public void setInput(long stime, long etime) {
	this.stime = stime;
	this.etime = etime;
	try {
		setViewTab(objType, counter, serverId);
		Server server = ServerManager.getInstance().getServer(serverId);
		CounterEngine ce = server.getCounterEngine();
		String counterName = ce.getCounterDisplayName(objType, counter);
		desc = "ⓢ" + server.getName() + " | (Past All) " + counterName + "(" + ce.getCounterUnit(objType, counter) + ") "
				+ DateUtil.format(stime, "yyyyMMdd HH:mm:ss") + " ~ " + DateUtil.format(etime, "HH:mm:ss");
		this.xyGraph.primaryXAxis.setRange(stime, etime);
	} catch (Exception e1) {
		e1.printStackTrace();
	}
	Set<Integer> keySet = dataMap.keySet();
	for (Integer key : keySet) {
		TracePair tp = dataMap.get(key);
		xyGraph.removeTrace(tp.totalTrace);
		xyGraph.removeTrace(tp.activeTrace);
	}
	dataMap.clear();
	load();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:24,代码来源:CounterPTAllPairChart.java

示例3: setInput

import scouter.util.DateUtil; //导入方法依赖的package包/类
public void setInput(long stime, long etime) {
	this.stime = stime;
	this.etime = etime;
	try {
		setViewTab(objType, counter1, serverId);
		Server server = ServerManager.getInstance().getServer(serverId);
		CounterEngine ce = server.getCounterEngine();
		String counterName = ce.getCounterDisplayName(objType, counter1);
		desc = "ⓢ" + server.getName() + " | (Past All) " + counterName + "(" + ce.getCounterUnit(objType, counter1) + ") "
				+ DateUtil.format(stime, "yyyyMMdd HH:mm:ss") + " ~ " + DateUtil.format(etime, "HH:mm:ss");
		this.xyGraph.primaryXAxis.setRange(stime, etime);
	} catch (Exception e1) {
		e1.printStackTrace();
	}
	Set<Integer> keySet = dataMap.keySet();
	for (Integer key : keySet) {
		TracePair tp = dataMap.get(key);
		xyGraph.removeTrace(tp.totalTrace);
		xyGraph.removeTrace(tp.activeTrace);
	}
	dataMap.clear();
	load();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:24,代码来源:CounterPTAllPairChart2.java

示例4: run

import scouter.util.DateUtil; //导入方法依赖的package包/类
public void run() {
	if(sDate == null && eDate == null){
		long yesterday = TimeUtil.getCurrentTime(serverId) - DatePeriodUnit.A_DAY.getTime();
		sDate = DateUtil.format(yesterday, "yyyyMMdd");
		eDate = sDate;
	}
	if (window != null) {
		try {
			CounterPastLongDateTotalView v = (CounterPastLongDateTotalView) window.getActivePage().showView(CounterPastLongDateTotalView.ID, 
					objType + counter + sDate+eDate + TimeUtil.getCurrentTime(serverId), IWorkbenchPage.VIEW_ACTIVATE);
			if (v != null) {
				v.setInput(sDate, eDate, objType, counter, serverId);
			}
		} catch (Exception e) {
			MessageDialog.openError(window.getShell(), "Error", "Error opening view:" + e.getMessage());
		}
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:19,代码来源:OpenPastLongDateTotalAction.java

示例5: run

import scouter.util.DateUtil; //导入方法依赖的package包/类
public void run() {
	if(sDate == null && eDate == null){
		long yesterday = TimeUtil.getCurrentTime(serverId) - DatePeriodUnit.A_DAY.getTime();
		sDate = DateUtil.format(yesterday, "yyyyMMdd");
		eDate = sDate;
	}
	if (window != null) {
	    try {
			CounterPastLongDateAllView v = (CounterPastLongDateAllView) window.getActivePage().showView(CounterPastLongDateAllView.ID, 
					objType+counter+TimeUtil.getCurrentTime(serverId), IWorkbenchPage.VIEW_ACTIVATE);
			if (v != null) {
				v.setInput(sDate, eDate, objType, counter, serverId);
			}
		} catch (Exception e) {
			MessageDialog.openError(window.getShell(), "Error", "Error opening view:" + e.getMessage());
		}
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:19,代码来源:OpenPastLongDateAllAction.java

示例6: getColumnText

import scouter.util.DateUtil; //导入方法依赖的package包/类
public String getColumnText(Object element, int columnIndex) {
	if (element instanceof AlertPack == false) {
		return null;
	} 
	AlertPack p = (AlertPack) element;
	AlertColumnEnum column = columnList.get(columnIndex);
	switch (column) {
	case TIME :
		return DateUtil.format(p.time, "HH:mm:ss.SSS");
	case LEVEL :
		return AlertLevel.getName(p.level);
	case OBJECT :
		return TextProxy.object.getLoadText(yyyymmdd, p.objHash, serverId);
	case TITLE :
		return p.title;
	case MESSAGE :
		return p.message;
	case TAGS :
		return p.tags.toString();
	}
	return null;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:23,代码来源:AlertTableComposite.java

示例7: checkDir

import scouter.util.DateUtil; //导入方法依赖的package包/类
private void checkDir() {
	String service = TextProxy.service.getText(xLogData.p.service).replaceAll("/", "_");
	if(service.length() > 80){
		service = service.substring(0, 80);
	}
	String serverName = ServerManager.getInstance().getServer(serverId).getName();
	String dir = RCPUtil.getWorkingDirectory()+"/"+serverName+"/"+yyyymmdd+xLogData.objName+"/"+xLogDirName;
	
	File rootDir = new File(dir);
	File[] fs = rootDir.listFiles();
	if(fs != null){
		workingDir = dir+"/"+"["+String.format("%03d-", (fs.length+1))+DateUtil.format(date, "HHmmss")+"]"+txid+"_"+service+"/";
		for(File f : fs){
			String dirPath = f.getAbsolutePath();
			if(f.isDirectory() && dirPath != null && dirPath.indexOf(txid+"_"+service) != -1){
				workingDir = dirPath+"/";
				break;
			}
		}
	}else{
		workingDir = dir+"/"+"[001-"+DateUtil.format(date, "HHmmss")+"]"+txid+"_"+service+"/";
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:24,代码来源:SaveProfileJob.java

示例8: getColumnText

import scouter.util.DateUtil; //导入方法依赖的package包/类
public String getColumnText(Object element, int columnIndex) {
	if (element instanceof LogFileObject) {
		LogFileObject obj = (LogFileObject) element;
		switch (columnIndex) {
		case 0:
			return obj.name;
		case 1:
			return ScouterUtil.humanReadableByteCount(obj.size, true);
		case 2:
			return DateUtil.format(obj.lastModified,
					"yyyy-MM-dd HH:mm:ss");
		}
	}
	return null;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:16,代码来源:ServerLogsView.java

示例9: LoadXLogJob

import scouter.util.DateUtil; //导入方法依赖的package包/类
public LoadXLogJob() {
	super("XLog Loading...(" 
			+ DateUtil.format(stime, "yyyy-MM-dd")
			+ " "
			+ DateUtil.format(stime, "HH:mm") 
			+ "~" 
			+ DateUtil.format(etime, "HH:mm") + ")");
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:9,代码来源:XLogLoadTimeGroupView.java

示例10: setInput

import scouter.util.DateUtil; //导入方法依赖的package包/类
public void setInput(long stime, long etime, String objType, String counter, int serverId) throws Exception {
	this.startTime = stime;
	this.endTime = etime;
	this.objType = objType;
	this.counter = counter;
	this.serverId = serverId;
	setViewTab(objType, counter, serverId, false);

	this.xyGraph.primaryXAxis.setRange(stime, etime);

	Server server = ServerManager.getInstance().getServer(serverId);
	
	String counterDisplay = "";
	if(server != null){
		counterDisplay = server.getCounterEngine().getCounterDisplayName(objType, counter);
		desc = "(Past All) [" + DateUtil.format(stime, "yyyy-MM-dd HH:mm:ss") + " ~ " + DateUtil.format(etime, "HH:mm:ss") + "]" + counterDisplay;
	}
	
	serverText.setText("ⓢ"+((server == null)? "?":server.getName())+" |");
	sDateText.setText(DateUtil.format(stime, "yyyy-MM-dd"));
	sTimeText.setText(DateUtil.format(stime, "hh:mm a", Locale.ENGLISH));
	eTimeText.setText(DateUtil.format(etime, "hh:mm a", Locale.ENGLISH));
	
	Iterator<Trace> itr = traces.values().iterator();
	while (itr.hasNext()) {
		Trace tr = itr.next();
		this.xyGraph.removeTrace(tr);
	}
	traces.clear();
	
	MenuUtil.createCounterContextMenu(ID, canvas, serverId, objType, counter);

	ExUtil.asyncRun(new Runnable() {
		public void run() {
			load(CounterPastTimeAllView.this.counter);
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:39,代码来源:CounterPastTimeAllView.java

示例11: getColumnText

import scouter.util.DateUtil; //导入方法依赖的package包/类
public String getColumnText(Object element, int columnIndex) {
	if (element instanceof LockObject) {
		LockObject model = (LockObject) element;
		LockTableSchema column = columnList.get(columnIndex);
		switch (column) {
			case PID:
				return CastUtil.cString(model.pid);
			case START:
				return DateUtil.format(model.startTime, "HH:mm:ss");
			case SQL:
				return model.sql;
			case TYPE:
				return model.type;
			case MODE:
				if (model.parent == null) {
					return model.blockingLockMode;
				} else {
					return model.waitingLockMode;
				}
			case INDEX:
				return model.index;
			case TABLE:
				return model.table;
		}
	}
	return null;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:28,代码来源:DbLockListView.java

示例12: toString

import scouter.util.DateUtil; //导入方法依赖的package包/类
public String toString() {
	return pid + "\t" + user   + "\t" + + cpu + "\t" + mem + "\t" + DateUtil.format(time, "mm:ss.SSS") + "\t" + name + "\n"; 
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:4,代码来源:TopView.java


注:本文中的scouter.util.DateUtil.format方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。