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 org.jikesrvm.compilers.opt.ir.Instruction;
016    import org.jikesrvm.compilers.opt.ir.InstructionEnumeration;
017    
018    /**
019     * Instruction priority representation
020     * Used by the scheduler to enumerate over instructions
021     *
022     * @see Scheduler
023     */
024    abstract class Priority implements InstructionEnumeration {
025    
026      /**
027       * Resets the enumeration to the first instruction in sequence
028       */
029      public abstract void reset();
030    
031      /**
032       * Returns true if there are more instructions, false otherwise
033       *
034       * @return true if there are more instructions, false otherwise
035       */
036      public abstract boolean hasMoreElements();
037    
038      /**
039       * Returns the next instruction in sequence
040       *
041       * @return the next instruction in sequence
042       */
043      public final Instruction nextElement() {
044        return next();
045      }
046    
047      /**
048       * Returns the next instruction in sequence
049       *
050       * @return the next instruction in sequence
051       */
052      public abstract Instruction next();
053    }
054    
055    
056