001package edu.wpi.first.wpilibj.networktables2.util; 002 003 004/** 005 * 006 * A simple unsynchronized stack implementation 007 * 008 * @author mwills 009 * 010 */ 011public class Stack extends List{ 012 013 /** 014 * Push an element onto the stack 015 * @param element 016 */ 017 public void push(final Object element){ 018 add(element); 019 } 020 /** 021 * @return the element on the top of the stack and remove it 022 */ 023 public Object pop(){ 024 if(size==0) 025 return null; 026 Object value = get(size-1); 027 remove(size-1); 028 return value; 029 } 030}