<commit_before>package gumtree.spoon.builder;

import spoon.reflect.declaration.CtElement;
import spoon.reflect.path.CtPath;
import spoon.reflect.path.CtRole;
import spoon.reflect.visitor.CtVisitor;
import spoon.support.reflect.declaration.CtElementImpl;

/**
 * This class wraps objects that do not inherit from CtElement.
 * 
 * Represents Information that does not exist in the Spoon hierarchy i.e., it
 * does not inherit from CtElement, but exists somewhere in the model (e.g., an
 * attribute of a particular CtElement)
 * 
 */
public class CtWrapper<L> extends CtElementImpl {

	/**
	 * The object to be wrapped
	 */
	protected L value;

	protected CtRole roleInParent;

	public CtWrapper(L wrapped, CtElement parent) {
		super();
		this.value = wrapped;
		this.parent = parent;
	}

	public CtWrapper(L wrapped, CtElement parent, CtRole roleInParent) {
		super();
		this.value = wrapped;
		this.parent = parent;
		this.roleInParent = roleInParent;
	}

	@Override
	public void accept(CtVisitor visitor) {

	}

	@Override
	public String toString() {
		return (value != null) ? value.toString() : null;
	}

	public L getValue() {
		return value;
	}<commit_msg>factory is set for CtWrapper and CtVirtualElement (#115)<commit_after>package gumtree.spoon.builder;

import spoon.reflect.declaration.CtElement;
import spoon.reflect.path.CtPath;
import spoon.reflect.path.CtRole;
import spoon.reflect.visitor.CtVisitor;
import spoon.support.reflect.declaration.CtElementImpl;

/**
 * This class wraps objects that do not inherit from CtElement.
 * 
 * Represents Information that does not exist in the Spoon hierarchy i.e., it
 * does not inherit from CtElement, but exists somewhere in the model (e.g., an
 * attribute of a particular CtElement)
 * 
 */
public class CtWrapper<L> extends CtElementImpl {

	/**
	 * The object to be wrapped
	 */
	protected L value;

	protected CtRole roleInParent;

	public CtWrapper(L wrapped, CtElement parent) {
		super();
		this.value = wrapped;
		this.parent = parent;
		setFactory(parent.getFactory());
	}

	public CtWrapper(L wrapped, CtElement parent, CtRole roleInParent) {
		super();
		this.value = wrapped;
		this.parent = parent;
		this.roleInParent = roleInParent;
		setFactory(parent.getFactory());
	}

	@Override
	public void accept(CtVisitor visitor) {

	}

	@Override
	public String toString() {
		return (value != null) ? value.toString() : null;
	}

	public L getValue() {
		return value;
	}
{'fraction_non_alphanumeric': 0.10118803768947153, 'fraction_numerical': 0.0012290045063498567, 'mean_word_length': 4.151898734177215, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7481349', 'n_tokens_mistral': 814, 'n_tokens_neox': 726, 'n_words': 231}