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

📄 simplereadtable.java

📁 很棒的web服务器源代码
💻 JAVA
字号:
/*
 *  SimpleReadtable.java
 *
 *  Copyright 1997 Massachusetts Institute of Technology.
 *  All Rights Reserved.
 *
 *  Author: Ora Lassila
 *
 *  $Id: SimpleReadtable.java,v 1.2 1998/01/22 13:09:19 bmahe Exp $
 */

package org.w3c.tools.sexpr;

/**
 * Basic implementation of the Readtable interface, a dispatch table.
 */
public class SimpleReadtable implements Readtable {

  private SExprParser parsers[];

  /**
   * Initializes an empty dispatch table (no associations).
   */
  public SimpleReadtable()
  {
    this.parsers = new SExprParser[256];
  }

  /**
   * Copy constructor.
   */
  public SimpleReadtable(SimpleReadtable table)
  {
    this.parsers = new SExprParser[256];
    for (int i = 0; i < 256; i++)
      this.parsers[i] = table.parsers[i];
  }

  public SExprParser getParser(char key)
  {
    return parsers[(int)key];
  }

  public SExprParser addParser(char key, SExprParser parser)
  {
    parsers[(int)key] = parser;
    return parser;
  }

}

⌨️ 快捷键说明

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