annotatable.java

来自「用Java实现的编译器。把源代码编译成SPARC汇编程序」· Java 代码 · 共 50 行

JAVA
50
字号
// $Id: Annotatable.java,v 1.5 2000/10/10 15:47:49 mdeeds Exp $package java6035.tools.IR;import java.util.Enumeration;/** *  annotations are <tag,value> pairs we can attach to things.  You *  may find this useful for attaching line numbers, or optimizatin *  information to your IR tree. **/public interface Annotatable{    /**     * Add the annotation @param(data) associated with the tag     * @param(tag)     **/    public void annotate(int tag, Object data);    /**     * Return the value associated with @param(tag).  If there is no     * anotation (data) associated with @param(tag) the behavior of     * this function is undefined.  It is most likely that it will be     * null though.     **/    public Object getAnnotation(int tag);    /**     * Remove the association between @param(tag) and whatever it     * is currently associated with.     **/    public Object removeAnnotation(int tag);    /**     * Returns an Enumeration of all the tags which are associated     * with values for this object.  The values returned by the     * Enumeration should be in the form of Integer objects.     **/    public Enumeration listTags();    /**     * Returns an Enumeration of all the annotations (data) which have     * associated tags for this object.  The values returned by the     * Enumeration are the Objects which were passed in via     * setAnnotation.  They are not clones.     **/    public Enumeration listAnnotations();}

⌨️ 快捷键说明

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