/** * This method removes a crumble object from the cookie crumble. And all ones that follow. * * @param key - name of crumble you are looking for */ public void trimCrumble(String key) { if (key == null) { return; } else { JspCrumbleObject cro = (JspCrumbleObject) _hashCrumble.get(key); if (cro == null) { return; } int i = _arrCrumble.size() - 1; int stopIndex = _arrCrumble.indexOf(cro); for (; i >= stopIndex; i--) { cro = (JspCrumbleObject) _arrCrumble.remove(i); _hashCrumble.remove(cro.getName()); } } }
/** * This method adds a crumble object to the cookie crumble. * * @param cro */ public void addCrumble(JspCrumbleObject cro) { _arrCrumble.add(cro); _hashCrumble.put(cro.getName(), cro); }