1 /* 2 * CSVeed (https://github.com/42BV/CSVeed) 3 * 4 * Copyright 2013-2023 CSVeed. 5 * 6 * All rights reserved. This program and the accompanying materials 7 * are made available under the terms of The Apache Software License, 8 * Version 2.0 which accompanies this distribution, and is available at 9 * https://www.apache.org/licenses/LICENSE-2.0.txt 10 */ 11 package org.csveed.token; 12 13 /** 14 * The Enum TokenState. 15 */ 16 public enum TokenState { 17 18 /** The reset. */ 19 RESET, 20 21 /** The start. */ 22 START, 23 24 /** The processing. */ 25 PROCESSING; 26 27 /** 28 * Next. 29 * 30 * @return the token state 31 */ 32 public TokenState next() { 33 return values()[(ordinal() + 1) % 3]; 34 } 35 36 /** 37 * Checks if is start. 38 * 39 * @return true, if is start 40 */ 41 public boolean isStart() { 42 return this == START; 43 } 44 45 /** 46 * Checks if is reset. 47 * 48 * @return true, if is reset 49 */ 50 public boolean isReset() { 51 return this == RESET; 52 } 53 }