📄 absolutedaterange.java
字号:
/* * $RCSfile: AbsoluteDateRange.java,v $ * $Revision: 1.1 $ * $Date: 2002/11/20 04:03:17 $ * * Copyright (C) 1999-2002 CoolServlets, Inc. All rights reserved. * * This software is the proprietary information of CoolServlets, Inc. * Use is subject to license terms. */package com.struts2.framework.util;import java.text.DateFormat;import java.util.Date;/** * Represents a date range between two fixed instances in time. */public class AbsoluteDateRange implements DateRange { private static final DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT); private Date startDate; private Date endDate; /** * */ public String getDisplayName() { return dateFormat.format(startDate) + "-" + dateFormat.format(endDate); } /** * Creates a representation of an absolute date range based on * <tt>startDate</tt> and <tt>endDate</tt>. * * @param startDate the starting date of this date range. * @param endDate the ending date of this date range. */ public AbsoluteDateRange(Date startDate, Date endDate) { this.startDate = startDate; this.endDate = endDate; } /** * Returns the start date passed into the constructor. The specified date * is ignored since it is not relevant to an absolute date. * * @return the starting date of this date range. */ public Date getStartDate(Date date) { return startDate; } /** * Returns the end date passed into the constructor. The specified date * is ignored since it is not relevant to an absolute date. * * @return the ending date of this date range. */ public Date getEndDate(Date date) { return endDate; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -