<commit_before>package de.hpi.bpmn;

import de.hpi.util.Bounds;


public abstract class Node extends DiagramObject {
	
	protected String label;
	protected Container parent;
	protected Container process;
	protected Bounds bounds;
	
	public String toString() {
		return (label != null ? label : resourceId);
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		if (label != null)
			label = label.replace("\n", "_").replace(" ", "_");
		this.label = label;
	}

	public Container getParent() {
		return parent;
	}

	public void setParent(Container parent) {
		if (this.parent != parent) {
			if (this.parent != null && this.parent != this.process)
				this.parent.getChildNodes().remove(this);
			if (parent != null && parent != this.process)
				parent.getChildNodes().add(this);
		}
		this.parent = parent;
	}

	public Container getProcess() {
		return process;
	}

	public void setProcess(Container process) {
		if (this.process != process) {
			if (this.process != null && this.process != this.parent)
				this.process.getChildNodes().remove(this);
			if (process != null && process != this.parent)
				process.getChildNodes().add(this);
		}
		this.process = process;
	}
	
	public Bounds getBounds() {
		return bounds;
	}

	public void setBounds(Bounds bounds) {
		this.bounds = bounds;
	}


	public Node getCopy() {
		try {
			Node newnode = (Node)this.getClass().newInstance();
			newnode.setId(this.getId());
			newnode.setLabel(this.getLabel());
			newnode.setResourceId(this.getResourceId());
			return newnode;
		} catch (InstantiationException e) {
			return null;
		} catch (IllegalAccessException e) {
			return null;
		}
	}
<commit_msg>added new method<commit_after>package de.hpi.bpmn;

import de.hpi.util.Bounds;


public abstract class Node extends DiagramObject {
	
	protected String label;
	protected Container parent;
	protected Container process;
	protected Bounds bounds;
	
	public String toString() {
		return (label != null ? label : resourceId);
	}

	public String getLabel() {
		return label;
	}


	public void setLabel(String label) {
		if (label != null)
			label = label.replace("\n", "_").replace(" ", "_");
		this.label = label;
	}

	public Container getParent() {
		return parent;
	}

	public void setParent(Container parent) {
		if (this.parent != parent) {
			if (this.parent != null && this.parent != this.process)
				this.parent.getChildNodes().remove(this);
			if (parent != null && parent != this.process)
				parent.getChildNodes().add(this);
		}
		this.parent = parent;
	}

	public Container getProcess() {
		return process;
	}

	public void setProcess(Container process) {
		if (this.process != process) {
			if (this.process != null && this.process != this.parent)
				this.process.getChildNodes().remove(this);
			if (process != null && process != this.parent)
				process.getChildNodes().add(this);
		}
		this.process = process;
	}
	
	public Bounds getBounds() {
		return bounds;
	}

	public void setBounds(Bounds bounds) {
		this.bounds = bounds;
	}


	public Node getCopy() {
		try {
			Node newnode = (Node)this.getClass().newInstance();
			newnode.setId(this.getId());
			newnode.setLabel(this.getLabel());
			newnode.setResourceId(this.getResourceId());
			return newnode;
		} catch (InstantiationException e) {
			return null;
		} catch (IllegalAccessException e) {
			return null;
		}
	}
	
	public void setLabelInclWhitespaces(String label) {
		this.label = label;
	}

{'fraction_non_alphanumeric': 0.1345486111111111, 'fraction_numerical': 0.0, 'mean_word_length': 3.6842818428184283, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2635255', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1093, 'n_words': 272}