1 package org.splat.dal.bo.som;
4 * @author Daniel Brunier-Coulin
5 * @copyright OPEN CASCADE 2012
8 import org.splat.dal.bo.kernel.Persistent;
11 public class KnowledgeElementType extends Persistent {
14 private ProgressState state;
16 // ==============================================================================================================================
18 // ==============================================================================================================================
20 // Database fetch constructor
21 protected KnowledgeElementType () {
23 // Initialization constructor
24 public KnowledgeElementType (String name) {
25 // --------------------------------------------
28 this.state = ProgressState.inCHECK;
31 // ==============================================================================================================================
32 // Public member functions
33 // ==============================================================================================================================
35 public boolean equals(Object entity) {
36 // ------------------------------------
37 if (entity == null) return false;
38 if (entity instanceof String) {
39 return this.name.equals((String)entity); // Names are unique
41 if (entity instanceof KnowledgeElementType) {
42 KnowledgeElementType object = (KnowledgeElementType)entity;
43 long he = object.getIndex();
44 long me = this.getIndex();
45 if (me*he != 0) return (he == me);
46 else return this.getName().equals(object.getName());
52 public String getName () {
53 // ------------------------
57 public boolean isApproved () {
58 // ----------------------------
59 return (state == ProgressState.APPROVED);
62 public boolean isReserved () {
63 // ----------------------------
64 return (state == ProgressState.inWORK);
70 public ProgressState getState() {
75 * @param state the state to set
77 public void setState(ProgressState state) {