bookmarkedcatalogitem.java

来自「基于jxta的文件共享和聊天系统源代码,下载下来分析吧」· Java 代码 · 共 103 行

JAVA
103
字号
/* * Created on 21-nov-2005 * *//** * @author magowiz * */package p2p_system;import java.net.MalformedURLException;import java.net.URL;public class BookmarkedCatalogItem {	private String catalogLabel;	private String catalogName;	private URL catalogURL;		private BookmarkedCatalogItem next;		public BookmarkedCatalogItem ()	{		catalogLabel="*";		catalogName="*";		try {catalogURL=new URL("http://localhost");}		catch(MalformedURLException mue){}		next=null;	}		public BookmarkedCatalogItem (String cl,String cn, URL cu,BookmarkedCatalogItem n)	{		catalogLabel=cl;		catalogName=cn;		catalogURL=cu;		next=n;	}		public BookmarkedCatalogItem (String cl,String cn, URL cu)	{		catalogLabel=new String(cl);		catalogName=new String(cn);		try{catalogURL=new URL(cu.toString());}		catch(Exception e)		{			e.printStackTrace();		}	}		public String getCatalogLabel()	{		return this.catalogLabel;	}		public URL getCatalogUrl()	{		return this.catalogURL;	}		public String getCatalogName()	{		return this.catalogName;	}		public void setNext(BookmarkedCatalogItem n)	{		next=n;	}		public BookmarkedCatalogItem getNext()	{		return this.next;	}		public String toString()	{	 String r="";	 r=r+"cl "+ catalogLabel+"\n";	 r=r+"cn "+ catalogName+"\n";	 r=r+"cu "+ catalogURL.toString()+"\n";	 return r;	}		public void insert(String cl, String cn, URL u)	{		this.catalogLabel=cl;		this.catalogName=cn;		this.catalogURL=u;	}			public BookmarkedCatalogItem (BookmarkedCatalogItem bci)	{		this.catalogLabel=new String(bci.catalogLabel);		this.catalogName= new String(bci.catalogName);		try{this.catalogURL=new URL (bci.getCatalogUrl().toString());}		catch(Exception e){e.printStackTrace();}		this.next=bci.getNext();	}	}

⌨️ 快捷键说明

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