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

📄 icltermcache.java

📁 SRI international 发布的OAA框架软件
💻 JAVA
字号:
package com.sri.oaa2.icl;
import java.util.HashMap;

public class IclTermCache 
{
  public static HashMap cacheMap = new HashMap();

  public static IclTerm get(String s) 
  {
    synchronized(cacheMap) {
      if(cacheMap.containsKey(s)) {
        IclTerm t = (IclTerm)cacheMap.get(s);
        t = ToReadOnly.getInstance().from(t, false);
        AnonNumberer.getInstance().renumber(t);
        t = ToReadOnly.getInstance().from(t, true);
        return t;
      }
      else {
        IclTerm t;
        try {
          t = IclTerm.fromString(s);
        }
        catch(Exception e) {
          RuntimeException re = new RuntimeException(e.toString());
          re.fillInStackTrace();
          throw re;
        }
        cacheMap.put(s, t);
        return t;
      }
    }
  }

  public static IclTerm getNoAnon(String s) 
  {
    synchronized(cacheMap) {
      if(cacheMap.containsKey(s)) {
        IclTerm t = (IclTerm)cacheMap.get(s);
        return t;
      }
      else {
        IclTerm t;
        try {
          t = IclTerm.fromString(s);
        }
        catch(Exception e) {
          RuntimeException re = new RuntimeException(e.toString());
          re.fillInStackTrace();
          throw re;
        }
        cacheMap.put(s, t);
        return t;
      }
    }
  }
}

⌨️ 快捷键说明

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