001package jmri.jmrit.operations.automation.actions;
002
003public class CounterAction extends Action {
004
005    private static final int _code = ActionCodes.COUNTER;
006    int _counter = 0;
007
008    @Override
009    public int getCode() {
010        return _code;
011    }
012
013    @Override
014    public String getName() {
015        return Bundle.getMessage("Counter");
016    }
017
018    @Override
019    public void doAction() {
020        _counter += 1;
021        finishAction(true);
022    }
023
024    @Override
025    public void cancelAction() {
026        // no cancel for this action
027    }
028    
029    @Override
030    public String getStatus() {
031        return Integer.toString(_counter);
032    }
033}