⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bookmark.java

📁 一个用Java写的
💻 JAVA
字号:
package com.tinyline.app;public class Bookmark{  private static final char delimiter = '|';  /**   * Creates a <tt>Bookmark</tt> object from the   * given <tt>String</tt>. It uses the following format:   *   * name|URL   * @param s a string representing a <tt>Bookmark</tt>   */  public static Bookmark create(String s)        {     String pname, purl;     int index = 0;     // Parse name and url.     index = s.indexOf(delimiter);     if (index == -1)       throw new IllegalArgumentException("Could not parse name.");     pname = s.substring(0,index);     purl = s.substring(index+1);     return new Bookmark(pname, purl);  }  public String name, url;  /**   * Creates a new <tt>Bookmark</tt> with the specified   * name and URL.   *   * @param name a name for the <tt>Bookmark</tt>   * @param purl a URL for the <tt>Bookmark</tt>   */  protected Bookmark(String pname, String purl)        {     name = pname;     url  = purl;  }  /**   * Returns the serialized <tt>Bookmark</tt> object.   */  public String getRaw()        {    StringBuffer buffer = new StringBuffer();    buffer.append(name);    buffer.append(delimiter);    buffer.append(url);    return buffer.toString();  }}

⌨️ 快捷键说明

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