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.mmtk.utility.options;
014    
015    import org.vmmagic.pragma.*;
016    
017    /**
018     * A composite option that provides a min/max interface to MMTk,
019     * and a fixed/bounded option interface to the VM/user.
020     */
021    public final class NurserySize {
022      // values
023      private FixedNursery fixedNursery;
024      private BoundedNursery boundedNursery;
025    
026      /**
027       * Create the options.
028       */
029      public NurserySize() {
030        boundedNursery = new BoundedNursery();
031        fixedNursery = new FixedNursery(boundedNursery);
032      }
033    
034      /**
035       * Read the upper bound of the nursery size.
036       *
037       * @return maximum number of pages in the nursery.
038       */
039      @Uninterruptible
040      public int getMaxNursery() {
041        return boundedNursery.getPages();
042      }
043    
044      /**
045       * Read the lower bound of the nursery size.
046       *
047       * @return minimum number of pages in the nursery.
048       */
049      @Uninterruptible
050      public int getMinNursery() {
051        return fixedNursery.getPages();
052      }
053    }