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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? datetools.cs

?? 介紹有關(guān)全文檢索的類庫,以lucene為例,在.net環(huán)境下實現(xiàn)多種類型文檔的全文檢索.
?? CS
字號:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

using System;

namespace Lucene.Net.Documents
{
	
	/// <summary> Provides support for converting dates to strings and vice-versa.
	/// The strings are structured so that lexicographic sorting orders 
	/// them by date, which makes them suitable for use as field values 
	/// and search terms.
	/// 
	/// <P>This class also helps you to limit the resolution of your dates. Do not
	/// save dates with a finer resolution than you really need, as then
	/// RangeQuery and PrefixQuery will require more memory and become slower.
	/// 
	/// <P>Compared to {@link DateField} the strings generated by the methods
	/// in this class take slightly more space, unless your selected resolution
	/// is set to <code>Resolution.DAY</code> or lower.
	/// </summary>
	public class DateTools
	{
		
		// private static readonly System.TimeZone GMT = TimeZone.getTimeZone("GMT");   // {{Aroush-2.1}}
		
		private static readonly System.String YEAR_FORMAT = "yyyy";
		private static readonly System.String MONTH_FORMAT = "yyyyMM";
		private static readonly System.String DAY_FORMAT = "yyyyMMdd";
		private static readonly System.String HOUR_FORMAT = "yyyyMMddHH";
		private static readonly System.String MINUTE_FORMAT = "yyyyMMddHHmm";
		private static readonly System.String SECOND_FORMAT = "yyyyMMddHHmmss";
		private static readonly System.String MILLISECOND_FORMAT = "yyyyMMddHHmmssfff";
		
		// cannot create, the class has static methods only
		private DateTools()
		{
		}
		
		/// <summary> Converts a Date to a string suitable for indexing.
		/// 
		/// </summary>
		/// <param name="date">the date to be converted
		/// </param>
		/// <param name="resolution">the desired resolution, see
		/// {@link #Round(Date, DateTools.Resolution)}
		/// </param>
		/// <returns> a string in format <code>yyyyMMddHHmmssSSS</code> or shorter,
		/// depeding on <code>resolution</code>; using UTC as timezone 
		/// </returns>
		public static System.String DateToString(System.DateTime date, Resolution resolution)
		{
			return TimeToString(date.Ticks, resolution);
		}
		
		/// <summary> Converts a millisecond time to a string suitable for indexing.
		/// 
		/// </summary>
		/// <param name="time">the date expressed as milliseconds since January 1, 1970, 00:00:00 GMT
		/// </param>
		/// <param name="resolution">the desired resolution, see
		/// {@link #Round(long, DateTools.Resolution)}
		/// </param>
		/// <returns> a string in format <code>yyyyMMddHHmmssSSS</code> or shorter,
		/// depeding on <code>resolution</code>; using UTC as timezone
		/// </returns>
		public static System.String TimeToString(long time, Resolution resolution)
		{
			System.Globalization.Calendar cal = new System.Globalization.GregorianCalendar();
			
			//protected in JDK's prior to 1.4
			//cal.setTimeInMillis(round(time, resolution));
			
			System.DateTime dt = new System.DateTime(Round(time, resolution));
			
			System.String result;
			if (resolution == Resolution.YEAR)
			{
				lock (YEAR_FORMAT)
				{
					result = dt.ToString(YEAR_FORMAT);
				}
			}
			else if (resolution == Resolution.MONTH)
			{
				lock (MONTH_FORMAT)
				{
					result = dt.ToString(MONTH_FORMAT);
				}
			}
			else if (resolution == Resolution.DAY)
			{
				lock (DAY_FORMAT)
				{
					result = result = dt.ToString(DAY_FORMAT);
				}
			}
			else if (resolution == Resolution.HOUR)
			{
				lock (HOUR_FORMAT)
				{
					result = result = dt.ToString(HOUR_FORMAT);
				}
			}
			else if (resolution == Resolution.MINUTE)
			{
				lock (MINUTE_FORMAT)
				{
					result = result = dt.ToString(MINUTE_FORMAT);
				}
			}
			else if (resolution == Resolution.SECOND)
			{
				lock (SECOND_FORMAT)
				{
					result = result = dt.ToString(SECOND_FORMAT);
				}
			}
			else if (resolution == Resolution.MILLISECOND)
			{
				lock (MILLISECOND_FORMAT)
				{
					result = result = dt.ToString(MILLISECOND_FORMAT);
				}
			}
			else
			{
				throw new System.ArgumentException("unknown resolution " + resolution);
			}
			return result;
		}
		
		/// <summary> Converts a string produced by <code>timeToString</code> or
		/// <code>dateToString</code> back to a time, represented as the
		/// number of milliseconds since January 1, 1970, 00:00:00 GMT.
		/// 
		/// </summary>
		/// <param name="dateString">the date string to be converted
		/// </param>
		/// <returns> the number of milliseconds since January 1, 1970, 00:00:00 GMT
		/// </returns>
		/// <throws>  ParseException if <code>dateString</code> is not in the  </throws>
		/// <summary>  expected format 
		/// </summary>
		public static long StringToTime(System.String dateString)
		{
			return StringToDate(dateString).Ticks;
		}
		
		/// <summary> Converts a string produced by <code>timeToString</code> or
		/// <code>dateToString</code> back to a time, represented as a
		/// Date object.
		/// 
		/// </summary>
		/// <param name="dateString">the date string to be converted
		/// </param>
		/// <returns> the parsed time as a Date object 
		/// </returns>
		/// <throws>  ParseException if <code>dateString</code> is not in the  </throws>
		/// <summary>  expected format 
		/// </summary>
		public static System.DateTime StringToDate(System.String dateString)
		{
			System.DateTime date;
			if (dateString.Length == 4)
			{
				lock (YEAR_FORMAT)
				{
					date = new System.DateTime(Convert.ToInt16(dateString.Substring(0, 4)),
                        0, 0, 0, 0, 0, 0);
				}
			}
			else if (dateString.Length == 6)
			{
				lock (MONTH_FORMAT)
				{
                    date = new System.DateTime(Convert.ToInt16(dateString.Substring(0, 4)),
                        Convert.ToInt16(dateString.Substring(4, 2)),
                        0, 0, 0, 0, 0);
				}
			}
			else if (dateString.Length == 8)
			{
				lock (DAY_FORMAT)
				{
                    date = new System.DateTime(Convert.ToInt16(dateString.Substring(0, 4)),
                        Convert.ToInt16(dateString.Substring(4, 2)),
                        Convert.ToInt16(dateString.Substring(6, 2)),
                        0, 0, 0, 0);
                }
			}
			else if (dateString.Length == 10)
			{
				lock (HOUR_FORMAT)
				{
                    date = new System.DateTime(Convert.ToInt16(dateString.Substring(0, 4)),
                        Convert.ToInt16(dateString.Substring(4, 2)),
                        Convert.ToInt16(dateString.Substring(6, 2)),
                        Convert.ToInt16(dateString.Substring(8, 2)),
                        0, 0, 0);
                }
			}
			else if (dateString.Length == 12)
			{
				lock (MINUTE_FORMAT)
				{
                    date = new System.DateTime(Convert.ToInt16(dateString.Substring(0, 4)),
                        Convert.ToInt16(dateString.Substring(4, 2)),
                        Convert.ToInt16(dateString.Substring(6, 2)),
                        Convert.ToInt16(dateString.Substring(8, 2)),
                        Convert.ToInt16(dateString.Substring(10, 2)),
                        0, 0);
                }
			}
			else if (dateString.Length == 14)
			{
				lock (SECOND_FORMAT)
				{
                    date = new System.DateTime(Convert.ToInt16(dateString.Substring(0, 4)),
                        Convert.ToInt16(dateString.Substring(4, 2)),
                        Convert.ToInt16(dateString.Substring(6, 2)),
                        Convert.ToInt16(dateString.Substring(8, 2)),
                        Convert.ToInt16(dateString.Substring(10, 2)),
                        Convert.ToInt16(dateString.Substring(12, 2)),
                        0);
                }
			}
			else if (dateString.Length == 17)
			{
				lock (MILLISECOND_FORMAT)
				{
                    date = new System.DateTime(Convert.ToInt16(dateString.Substring(0, 4)),
                        Convert.ToInt16(dateString.Substring(4, 2)),
                        Convert.ToInt16(dateString.Substring(6, 2)),
                        Convert.ToInt16(dateString.Substring(8, 2)),
                        Convert.ToInt16(dateString.Substring(10, 2)),
                        Convert.ToInt16(dateString.Substring(12, 2)),
                        Convert.ToInt16(dateString.Substring(14, 3)));
                }
			}
			else
			{
				throw new System.FormatException("Input is not valid date string: " + dateString);
			}
			return date;
		}
		
		/// <summary> Limit a date's resolution. For example, the date <code>2004-09-21 13:50:11</code>
		/// will be changed to <code>2004-09-01 00:00:00</code> when using
		/// <code>Resolution.MONTH</code>. 
		/// 
		/// </summary>
		/// <param name="resolution">The desired resolution of the date to be returned
		/// </param>
		/// <returns> the date with all values more precise than <code>resolution</code>
		/// set to 0 or 1
		/// </returns>
		public static System.DateTime Round(System.DateTime date, Resolution resolution)
		{
			return new System.DateTime(Round(date.Ticks, resolution));
		}
		
		/// <summary> Limit a date's resolution. For example, the date <code>1095767411000</code>
		/// (which represents 2004-09-21 13:50:11) will be changed to 
		/// <code>1093989600000</code> (2004-09-01 00:00:00) when using
		/// <code>Resolution.MONTH</code>.
		/// 
		/// </summary>
		/// <param name="resolution">The desired resolution of the date to be returned
		/// </param>
		/// <returns> the date with all values more precise than <code>resolution</code>
		/// set to 0 or 1, expressed as milliseconds since January 1, 1970, 00:00:00 GMT
		/// </returns>
		public static long Round(long time, Resolution resolution)
		{
			System.Globalization.Calendar cal = new System.Globalization.GregorianCalendar();   // {{Aroush}} do we care about 'cal'
			
			// protected in JDK's prior to 1.4
			//cal.setTimeInMillis(time);
			
			System.DateTime dt = new System.DateTime(time);
			
			if (resolution == Resolution.YEAR)
			{
                dt = dt.AddMonths(1 - dt.Month);
                dt = dt.AddDays(1 - dt.Day);
                dt = dt.AddHours(0 - dt.Hour);
                dt = dt.AddMinutes(0 - dt.Minute);
                dt = dt.AddSeconds(0 - dt.Second);
                dt = dt.AddMilliseconds(0 - dt.Millisecond);
            }
			else if (resolution == Resolution.MONTH)
			{
                dt = dt.AddDays(1 - dt.Day);
                dt = dt.AddHours(0 - dt.Hour);
                dt = dt.AddMinutes(0 - dt.Minute);
                dt = dt.AddSeconds(0 - dt.Second);
                dt = dt.AddMilliseconds(0 - dt.Millisecond);
            }
			else if (resolution == Resolution.DAY)
			{
                dt = dt.AddHours(0 - dt.Hour);
                dt = dt.AddMinutes(0 - dt.Minute);
                dt = dt.AddSeconds(0 - dt.Second);
                dt = dt.AddMilliseconds(0 - dt.Millisecond);
            }
			else if (resolution == Resolution.HOUR)
			{
                dt = dt.AddMinutes(0 - dt.Minute);
                dt = dt.AddSeconds(0 - dt.Second);
                dt = dt.AddMilliseconds(0 - dt.Millisecond);
            }
			else if (resolution == Resolution.MINUTE)
			{
                dt = dt.AddSeconds(0 - dt.Second);
                dt = dt.AddMilliseconds(0 - dt.Millisecond);
            }
			else if (resolution == Resolution.SECOND)
			{
                dt = dt.AddMilliseconds(0 - dt.Millisecond);
            }
			else if (resolution == Resolution.MILLISECOND)
			{
				// don't cut off anything
			}
			else
			{
				throw new System.ArgumentException("unknown resolution " + resolution);
			}
			return dt.Ticks;
		}
		
		/// <summary>Specifies the time granularity. </summary>
		public class Resolution
		{
			
			public static readonly Resolution YEAR = new Resolution("year");
			public static readonly Resolution MONTH = new Resolution("month");
			public static readonly Resolution DAY = new Resolution("day");
			public static readonly Resolution HOUR = new Resolution("hour");
			public static readonly Resolution MINUTE = new Resolution("minute");
			public static readonly Resolution SECOND = new Resolution("second");
			public static readonly Resolution MILLISECOND = new Resolution("millisecond");
			
			private System.String resolution;
			
			internal Resolution()
			{
			}
			
			internal Resolution(System.String resolution)
			{
				this.resolution = resolution;
			}
			
			public override System.String ToString()
			{
				return resolution;
			}
		}
		static DateTools()
		{
			{
				// times need to be normalized so the value doesn't depend on the 
				// location the index is created/used:
                // {{Aroush-2.1}}
                /*
				YEAR_FORMAT.setTimeZone(GMT);
				MONTH_FORMAT.setTimeZone(GMT);
				DAY_FORMAT.setTimeZone(GMT);
				HOUR_FORMAT.setTimeZone(GMT);
				MINUTE_FORMAT.setTimeZone(GMT);
				SECOND_FORMAT.setTimeZone(GMT);
				MILLISECOND_FORMAT.setTimeZone(GMT);
                */
			}
		}
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久蜜桃av一区精品变态类天堂| 久久99国产精品免费| 自拍偷拍欧美精品| 韩国女主播成人在线| 欧美精品乱码久久久久久 | 亚洲色图.com| 午夜视频一区在线观看| 日本乱人伦aⅴ精品| 亚洲柠檬福利资源导航| 99精品国产91久久久久久| 国产欧美视频一区二区三区| 国内久久婷婷综合| 久久人人97超碰com| 久久99精品网久久| 精品国产三级a在线观看| 激情图区综合网| 国产婷婷色一区二区三区| 国产福利一区二区三区| 中文字幕在线观看不卡视频| eeuss影院一区二区三区| 国产精品国产a| 在线观看日韩av先锋影音电影院| 不卡的av电影在线观看| 成人免费在线播放视频| a级精品国产片在线观看| 玉米视频成人免费看| 欧美日韩一二区| 国产激情一区二区三区| 亚洲视频免费在线观看| 欧美蜜桃一区二区三区| 国产精品99精品久久免费| 一区二区三区 在线观看视频| 一区二区三区在线视频观看| 色综合一区二区| 国内欧美视频一区二区| 亚洲婷婷在线视频| 精品99一区二区三区| 欧美性大战久久久久久久| 久久er99精品| 亚洲免费观看高清完整| 欧美成人aa大片| 在线观看视频一区二区欧美日韩| 91精品午夜视频| 七七婷婷婷婷精品国产| 偷窥国产亚洲免费视频| 亚洲在线观看免费视频| 亚洲美女在线国产| 亚洲一区二区av在线| 国产欧美一区二区精品性 | 成人在线综合网站| 韩日欧美一区二区三区| 狠狠久久亚洲欧美| 日本一不卡视频| 午夜激情一区二区| 日韩1区2区日韩1区2区| 麻豆国产精品官网| 日本伊人色综合网| 国产福利精品一区| 99久久精品费精品国产一区二区| 国产欧美久久久精品影院| 国产精品午夜在线| 亚洲欧美日韩中文播放| 亚洲国产成人精品视频| 天天色综合天天| 国产一区亚洲一区| av亚洲产国偷v产偷v自拍| 色婷婷精品久久二区二区蜜臂av | 欧美视频一二三区| 99国产精品久久久久久久久久| 一区二区三区四区不卡在线| 日韩你懂的电影在线观看| 欧美日韩国产片| 久久精品国产77777蜜臀| 日韩免费福利电影在线观看| 久久久久久麻豆| 99精品欧美一区二区蜜桃免费| 免费观看一级特黄欧美大片| 波多野结衣在线一区| 91精品国产免费| 国产一区二区调教| 日本一区二区动态图| 91原创在线视频| 亚洲欧美韩国综合色| 欧美精品乱码久久久久久| 五月婷婷综合网| 91色综合久久久久婷婷| 欧美福利一区二区| 亚洲黄色录像片| 成人性生交大合| 久久伊人中文字幕| 亚洲与欧洲av电影| 一本到不卡精品视频在线观看| 国产精品丝袜黑色高跟| 日韩视频不卡中文| 亚洲精选视频在线| 五月天久久比比资源色| 久久你懂得1024| 亚洲欧美综合另类在线卡通| 亚洲一区在线观看视频| 亚洲国产综合人成综合网站| 麻豆久久久久久久| 日韩一级片在线观看| 成人免费一区二区三区在线观看| 国产suv精品一区二区三区| 欧美日韩极品在线观看一区| 久久精品99国产精品日本| 99国产精品视频免费观看| 一区二区在线观看视频| 日本伦理一区二区| 国产成人免费av在线| 久久九九国产精品| 亚洲色图丝袜美腿| 麻豆精品国产91久久久久久| 在线精品视频一区二区三四| 国产精品久久久久久久浪潮网站| 欧美精品在线视频| 夜夜嗨av一区二区三区中文字幕| 亚洲一区在线视频| 7777精品伊人久久久大香线蕉| 这里只有精品视频在线观看| 精品一区二区三区在线视频| 亚洲欧洲精品一区二区三区| 久久99国内精品| 日韩小视频在线观看专区| 中文字幕+乱码+中文字幕一区| 在线看不卡av| 天天影视涩香欲综合网| 国产亚洲欧洲一区高清在线观看| 色综合久久久久综合99| 日韩一区欧美一区| av电影在线观看一区| 日本一二三不卡| 国产精品69久久久久水密桃 | k8久久久一区二区三区 | 欧美电影免费提供在线观看| 美国精品在线观看| 亚洲欧美一区二区三区极速播放| 视频精品一区二区| 亚洲精品在线三区| 欧美电影影音先锋| 成人午夜视频福利| 国产高清不卡一区| 日韩有码一区二区三区| 一区二区三区精品视频| 国产精品看片你懂得| 久久精品一级爱片| 精品福利在线导航| 欧美一区二区成人| 在线亚洲+欧美+日本专区| 成人黄色综合网站| 99re这里只有精品首页| 成人深夜视频在线观看| 东方aⅴ免费观看久久av| 黄页视频在线91| 精品无人码麻豆乱码1区2区 | 久久久久久电影| 色婷婷久久久综合中文字幕| 91丨porny丨在线| 91香蕉视频mp4| 91年精品国产| 在线免费一区三区| 91理论电影在线观看| 色先锋资源久久综合| 在线观看91精品国产入口| 精品视频1区2区3区| 欧美精品1区2区3区| 日韩欧美国产不卡| 日本一区二区高清| 亚洲一区二区免费视频| 蜜桃精品视频在线观看| 激情综合色丁香一区二区| 国产在线观看一区二区| 99久久精品国产麻豆演员表| 在线观看中文字幕不卡| 欧美二区乱c少妇| 国产精品国产三级国产专播品爱网| 91影视在线播放| 欧美精品少妇一区二区三区| 久久久久久电影| 亚洲18色成人| 99久久精品免费看| 2023国产精品视频| 亚洲成人高清在线| 国产麻豆精品在线| 欧美日韩亚洲综合在线| 精品国产伦一区二区三区观看体验 | 91精品国产免费久久综合| 久久精品一区二区| 亚洲午夜免费福利视频| 成人蜜臀av电影| 精品理论电影在线观看 | 欧美精品一区男女天堂| 最新高清无码专区| 国产91露脸合集magnet| 久久影院午夜片一区| 蜜臀av性久久久久av蜜臀妖精| 亚洲人成影院在线观看| 美脚の诱脚舐め脚责91| 欧美日韩激情一区| 亚洲成人一二三|