You are here

LRSStackFactory.java

15 January, 2016 - 09:02
Available under Creative Commons-ShareAlike 4.0 International License. Download for free at http://cnx.org/contents/402b20ad-c01f-45f1-9743-05eadb1f710e@37.6
package rac; 
import lrs.*; 
public class LRSStackFactory extends ALRSRACFactory { 
    /** 
     * Create a ''last-in, first-out'' (LIFO) container. 
     */ 
    public IRAContainer makeRAC() { 
      return new LRSRAContainer(new IAlgo() { 
        public Object emptyCase(LRStruct host, Object... input) { 
           return host.insertFront(input[0]); 
        } 
        public Object nonEmptyCase(LRStruct host, Object... input) { 
           return host.insertFront(input[0]); 
        } 
      }); 
    } 
}