]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc/src/main/java/org/argeo/slc/core/structure/tree/TreeSElement.java
1 package org
.argeo
.slc
.core
.structure
.tree
;
4 import java
.util
.Vector
;
6 import org
.argeo
.slc
.core
.structure
.StructureElement
;
7 import org
.argeo
.slc
.core
.structure
.StructurePath
;
9 public class TreeSElement
implements StructureElement
{
10 private String description
;
11 private TreeSPath path
;
13 private List
<TreeSElement
> children
= new Vector
<TreeSElement
>();
15 public String
getDescription() {
19 public void setDescription(String description
) {
20 this.description
= description
;
23 public StructurePath
getPath() {
27 public List
<TreeSElement
> getChildren() {
31 public TreeSElement
createChild(String name
, String description
) {
32 TreeSElement element
= new TreeSElement();
33 element
.path
= TreeSPath
.createChild((TreeSPath
) this.getPath(), name
);
34 element
.description
= description
;
35 children
.add(element
);
39 public static TreeSElement
createRootElelment(String name
,
41 TreeSElement element
= new TreeSElement();
42 element
.path
= TreeSPath
.createChild(null, name
);
43 element
.description
= description
;
48 public boolean equals(Object obj
) {
49 if (obj
instanceof StructureElement
) {
50 StructureElement element
= (StructureElement
) obj
;
51 return getPath().equals(element
.getPath());