Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
10 shop2020 1
/**
2
 * 
3
 */
4
package in.shop2020.metamodel.definitions;
5
 
16 naveen 6
import java.util.ArrayList;
10 shop2020 7
import java.util.List;
8
 
9
/**
10
 * @author naveen
11
 *
12
 */
13
public class CompositeDefinition extends DatatypeDefinition {
14
 
15
	/**
16
	 * 
17
	 */
18
	private static final long serialVersionUID = 1L;
20 naveen 19
	private String separator;
10 shop2020 20
	private List<CompositePartDefinition> compositePartDefinitions;
21
 
22
	/**
23
	 * @param newID
24
	 */
20 naveen 25
	public CompositeDefinition(long newID, String name, String separator) {
16 naveen 26
		super(newID, name);
20 naveen 27
		this.separator = separator;
10 shop2020 28
	}
29
 
30
	/**
20 naveen 31
	 * @param separator the separator to set
32
	 */
33
	public void setSeparator(String separator) {
34
		this.separator = separator;
35
	}
36
 
37
	/**
38
	 * @return the separator
39
	 */
40
	public String getSeparator() {
41
		return separator;
42
	}
43
 
44
	/**
16 naveen 45
	 * 
46
	 * @param partDefinition
47
	 */
48
	public void addCompositePartDefinition(
49
			CompositePartDefinition partDefinition) {
50
 
51
		if(this.compositePartDefinitions == null) {
52
			this.compositePartDefinitions = 
53
				new ArrayList<CompositePartDefinition>();
54
		}
55
 
56
		this.compositePartDefinitions.add(partDefinition);
57
	}
58
 
59
	/**
10 shop2020 60
	 * @param compositePartDefinitions the compositePartDefinitions to set
61
	 */
62
	public void setCompositePartDefinitions(List<CompositePartDefinition> compositePartDefinitions) {
63
		this.compositePartDefinitions = compositePartDefinitions;
64
	}
65
 
66
	/**
67
	 * @return the compositePartDefinitions
68
	 */
69
	public List<CompositePartDefinition> getCompositePartDefinitions() {
70
		return compositePartDefinitions;
71
	}
72
 
16 naveen 73
	/* (non-Javadoc)
74
	 * @see java.lang.Object#toString()
75
	 */
76
	@Override
77
	public String toString() {
78
		return "CompositeDefinition [compositePartDefinitions="
20 naveen 79
				+ compositePartDefinitions + ", separator=" + separator
80
				+ ", getDescription()=" + getDescription() + ", getName()="
81
				+ getName() + ", getID()=" + getID() + "]";
16 naveen 82
	}
10 shop2020 83
}