<commit_before>package org.commcare.suite.model;

import org.commcare.session.SessionFrame;
import org.javarosa.core.model.condition.EvaluationContext;
import org.javarosa.core.util.externalizable.DeserializationException;
import org.javarosa.core.util.externalizable.ExtUtil;
import org.javarosa.core.util.externalizable.ExtWrapMap;
import org.javarosa.core.util.externalizable.Externalizable;
import org.javarosa.core.util.externalizable.PrototypeFactory;
import org.javarosa.xpath.XPathException;
import org.javarosa.xpath.XPathParseTool;
import org.javarosa.xpath.expr.XPathFuncExpr;
import org.javarosa.xpath.parser.XPathSyntaxException;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;

/**
 * @author ctsims
 */
public class StackFrameStep implements Externalizable {
    //Share the types with the commands
    private String elementType;
    private String id;
    private String value;
    private boolean valueIsXpath;
    private Hashtable<String, String> extras = new Hashtable<String, String>();

    /**
     * Serialization Only
     */
    public StackFrameStep() {

    }

    /**
     * Copy constructor
     */
    public StackFrameStep(StackFrameStep oldStackFrameStep) {
        this.elementType = oldStackFrameStep.elementType;
        this.id = oldStackFrameStep.id;
        this.value = oldStackFrameStep.value;
        this.valueIsXpath = oldStackFrameStep.valueIsXpath;
        for (Enumeration e = oldStackFrameStep.extras.keys(); e.hasMoreElements(); ) {
            String key = (String)e.nextElement();
            extras.put(key, oldStackFrameStep.extras.get(key));
        }
    }

    public StackFrameStep(String type, String id, String value) {
        this.elementType = type;
        this.id = id;
        this.value = value;
    }

    public StackFrameStep(String type, String id,
                          String value, boolean valueIsXpath) throws XPathSyntaxException {
        this.elementType = type;
        this.id = id;
        this.value = value;
        this.valueIsXpath = valueIsXpath;

        if (valueIsXpath) {
            //Run the parser to ensure that we will fail fast when _creating_ the step, not when
            //running it
            XPathParseTool.parseXPath(value);
        }
    }

    public String getType() {
        return elementType;
    }

    public String getId() {
        return id;
    }<commit_msg>all the 'get's<commit_after>package org.commcare.suite.model;

import org.commcare.session.SessionFrame;
import org.javarosa.core.model.condition.EvaluationContext;
import org.javarosa.core.util.externalizable.DeserializationException;
import org.javarosa.core.util.externalizable.ExtUtil;
import org.javarosa.core.util.externalizable.ExtWrapMap;
import org.javarosa.core.util.externalizable.Externalizable;
import org.javarosa.core.util.externalizable.PrototypeFactory;
import org.javarosa.xpath.XPathException;
import org.javarosa.xpath.XPathParseTool;
import org.javarosa.xpath.expr.XPathFuncExpr;
import org.javarosa.xpath.parser.XPathSyntaxException;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;

/**
 * @author ctsims
 */
public class StackFrameStep implements Externalizable {
    //Share the types with the commands
    private String elementType;
    private String id;
    private String value;
    private boolean valueIsXpath;
    private Hashtable<String, String> extras = new Hashtable<String, String>();

    /**
     * Serialization Only
     */
    public StackFrameStep() {

    }

    /**
     * Copy constructor
     */
    public StackFrameStep(StackFrameStep oldStackFrameStep) {
        this.elementType = oldStackFrameStep.elementType;
        this.id = oldStackFrameStep.id;
        this.value = oldStackFrameStep.value;
        this.valueIsXpath = oldStackFrameStep.valueIsXpath;
        for (Enumeration e = oldStackFrameStep.extras.keys(); e.hasMoreElements(); ) {
            String key = (String)e.nextElement();
            extras.put(key, oldStackFrameStep.extras.elementAt(key));
        }
    }

    public StackFrameStep(String type, String id, String value) {
        this.elementType = type;
        this.id = id;
        this.value = value;
    }

    public StackFrameStep(String type, String id,
                          String value, boolean valueIsXpath) throws XPathSyntaxException {
        this.elementType = type;
        this.id = id;
        this.value = value;
        this.valueIsXpath = valueIsXpath;

        if (valueIsXpath) {
            //Run the parser to ensure that we will fail fast when _creating_ the step, not when
            //running it
            XPathParseTool.parseXPath(value);
        }
    }

    public String getType() {
        return elementType;
    }

    public String getId() {
        return id;
    }
{'fraction_non_alphanumeric': 0.09165829145728643, 'fraction_numerical': 0.0, 'mean_word_length': 2.9649402390438246, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3952222', 'n_tokens_mistral': 1461, 'n_tokens_neox': 1438, 'n_words': 314}