xcacheitem.java

来自「java写的浏览器」· Java 代码 · 共 78 行

JAVA
78
字号
/****************************************************************
*              XBrowser  -  eXtended web Browser                *
*                                                               *
*           Copyright (c) 2000-2001  Armond Avanes              *
*     Refer to ReadMe & License files for more information      *
*                                                               *
*                                                               *
*                      By: Armond Avanes                        *
*       Armond555@yahoo.com     &    Armond333@yahoo.com        *
*                http://xbrowser.sourceforge.net/               *
*****************************************************************/
package xbrowser.cache;

import java.io.*;

public class XCacheItem
{
	public String toString()
	{
		return( "URL: " + getURL() + ";File-Name: " + getFileName() + ";Content-Type: " + getContentType() );
	}

	public boolean equals(Object obj)
	{
		if( !(obj instanceof XCacheItem) )
			return false;

	XCacheItem cache_item = (XCacheItem)obj;

		return( cache_item.getURL().equalsIgnoreCase(getURL()) );
	}

	public String getURL()
	{
		return url;
	}

	public void setURL(String new_url)
	{
		url = new_url;
	}

	public String getFileName()
	{
		return fileName;
	}

	public File getFile()
	{
		return new File(fileName);
	}

	public void setFileName(String new_file_name)
	{
		fileName = new_file_name;
	}

	public String getContentType()
	{
		return contentType;
	}

	public void setContentType(String new_content_type)
	{
		contentType = new_content_type;
	}

	public void delete()
	{
		getFile().delete();
	}

// Attributes:
	private String 	url;
	private String 	fileName;
	private String 	contentType;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?