<commit_before>/*************** <auto-copyright.pl BEGIN do not edit this line> **************
 *
 * VR Juggler is (C) Copyright 1998, 1999, 2000 by Iowa State University
 *
 * Original Authors:
 *   <NAME>, <NAME>,
 *   <NAME>, <NAME>,
 *   <NAME>, <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * -----------------------------------------------------------------
 * File:          $RCSfile$
 * Date modified: $Date$
 * Version:       $Revision$
 * -----------------------------------------------------------------
 *
 *************** <auto-copyright.pl END do not edit this line> ***************/


/* ValType - just replaces our valtype enumeration, more or less */

package VjConfig;

/** Identification of the different types of values that VarValues can have.
 *  Each possible ValType is represented by a static public member of this
 *  class.  Because these instances are final and no other ValTypes can be
 *  created, it is safe to do direct object comparisons.  ie vt1 == vt2 can
 *  be treated as equivalent to vt1.equals(vt2).
 */
public class ValType {

    public final static ValType STRING = new ValType (t_string);
    public final static ValType FLOAT = new ValType (t_float);
    public final static ValType INT = new ValType (t_int);
    public final static ValType BOOL = new ValType (t_bool);
    public final static ValType CHUNK = new ValType (t_chunk);
    public final static ValType EMBEDDEDCHUNK = new ValType (t_embeddedchunk);
    public final static ValType INVALID = new ValType (t_invalid);

    private int val; // type identifier for this instance.

    private final static int t_string        = 1;
    private final static int t_float         = 2;
    private final static int t_int           = 3;
    private final static int t_bool          = 4;
    private final static int t_chunk         = 5;
    private final static int t_embeddedchunk = 6;
    private final static int t_invalid       = 7;


    /** Constructor.  Private so that no other ValTypes can be created. */
    private ValType (int i) {
	val = i;
    }


    /** Returns the ValType associated with a String value.
     *  This can be used in various parsing routines.
     */
    public static ValType getValType (String s) {
	String s2 = s.toLowerCase().trim();
	if (s2.equalsIgnoreCase ("string"))
	    return STRING;
	else if (s2.equalsIgnoreCase ("float"))
	    return FLOAT;
	else if (s2.equalsIgnoreCase ("int"))
	    return INT;
	else if (s2.equalsIgnoreCase ("bool"))
	    return BOOL;
	else if (s2.equalsIgnoreCase ("chunk"))<commit_msg>Fixed some forward reference problems that accidentally creeped in. Also marked the class as final, since subclasses of ValType wandering around the system could really mess with the assumptions it operates under.<commit_after>/*************** <auto-copyright.pl BEGIN do not edit this line> **************
 *
 * VR Juggler is (C) Copyright 1998, 1999, 2000 by Iowa State University
 *
 * Original Authors:
 *   <NAME>, <NAME>,
 *   <NAME>, <NAME>,
 *   <NAME>, <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * -----------------------------------------------------------------
 * File:          $RCSfile$
 * Date modified: $Date$
 * Version:       $Revision$
 * -----------------------------------------------------------------
 *
 *************** <auto-copyright.pl END do not edit this line> ***************/


/* ValType - just replaces our valtype enumeration, more or less */

package VjConfig;

/** Identification of the different types of values that VarValues can have.
 *  Each possible ValType is represented by a static public member of this
 *  class.  Because these instances are final and no other ValTypes can be
 *  created, it is safe to do direct object comparisons.  ie vt1 == vt2 can
 *  be treated as equivalent to vt1.equals(vt2).
 */
public final class ValType {

    private final static int t_string        = 1;
    private final static int t_float         = 2;
    private final static int t_int           = 3;
    private final static int t_bool          = 4;
    private final static int t_chunk         = 5;
    private final static int t_embeddedchunk = 6;
    private final static int t_invalid       = 7;


    public final static ValType STRING = new ValType (t_string);
    public final static ValType FLOAT = new ValType (t_float);
    public final static ValType INT = new ValType (t_int);
    public final static ValType BOOL = new ValType (t_bool);
    public final static ValType CHUNK = new ValType (t_chunk);
    public final static ValType EMBEDDEDCHUNK = new ValType (t_embeddedchunk);
    public final static ValType INVALID = new ValType (t_invalid);

    private int val; // type identifier for this instance.


    /** Constructor.  Private so that no other ValTypes can be created. */
    private ValType (int i) {
	val = i;
    }


    /** Returns the ValType associated with a String value.
     *  This can be used in various parsing routines.
     */
    public static ValType getValType (String s) {
	String s2 = s.toLowerCase().trim();
	if (s2.equalsIgnoreCase ("string"))
	    return STRING;
	else if (s2.equalsIgnoreCase ("float"))
	    return FLOAT;
	else if (s2.equalsIgnoreCase ("int"))
	    return INT;
	else if (s2.equalsIgnoreCase ("bool"))
	    return BOOL;
	else if (s2.equalsIgnoreCase ("chunk"))
{'fraction_non_alphanumeric': 0.12761848165205764, 'fraction_numerical': 0.013073837468429654, 'mean_word_length': 2.7358490566037736, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6985654', 'n_tokens_mistral': 1854, 'n_tokens_neox': 1759, 'n_words': 831}