001    /*
002     *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003     *
004     *  This file is licensed to You under the Eclipse Public License (EPL);
005     *  You may not use this file except in compliance with the License. You
006     *  may obtain a copy of the License at
007     *
008     *      http://www.opensource.org/licenses/eclipse-1.0.php
009     *
010     *  See the COPYRIGHT.txt file distributed with this work for information
011     *  regarding copyright ownership.
012     */
013    package org.jikesrvm.compilers.opt.instrsched;
014    
015    import java.util.Enumeration;
016    
017    import org.jikesrvm.compilers.opt.ir.Instruction;
018    
019    /**
020     * Represents instruction priority. Used by the scheduler to enumerate over
021     * instructions.
022     *
023     * @see Scheduler
024     */
025    abstract class Priority implements Enumeration<Instruction> {
026    
027      /**
028       * Resets the enumeration to the first instruction in sequence
029       */
030      public abstract void reset();
031    
032      /**
033       * Returns {@code true} if there are more instructions, false otherwise
034       *
035       * @return {@code true} if there are more instructions, false otherwise
036       */
037      @Override
038      public abstract boolean hasMoreElements();
039    
040      /**
041       * Returns the next instruction in sequence
042       *
043       * @return the next instruction in sequence
044       */
045      @Override
046      public abstract Instruction nextElement();
047    }
048    
049    
050