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

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

?? ramdirectory.cs

?? 介紹有關全文檢索的類庫,以lucene為例,在.net環境下實現多種類型文檔的全文檢索.
?? 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.Store
{
	
	/// <summary> A memory-resident {@link Directory} implementation.  Locking
	/// implementation is by default the {@link SingleInstanceLockFactory}
	/// but can be changed with {@link #setLockFactory}.
	/// 
	/// </summary>
	/// <version>  $Id: RAMDirectory.java 503911 2007-02-05 22:49:42Z dnaber $
	/// </version>
	[Serializable]
	public class RAMDirectory : Directory
	{
		
		private const long serialVersionUID = 1L;
		
		internal System.Collections.Hashtable fileMap = new System.Collections.Hashtable();
		internal long sizeInBytes = 0;
		
		// *****
		// Lock acquisition sequence:  RAMDirectory, then RAMFile
		// *****
		
		/// <summary>Constructs an empty {@link Directory}. </summary>
		public RAMDirectory()
		{
			SetLockFactory(new SingleInstanceLockFactory());
		}
		
		/// <summary> Creates a new <code>RAMDirectory</code> instance from a different
		/// <code>Directory</code> implementation.  This can be used to load
		/// a disk-based index into memory.
		/// <P>
		/// This should be used only with indices that can fit into memory.
		/// <P>
		/// Note that the resulting <code>RAMDirectory</code> instance is fully
		/// independent from the original <code>Directory</code> (it is a
		/// complete copy).  Any subsequent changes to the
		/// original <code>Directory</code> will not be visible in the
		/// <code>RAMDirectory</code> instance.
		/// 
		/// </summary>
		/// <param name="dir">a <code>Directory</code> value
		/// </param>
		/// <exception cref=""> IOException if an error occurs
		/// </exception>
		public RAMDirectory(Directory dir):this(dir, false)
		{
		}
		
		private RAMDirectory(Directory dir, bool closeDir):this()
		{
			Directory.Copy(dir, this, closeDir);
		}
		
		/// <summary> Creates a new <code>RAMDirectory</code> instance from the {@link FSDirectory}.
		/// 
		/// </summary>
		/// <param name="dir">a <code>File</code> specifying the index directory
		/// 
		/// </param>
		/// <seealso cref="#RAMDirectory(Directory)">
		/// </seealso>
		public RAMDirectory(System.IO.FileInfo dir):this(FSDirectory.GetDirectory(dir), true)
		{
		}
		
		/// <summary> Creates a new <code>RAMDirectory</code> instance from the {@link FSDirectory}.
		/// 
		/// </summary>
		/// <param name="dir">a <code>String</code> specifying the full index directory path
		/// 
		/// </param>
		/// <seealso cref="#RAMDirectory(Directory)">
		/// </seealso>
		public RAMDirectory(System.String dir) : this(FSDirectory.GetDirectory(dir), true)
		{
		}
		
		/// <summary>Returns an array of strings, one for each file in the directory. </summary>
		public override System.String[] List()
		{
			lock (this)
			{
				System.String[] result = new System.String[fileMap.Count];
				int i = 0;
				System.Collections.IEnumerator it = fileMap.Keys.GetEnumerator();
				while (it.MoveNext())
				{
					result[i++] = ((System.String) it.Current);
				}
				return result;
			}
		}
		
		/// <summary>Returns true iff the named file exists in this directory. </summary>
		public override bool FileExists(System.String name)
		{
			RAMFile file;
			lock (this)
			{
				file = (RAMFile) fileMap[name];
			}
			return file != null;
		}
		
		/// <summary>Returns the time the named file was last modified.</summary>
		/// <throws>  IOException if the file does not exist </throws>
		public override long FileModified(System.String name)
		{
			RAMFile file;
			lock (this)
			{
				file = (RAMFile) fileMap[name];
			}
			if (file == null)
				throw new System.IO.FileNotFoundException(name);
			return file.GetLastModified();
		}
		
		/// <summary>Set the modified time of an existing file to now.</summary>
		/// <throws>  IOException if the file does not exist </throws>
		public override void  TouchFile(System.String name)
		{
			RAMFile file;
			lock (this)
			{
				file = (RAMFile) fileMap[name];
			}
			if (file == null)
				throw new System.IO.FileNotFoundException(name);
			
			long ts2, ts1 = System.DateTime.Now.Ticks;
			do 
			{
				try
				{
					System.Threading.Thread.Sleep(new System.TimeSpan((System.Int64) 10000 * 0 + 100 * 1));
				}
				catch (System.Threading.ThreadInterruptedException)
				{
				}
				ts2 = System.DateTime.Now.Ticks;
			}
			while (ts1 == ts2);
			
			file.SetLastModified(ts2);
		}
		
		/// <summary>Returns the length in bytes of a file in the directory.</summary>
		/// <throws>  IOException if the file does not exist </throws>
		public override long FileLength(System.String name)
		{
			RAMFile file;
			lock (this)
			{
				file = (RAMFile) fileMap[name];
			}
			if (file == null)
				throw new System.IO.FileNotFoundException(name);
			return file.GetLength();
		}
		
		/// <summary>Return total size in bytes of all files in this
		/// directory.  This is currently quantized to
		/// BufferedIndexOutput.BUFFER_SIZE. 
		/// </summary>
		public long SizeInBytes()
		{
			lock (this)
			{
				return sizeInBytes;
			}
		}
		
		/// <summary>Removes an existing file in the directory.</summary>
		/// <throws>  IOException if the file does not exist </throws>
		public override void  DeleteFile(System.String name)
		{
			lock (this)
			{
				RAMFile file = (RAMFile) fileMap[name];
				if (file != null)
				{
					fileMap.Remove(name);
					file.directory = null;
					sizeInBytes -= file.sizeInBytes; // updates to RAMFile.sizeInBytes synchronized on directory
				}
				else
					throw new System.IO.FileNotFoundException(name);
			}
		}
		
		/// <summary>Renames an existing file in the directory.</summary>
		/// <throws>  FileNotFoundException if from does not exist </throws>
		/// <deprecated>
		/// </deprecated>
		public override void  RenameFile(System.String from, System.String to)
		{
			lock (this)
			{
				RAMFile fromFile = (RAMFile) fileMap[from];
				if (fromFile == null)
					throw new System.IO.FileNotFoundException(from);
				RAMFile toFile = (RAMFile) fileMap[to];
				if (toFile != null)
				{
					sizeInBytes -= toFile.sizeInBytes; // updates to RAMFile.sizeInBytes synchronized on directory
					toFile.directory = null;
				}
				fileMap.Remove(from);
				fileMap[to] = fromFile;
			}
		}
		
		/// <summary>Creates a new, empty file in the directory with the given name. Returns a stream writing this file. </summary>
		public override IndexOutput CreateOutput(System.String name)
		{
			RAMFile file = new RAMFile(this);
			lock (this)
			{
				RAMFile existing = (RAMFile) fileMap[name];
				if (existing != null)
				{
					sizeInBytes -= existing.sizeInBytes;
					existing.directory = null;
				}
				fileMap[name] = file;
			}
			return new RAMOutputStream(file);
		}
		
		/// <summary>Returns a stream reading an existing file. </summary>
		public override IndexInput OpenInput(System.String name)
		{
			RAMFile file;
			lock (this)
			{
				file = (RAMFile) fileMap[name];
			}
			if (file == null)
				throw new System.IO.FileNotFoundException(name);
			return new RAMInputStream(file);
		}
		
		/// <summary>Closes the store to future operations, releasing associated memory. </summary>
		public override void  Close()
		{
			fileMap = null;
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
韩国三级中文字幕hd久久精品| 中文字幕一区二区三| 色综合天天狠狠| 99综合电影在线视频| 波多野结衣中文一区| 国产一区不卡视频| 国产福利电影一区二区三区| 国产乱码精品一区二区三区忘忧草 | 日本韩国视频一区二区| 风间由美一区二区三区在线观看| 狠狠狠色丁香婷婷综合激情| 国产在线播放一区三区四| 精品在线播放午夜| 国产aⅴ精品一区二区三区色成熟| 精品一区二区三区视频在线观看| 久久国产免费看| 国产69精品久久久久毛片| 99天天综合性| 欧美猛男超大videosgay| 欧美一二三四在线| 国产农村妇女毛片精品久久麻豆| 中文字幕av一区二区三区| 国产精品黄色在线观看| 亚洲一区二区在线播放相泽| 亚洲国产日韩在线一区模特| 欧美aaaaaa午夜精品| 国产成人一级电影| 在线视频欧美精品| 在线播放视频一区| 久久精品人人做人人爽人人| 亚洲同性gay激情无套| 欧美aaaaaa午夜精品| 成人性生交大合| 久久夜色精品一区| 国产精品国产自产拍在线| 亚洲国产精品久久一线不卡| 国内精品久久久久影院一蜜桃| 成人h精品动漫一区二区三区| 欧美三级在线视频| 国产午夜精品久久| 亚洲大片精品永久免费| 国产成人在线看| 欧美日韩美女一区二区| 国产精品久久久久久妇女6080| 亚洲国产sm捆绑调教视频| 国产中文一区二区三区| 在线看一区二区| 精品久久人人做人人爱| 亚洲精品免费在线| 久久99久久精品欧美| 色综合久久综合| 国产精品素人视频| 久久国产精品区| 欧美剧情片在线观看| 国产婷婷色一区二区三区在线| 亚洲18女电影在线观看| 成人三级伦理片| 久久久久国产成人精品亚洲午夜| 亚洲综合久久av| 国产成人午夜视频| 日韩亚洲欧美在线观看| 五月天激情综合| 一本色道久久综合狠狠躁的推荐| 精品成人免费观看| 亚洲免费观看高清完整| 国产精品影音先锋| 欧美成人性战久久| 性欧美疯狂xxxxbbbb| 欧美体内she精高潮| 亚洲婷婷综合色高清在线| 国产99精品视频| 久久久一区二区三区捆绑**| 日本成人在线电影网| 欧美精品v日韩精品v韩国精品v| 亚洲综合一区二区三区| 色老头久久综合| 欧美一区二区日韩| 久久99久久久欧美国产| 精品国产乱码久久| 国产乱子轮精品视频| 国产视频亚洲色图| 岛国av在线一区| 国产精品国产三级国产普通话三级| 国产aⅴ精品一区二区三区色成熟| 欧美日韩一区高清| 日韩精品一区第一页| 欧美一区二区三区婷婷月色 | 在线播放一区二区三区| 亚洲午夜激情网站| 久久综合色一综合色88| 国产精品1024| 一区精品在线播放| 色婷婷av久久久久久久| 亚洲成a天堂v人片| 日韩精品一区二区三区视频在线观看 | 国产一区二区免费在线| 久久久精品黄色| fc2成人免费人成在线观看播放 | 欧亚一区二区三区| 天天综合色天天综合| 精品剧情在线观看| 成人精品电影在线观看| 亚洲图片自拍偷拍| 精品国产免费人成电影在线观看四季 | 精品国产91亚洲一区二区三区婷婷 | 国产制服丝袜一区| 亚洲视频一区在线| 在线91免费看| 成人sese在线| 日本伊人午夜精品| 欧美国产日韩精品免费观看| 91久久香蕉国产日韩欧美9色| 蜜臀精品一区二区三区在线观看| 国产亚洲欧洲一区高清在线观看| 色欧美88888久久久久久影院| 日本成人在线不卡视频| 国产精品久久久久久久久免费相片| 欧美视频三区在线播放| 国产乱码精品一区二区三| 亚洲精品视频在线看| 日韩丝袜美女视频| 色视频欧美一区二区三区| 久久成人麻豆午夜电影| 一区二区欧美视频| 国产欧美日韩亚州综合| 欧美一卡在线观看| 色综合久久88色综合天天免费| 久久福利视频一区二区| 亚洲中国最大av网站| 中文成人综合网| 精品久久人人做人人爽| 欧美伦理视频网站| 色婷婷综合久久久| 国产69精品久久777的优势| 毛片不卡一区二区| 一区二区三区**美女毛片| 国产精品视频观看| 久久久久久久久久久99999| 91精品婷婷国产综合久久竹菊| 日韩美女视频在线| 欧美综合天天夜夜久久| 成人av网站在线| 国产成人在线免费观看| 国产美女在线观看一区| 蜜臀av性久久久久蜜臀av麻豆| 亚洲综合999| 一区二区三区美女| 亚洲老妇xxxxxx| 最新国产精品久久精品| 欧美国产综合一区二区| 中文字幕精品一区二区三区精品| 欧美tk—视频vk| 精品国产伦一区二区三区观看方式| 欧美老肥妇做.爰bbww视频| 欧美亚洲综合一区| 欧美色综合影院| 欧美日韩国产综合视频在线观看| 色一情一乱一乱一91av| 欧美在线观看一二区| 欧美亚洲高清一区二区三区不卡| 在线精品视频免费观看| 欧美在线视频全部完| 欧美少妇bbb| 日韩亚洲国产中文字幕欧美| 欧美tickling网站挠脚心| 欧美成人一区二区三区片免费 | 成人激情动漫在线观看| 国产成人综合亚洲91猫咪| 成人在线视频一区二区| 成人精品国产一区二区4080| 91在线观看下载| 色偷偷成人一区二区三区91| 精品视频在线免费| 日韩欧美国产精品| 亚洲国产成人午夜在线一区| 国产精品麻豆网站| 亚洲成人三级小说| 精一区二区三区| 成人av电影在线观看| 欧美在线视频全部完| 日韩精品在线一区| 成人欧美一区二区三区小说| 午夜精品爽啪视频| 激情小说欧美图片| 91色乱码一区二区三区| 日韩一区二区三区在线视频| 久久精品一区二区三区不卡牛牛| 日韩伦理av电影| 老司机午夜精品99久久| 99久久综合99久久综合网站| 欧美精品久久99久久在免费线| 国产欧美一区二区三区鸳鸯浴| 亚洲黄色小说网站| 久久激情五月激情| 色呦呦日韩精品| 精品国产人成亚洲区| 亚洲第一电影网| 不卡影院免费观看| 精品日韩99亚洲| 亚洲影院理伦片|