public void addVariable(int index, String access, String type, String name,
			boolean setget) {
		// default access modifier = write nothing in front
		if (access.equals("default"))
			access = "";
		// set the code part
		String code = access + " " + type + " " + name + ";";
		// change the access modifiers names to symbols
		if (access.equals("public"))
			access = "+";
		else if (access.equals("private"))
			access = "-";
		else if (access.equals("protected"))
			access = "#";
		// set the diagram part
		String diagram = access + name + ":" + type;
		// add the variable
		classData.get(index).addVariable(code, diagram);
		// change the height of the class (+13) if necessary
		if (classData.get(index).getVariables().size() > 1)
			classData.get(index).setHeight(
					classData.get(index).getHeight() + 13);

		// if user decides to automatically generate set and get methods...
		if (setget == true) {
			// set method in code
			String codeSetMethod = "public void set" + name + "(" + type
					+ " a)\n\t{\n\t\t" + name + " = a;\n\t}";
			// set method in diagram
			String diagramSetMethod = "+set" + name + "(a:" + type + "):void";
			// add the set method
			classData.get(index).addMethod(codeSetMethod, diagramSetMethod);
			// change the height of the class (+13) if necessary
			if (classData.get(index).getMethods().size() > 1)
				classData.get(index).setHeight(
						classData.get(index).getHeight() + 13);
			// get method in code
			String codeGetMethod = "public " + type + " get" + name
					+ "()\n\t{\n\t\t return " + name + ";\n\t}";
			// get method in diagram
			String diagramGetMethod = "+get" + name + "():" + type;
			// add the get method
			classData.get(index).addMethod(codeGetMethod, diagramGetMethod);
			// change the height of the class (+13) if necessary
			if (classData.get(index).getMethods().size() > 1)
				classData.get(index).setHeight(
						classData.get(index).getHeight() + 13);
		}
	}