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 EncounteredSymbol. 15 */ 16 public enum EncounteredSymbol { 17 18 /** The space symbol. */ 19 SPACE_SYMBOL, 20 /** The separator symbol. */ 21 SEPARATOR_SYMBOL, 22 /** The quote symbol. */ 23 QUOTE_SYMBOL(true), 24 /** The escape symbol. */ 25 ESCAPE_SYMBOL(true), 26 /** The eol symbol. */ 27 EOL_SYMBOL, 28 /** The eol symbol trash. */ 29 EOL_SYMBOL_TRASH(false, true), 30 31 /** The other symbol. */ 32 OTHER_SYMBOL, 33 /** The bom symbol. */ 34 BOM_SYMBOL(false, true), 35 /** The end of file symbol. */ 36 END_OF_FILE_SYMBOL, 37 /** The comment symbol. */ 38 COMMENT_SYMBOL; 39 40 /** The check for similar escape and quote. */ 41 private final boolean checkForSimilarEscapeAndQuote; 42 43 /** The trash. */ 44 private final boolean trash; 45 46 /** 47 * Instantiates a new encountered symbol. 48 */ 49 EncounteredSymbol() { 50 this(false, false); 51 } 52 53 /** 54 * Instantiates a new encountered symbol. 55 * 56 * @param checkForSimilarEscapeAndQuote 57 * the check for similar escape and quote 58 */ 59 EncounteredSymbol(boolean checkForSimilarEscapeAndQuote) { 60 this(checkForSimilarEscapeAndQuote, false); 61 } 62 63 /** 64 * Instantiates a new encountered symbol. 65 * 66 * @param checkForSimilarEscapeAndQuote 67 * the check for similar escape and quote 68 * @param trash 69 * the trash 70 */ 71 EncounteredSymbol(boolean checkForSimilarEscapeAndQuote, boolean trash) { 72 this.checkForSimilarEscapeAndQuote = checkForSimilarEscapeAndQuote; 73 this.trash = trash; 74 } 75 76 /** 77 * Checks if is check for similar escape and quote. 78 * 79 * @return true, if is check for similar escape and quote 80 */ 81 public boolean isCheckForSimilarEscapeAndQuote() { 82 return this.checkForSimilarEscapeAndQuote; 83 } 84 85 /** 86 * Checks if is trash. 87 * 88 * @return true, if is trash 89 */ 90 public boolean isTrash() { 91 return this.trash; 92 } 93 94 }