public class SharpStack { private SharpStackItem lastSharp; public SharpStackItem currentSharp; private boolean hasSharps; private SharpStackItem newItem; public SharpStack() { lastSharp = null; currentSharp = null; hasSharps = false; } public void addItem(Sharp sharp) { if(hasSharps == false) { newItem = new SharpStackItem(sharp); } else { newItem = new SharpStackItem(sharp, lastSharp.getSharp()); } sharp.setStackItem(newItem); lastSharp = newItem; currentSharp = newItem; hasSharps = true; } public boolean hasMore() { if(!hasSharps) return false; if(currentSharp.isFirst()) return false; else return true; } public boolean hasAny() { return hasSharps; } public Sharp getCurrent() { return currentSharp.getSharp(); } public void nextItem() { currentSharp = currentSharp.getPrevious(); } }
Notice: (null)(): [ALERT] Mailbox is over quota in Unknown on line 0