1 23 24 package org.objectweb.jorm.metainfo.lib; 25 26 import org.objectweb.jorm.metainfo.api.MetaObject; 27 import org.objectweb.jorm.metainfo.api.PrimitiveElement; 28 import org.objectweb.jorm.type.api.PType; 29 30 36 public class BasicPrimitiveElement 37 extends BasicTypedElement 38 implements PrimitiveElement { 39 40 41 boolean isAutoCalculated = false; 42 43 int status = VARIABLE_PERSISTENT; 44 45 48 private int size = PType.NOSIZE; 49 private int scale = PType.NOSIZE; 50 51 52 60 public BasicPrimitiveElement(String name, 61 PType type, 62 int size, 63 int scale, 64 MetaObject parent) { 65 super(name, type, parent); 66 this.size = size; 67 this.scale = scale; 68 69 } 70 71 75 79 public int getSize() { 80 return size; 81 } 82 83 public int getScale() { 84 return scale; 85 } 86 87 93 public boolean isScalar() { 94 return false; 96 } 97 98 public boolean isAutoCalculated() { 99 return isAutoCalculated; 100 } 101 102 public void setIsAutoCalculated(boolean autocalculated) { 103 isAutoCalculated = autocalculated; 104 } 105 106 public int getStatus() { 107 return status; 108 } 109 110 public void setStatus(int status) { 111 this.status = status; 112 } 113 114 public boolean isConstant() { 115 return status == CONSTANT_NON_PERSISTENT 116 || status == CONSTANT_PERSISTENT; 117 } 118 119 public boolean isPersistent() { 120 return status == CONSTANT_PERSISTENT || status == VARIABLE_PERSISTENT; 121 } 122 } 123 | Popular Tags |