亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? daterecord.java

?? java開發文檔之excel:jexcelapi_2_6_3.tar
?? JAVA
字號:
/*********************************************************************
*
*      Copyright (C) 2001 Andrew Khan
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/

package jxl.write.biff;

import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;

import common.Logger;

import jxl.CellType;
import jxl.DateCell;
import jxl.biff.DoubleHelper;
import jxl.biff.Type;
import jxl.format.CellFormat;
import jxl.write.DateFormats;
import jxl.write.WritableCellFormat;

/**
 * A date stored in the database
 */
public abstract class DateRecord extends CellValue
{
  /**
   * The logger
   */
  private static Logger logger = Logger.getLogger(DateRecord.class);

  /**
   * The excel value of the date
   */
  private double value;
  /**
   * The java representation of the date
   */
  private Date date;

  /**
   * Indicates whether this is a full date, or just a time only
   */
  private boolean time;

  // The number of days between 01 Jan 1900 and 01 Jan 1970 - this gives
  // the UTC offset
  /**
   */
  private final static int utcOffsetDays = 25569;

  // The number of milliseconds in  a day
  /**
   */
  private final static long msInADay = 24 * 60 * 60 * 1000;

  /**
   * This is package protected so that the worksheet might detect
   * whether or not to override it with the column cell format
   */
  static final WritableCellFormat defaultDateFormat = 
    new WritableCellFormat(DateFormats.DEFAULT);

  // The number of days between 1 Jan 1900 and 1 March 1900. Excel thinks
  // the day before this was 29th Feb 1900, but it was 28th Feb 19000.
  // I guess the programmers thought nobody would notice that they
  // couldn't be bothered to program this dating anomaly properly
  /**
   */
  private final static int nonLeapDay = 61;

  /**
   * Class definition for a dummy variable
   */
  protected static final class GMTDate
  {
    public GMTDate(){}
  };

  /**
   * Constructor invoked by the user API
   * 
   * @param c the column
   * @param r the row
   * @param d the date
   */
  protected DateRecord(int c, int r, Date d)
  {
    this(c, r, d, defaultDateFormat, true);
  }

  /**
   * Constructor invoked by the user API
   * 
   * @param c the column
   * @param r the row
   * @param d the date
   * @param a adjust timezone
   */
  protected DateRecord(int c, int r, Date d, GMTDate a)
  {
    this(c, r, d, defaultDateFormat, false);
  }

  /**
   * Constructor invoked from the user API
   * 
   * @param c the column
   * @param r the row
   * @param st the format for the date
   * @param d the date
   */
  protected DateRecord(int c, int r, Date d, CellFormat st)
  {
    super(Type.NUMBER, c, r,st);
    date = d;
    calculateValue(true);
  }

  /**
   * Constructor invoked from the user API
   * 
   * @param c the column
   * @param r the row
   * @param st the format for the date
   * @param d the date
   * @param a adjust for the timezone
   */
  protected DateRecord(int c, int r, Date d, CellFormat st, GMTDate a)
  {
    super(Type.NUMBER, c, r, st);
    date = d;
    calculateValue(false);
  }

  /**
   * Constructor invoked from the API
   * 
   * @param c the column
   * @param r the row
   * @param st the date format
   * @param tim time indicator
   * @param d the date
   */
  protected DateRecord(int c, int r, Date d, CellFormat st, boolean tim)
  {
    super(Type.NUMBER, c, r, st);
    date = d;
    time = tim;
    calculateValue(false);
  }

  /**
   * Constructor invoked when copying a readable spreadsheet
   * 
   * @param dc the date to copy
   */
  protected DateRecord(DateCell dc)
  {
    super(Type.NUMBER, dc);
    date = dc.getDate();
    time = dc.isTime();
    calculateValue(false);
  }

  /**
   * Copy constructor
   * 
   * @param c the column
   * @param r the row
   * @param dr the record to copy
   */
  protected DateRecord(int c, int r, DateRecord dr)
  {
    super(Type.NUMBER, c, r, dr);
    value = dr.value;
    time = dr.time;
    date = dr.date;
  }

  /**
   * Calculates the 1900 based numerical value based upon the utc value held
   * in the date object
   *
   * @param adjust TRUE if we want to incorporate timezone information
   * into the raw UTC date eg. when copying from a spreadsheet
   */
  private void calculateValue(boolean adjust)
  {
    // Offsets for current time zone
    long zoneOffset = 0;
    long dstOffset = 0;

    // Get the timezone and dst offsets if we want to take these into
    // account
    if (adjust)
    {
      // Get the current calender, replete with timezone information
      Calendar cal = Calendar.getInstance();
      cal.setTime(date);

      zoneOffset = cal.get(Calendar.ZONE_OFFSET);
      dstOffset = cal.get(Calendar.DST_OFFSET);
    }

    long utcValue = date.getTime() + zoneOffset + dstOffset;

    // Convert this to the number of days, plus fractions of a day since
    // 01 Jan 1970
    double utcDays = (double) utcValue / (double) msInADay;

    // Add in the offset to get the number of days since 01 Jan 1900
    value = utcDays + utcOffsetDays;

    // Work round a bug in excel.  Excel seems to think there is a date 
    // called the 29th Feb, 1900 - but this was not a leap year.  
    // Therefore for values less than 61, we must subtract 1.  Only do
    // this for full dates, not times
    if (!time && value < nonLeapDay)
    {
      value -= 1;
    }

    // If this refers to a time, then get rid of the integer part
    if (time)
    {
      value = value - (int) value;
    }
  }

  /**
   * Returns the content type of this cell
   * 
   * @return the content type for this cell
   */
  public CellType getType()
  {
    return CellType.DATE;
  }

  /**
   * Gets the binary data for writing
   * 
   * @return the binary data
   */
  public byte[] getData()
  {
    byte[] celldata = super.getData();
    byte[] data = new byte[celldata.length + 8];
    System.arraycopy(celldata, 0, data, 0, celldata.length);
    DoubleHelper.getIEEEBytes(value, data, celldata.length);

    return data;
  }

  /**
   * Quick and dirty function to return the contents of this cell as a string.
   * For more complex manipulation of the contents, it is necessary to cast
   * this interface to correct subinterface
   * 
   * @return the contents of this cell as a string
   */
  public String getContents()
  {
    return date.toString();
  }

  /**
   * Sets the date in this cell
   * 
   * @param d the date
   */
  protected void setDate(Date d)
  {
    date = d;
    calculateValue(true);
  }

  /**
   * Sets the date in this cell, taking the timezone into account
   * 
   * @param d the date
   * @param a adjust for timezone
   */
  protected void setDate(Date d, GMTDate a)
  {
    date = d;
    calculateValue(false);
  }


  /**
   * Gets the date contained in this cell
   * 
   * @return the cell contents
   */
  public Date getDate()
  {
    return date;
  }

  /**
   * Indicates whether the date value contained in this cell refers to a date,
   * or merely a time.  When writing a cell, all dates are fully defined,
   * even if they refer to a time
   * 
   * @return FALSE if this is full date, TRUE if a time
   */
  public boolean isTime()
  {
    return time;
  }

  /**
   * Gets the DateFormat used to format the cell.  This will normally be
   * the format specified in the excel spreadsheet, but in the event of any
   * difficulty parsing this, it will revert to the default date/time format.
   * 
   * @return the DateFormat object used to format the date in the original 
   *     excel cell
   */
  public DateFormat getDateFormat()
  {
    return null;
  }
}



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产一区在线观看| 91久久国产综合久久| 99在线精品视频| 欧美日韩精品三区| 中文字幕一区免费在线观看 | 偷偷要91色婷婷| 国产精品911| 日韩免费电影一区| 亚洲综合色在线| 国产成人在线色| 欧美变态凌虐bdsm| 一区二区三区久久久| 亚洲精品菠萝久久久久久久| 国产成人精品免费| 中文字幕一区二区三区在线观看 | 欧美一级高清大全免费观看| 亚洲一区二区在线观看视频 | 成人午夜伦理影院| 欧美理论在线播放| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 青青草97国产精品免费观看无弹窗版| 91香蕉视频黄| 国产欧美一区二区三区鸳鸯浴 | 欧美军同video69gay| 亚洲免费观看在线观看| 成人午夜av电影| 久久久久久日产精品| 久久97超碰色| 欧美一级黄色片| 五月天精品一区二区三区| 欧美在线free| 一区二区三区免费网站| 91亚洲大成网污www| 亚洲国产电影在线观看| 国产**成人网毛片九色 | 国产精品美女视频| 国产激情一区二区三区| 国产日韩欧美综合在线| 国产成人综合网站| 国产精品美女久久久久高潮| 丰满少妇在线播放bd日韩电影| 久久久久久久久蜜桃| 国产精品99久久久久久久女警 | 国产高清不卡二三区| 久久久亚洲综合| 成人永久免费视频| 亚洲三级理论片| 精品视频在线免费看| 蜜臀av在线播放一区二区三区| 日韩午夜在线观看视频| 国产精品一区二区三区乱码| 国产日韩精品一区二区三区| 99久久综合国产精品| 伊人婷婷欧美激情| 91精品国产色综合久久不卡蜜臀| 日本不卡中文字幕| 国产日产欧美一区二区视频| heyzo一本久久综合| 亚洲一本大道在线| 精品国产乱码久久久久久图片| 国产精品一二三四| 亚洲综合成人网| 精品成人免费观看| 99麻豆久久久国产精品免费优播| 亚洲图片欧美一区| 欧美高清视频www夜色资源网| 麻豆91精品视频| 中文字幕一区二区三中文字幕| 欧美吻胸吃奶大尺度电影 | 日韩精品专区在线影院重磅| 国产一区二区免费看| 亚洲品质自拍视频网站| 91精品国产91综合久久蜜臀| 福利一区二区在线| 亚洲成人在线免费| 国产欧美精品一区aⅴ影院| 欧美日韩视频在线第一区 | xnxx国产精品| 色婷婷综合久久久中文一区二区| 久久97超碰国产精品超碰| 亚洲区小说区图片区qvod| 精品免费日韩av| 色综合天天综合色综合av | 99re视频精品| 麻豆91小视频| 亚洲与欧洲av电影| 国产蜜臀av在线一区二区三区| 在线电影一区二区三区| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 免费高清在线一区| 亚洲天堂中文字幕| 欧美mv日韩mv亚洲| 欧美日韩一级二级| 99精品偷自拍| 国产不卡在线播放| 精一区二区三区| 亚洲丰满少妇videoshd| 中文字幕一区二区三区蜜月| 精品久久久久久无| 欧美放荡的少妇| 欧美视频日韩视频| 97久久精品人人爽人人爽蜜臀| 国产一区二区免费视频| 日日夜夜免费精品| 一区二区三区成人在线视频| 国产精品狼人久久影院观看方式| 久久综合精品国产一区二区三区| 91精品国产综合久久小美女| 欧美性色黄大片| 欧美视频在线观看一区| 色偷偷久久一区二区三区| 91麻豆精品在线观看| 成年人午夜久久久| caoporen国产精品视频| www.日韩大片| 91香蕉视频mp4| 91视视频在线观看入口直接观看www | 在线观看精品一区| 91黄视频在线观看| 色综合天天综合网天天看片| 99精品视频在线免费观看| 95精品视频在线| 色综合中文综合网| 日韩欧美视频一区| 欧美电视剧在线观看完整版| 日韩三级电影网址| 亚洲精品一区二区精华| 精品av久久707| 久久久久久电影| 久久一区二区三区四区| 中文幕一区二区三区久久蜜桃| 欧美国产一区在线| 中文字幕欧美一| 一片黄亚洲嫩模| 青青草国产精品97视觉盛宴| 黄色精品一二区| 国产精品亚洲第一| 99视频一区二区| 欧美日韩一区不卡| 日韩女优制服丝袜电影| 欧美激情一区二区三区不卡| 亚洲欧美日韩电影| 肉色丝袜一区二区| 国产精品亚洲第一 | 国产一区二区三区免费| 成人精品视频网站| 一本大道久久a久久综合婷婷| 欧美欧美午夜aⅴ在线观看| 精品毛片乱码1区2区3区| 国产欧美日韩麻豆91| 亚洲精品视频在线观看免费| 奇米精品一区二区三区四区 | 在线中文字幕不卡| 日韩欧美电影一区| 性做久久久久久免费观看欧美| 久久国产尿小便嘘嘘尿| av电影在线观看不卡| 欧美肥妇free| 国产精品福利一区| 蜜臀久久99精品久久久久久9| 不卡av在线免费观看| 欧美一区二区播放| 中文字幕五月欧美| 九九**精品视频免费播放| 91视频免费看| 久久久国产午夜精品| 亚洲国产视频网站| 成人av电影免费观看| 精品久久久久av影院| 亚洲综合视频网| 成人午夜视频福利| 欧美成人一区二区三区在线观看| 一区二区三区四区蜜桃| 国产成人午夜精品影院观看视频| 欧美伦理视频网站| 亚洲视频在线观看一区| 国产裸体歌舞团一区二区| 7777精品伊人久久久大香线蕉的| 国产精品成人在线观看| 精品一区二区综合| 欧美一级夜夜爽| 亚洲综合在线免费观看| 成人激情电影免费在线观看| 精品国产电影一区二区| 日韩和的一区二区| 欧美日韩国产一区| 亚洲欧美日韩电影| 97久久久精品综合88久久| 国产日韩欧美精品在线| 国产在线播放一区| 欧美tickling挠脚心丨vk| 男男视频亚洲欧美| 欧美人与性动xxxx| 亚洲图片欧美视频| 欧美在线观看一区二区| 一区二区三区国产豹纹内裤在线| 91尤物视频在线观看| 中文字幕一区二区三区视频| 成人av在线一区二区三区| 国产精品素人视频|