package org.argeo.slc.core.structure;
import java.util.Map;
import java.util.TreeMap;
import org.argeo.slc.core.structure.tree.TreeSPath;
import org.argeo.slc.structure.StructureElement;
/**
* Basic implementation of StructureElement
.
*
* @see TreeSPath
*/
public class SimpleSElement implements StructureElement {
/** For ORM */
private Long tid;
private String label;
private Map tags = new TreeMap();
/** For ORM */
public SimpleSElement() {
}
/** Constructor */
public SimpleSElement(String label) {
this.label = label;
}
/** Constructor */
public SimpleSElement(String label, String defaultLabel) {
this(label != null ? label : defaultLabel);
}
/** Constructor */
public SimpleSElement(SimpleSElement sElement) {
setLabel(sElement.getLabel());
setTags(new TreeMap(sElement.getTags()));
}
public String getLabel() {
return label;
}
/** Sets the label. */
public void setLabel(String label) {
this.label = label;
}
public Long getTid() {
return tid;
}
void setTid(Long tid) {
this.tid = tid;
}
public Map getTags() {
return tags;
}
public void setTags(Map tags) {
this.tags = tags;
}
@Override
public SimpleSElement clone() {
return new SimpleSElement(this);
}
}