package org.dmd.dmt.shared.generated.dmo;
// Generated from: org.dmd.dms.util.GenUtility.formatImports(GenUtility.java:391)
import java.io.Serializable; // Always required - (GenUtility.java:220)
import java.util.*; // Always required if we have any MV attributes - (GenUtility.java:215)
import org.dmd.dmc.DmcAttribute; // Any attributes - (GenUtility.java:236)
import org.dmd.dmc.DmcNamedObjectIF; // Named object - (GenUtility.java:371)
import org.dmd.dmc.DmcObject; // Structural class - (GenUtility.java:347)
import org.dmd.dmc.DmcOmni; // Lazy resolution - (GenUtility.java:316)
import org.dmd.dmc.DmcSliceInfo; // Required for object slicing - (GenUtility.java:225)
import org.dmd.dmc.DmcValueException; // Any attributes - (GenUtility.java:237)
import org.dmd.dmc.types.StringName; // Naming attribute type - (GenUtility.java:366)
import org.dmd.dms.generated.dmo.MetaDMSAG; // Required for MODREC constructor - (GenUtility.java:224)
import org.dmd.dms.generated.types.DmcTypeModifierMV; // Required for MODREC constructor - (GenUtility.java:223)
import org.dmd.dms.generated.types.DmcTypeStringMV; // Required type - (GenUtility.java:324)
import org.dmd.dms.generated.types.DmcTypeStringNameSV; // Required type - (GenUtility.java:324)
import org.dmd.dms.generated.types.DmcTypeStringSV; // Required type - (GenUtility.java:324)
import org.dmd.dmt.shared.generated.dmo.TestBasicNamedObjectFixedDMO; // Type specific set/add - (GenUtility.java:303)
import org.dmd.dmt.shared.generated.types.DmcTypeTestBasicNamedObjectFixedREFMV; // Reference type - (GenUtility.java:296)
import org.dmd.dmt.shared.generated.types.TestBasicNamedObjectFixedREF; // Helper class - (GenUtility.java:331)
/**
* The TestBasicNamedObjectExtended class provides a test bed for a named
* object\n that's extended.
* <P>
* Generated from the dmt schema at version 0.1
* <P>
* This code was auto-generated by the dmogenerator utility and shouldn't be alterred manually!
* Generated from: org.dmd.dms.util.DmoFormatter.dumpDMO(DmoFormatter.java:133)
*/
@SuppressWarnings("serial")
public class TestBasicNamedObjectExtendedDMO extends DmcObject implements DmcNamedObjectIF, Serializable {
public final static String constructionClassName = "TestBasicNamedObjectExtended";
static {
}
public TestBasicNamedObjectExtendedDMO() {
super("TestBasicNamedObjectExtended");
}
protected TestBasicNamedObjectExtendedDMO(String oc) {
super(oc);
}
@Override
public TestBasicNamedObjectExtendedDMO getNew(){
TestBasicNamedObjectExtendedDMO rc = new TestBasicNamedObjectExtendedDMO();
return(rc);
}
@Override
public TestBasicNamedObjectExtendedDMO getSlice(DmcSliceInfo info){
TestBasicNamedObjectExtendedDMO rc = new TestBasicNamedObjectExtendedDMO();
populateSlice(rc,info);
return(rc);
}
public TestBasicNamedObjectExtendedDMO(DmcTypeModifierMV mods) {
super("TestBasicNamedObjectExtended");
modrec(true);
setModifier(mods);
}
public TestBasicNamedObjectExtendedDMO getModificationRecorder(){
TestBasicNamedObjectExtendedDMO rc = new TestBasicNamedObjectExtendedDMO();
rc.setName(getName());
rc.setModifier(new DmcTypeModifierMV(MetaDMSAG.__modify));
rc.modrec(true);
return(rc);
}
// org.dmd.dms.util.DmoFormatter.getAccessFunctions(DmoFormatter.java:744)
public StringName getObjectName(){
DmcAttribute<?> name = get(MetaDMSAG.__name);
if (name != null)
return((StringName)name.getSV());
return(null);
}
// org.dmd.dms.util.DmoFormatter.getAccessFunctions(DmoFormatter.java:761)
public DmcAttribute<?> getObjectNameAttribute(){
DmcAttribute<?> name = get(MetaDMSAG.__name);
return(name);
}
// org.dmd.dms.util.DmoFormatter.getAccessFunctions(DmoFormatter.java:768)
public boolean equals(Object obj){
if (obj instanceof TestBasicNamedObjectExtendedDMO){
return( getObjectName().equals( ((TestBasicNamedObjectExtendedDMO) obj).getObjectName()) );
}
return(false);
}
// org.dmd.dms.util.DmoFormatter.getAccessFunctions(DmoFormatter.java:776)
public int hashCode(){
StringName objn = getObjectName();
if (objn == null)
return(0);
return(objn.hashCode());
}
/**
* @return An Iterator of String objects.
*/
@SuppressWarnings("unchecked")
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1102)
public Iterator<String> getMvString(){
DmcTypeStringMV attr = (DmcTypeStringMV) get(DmtDMSAG.__mvString);
if (attr == null)
return( ((List<String>) Collections.EMPTY_LIST).iterator());
return(attr.getMV());
}
/**
* @return The nth String value.
*/
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1114)
public String getNthMvString(int i){
DmcTypeStringMV attr = (DmcTypeStringMV) get(DmtDMSAG.__mvString);
if (attr == null)
return(null);
return(attr.getMVnth(i));
}
/**
* Adds another mvString to the specified value.
* @param value String
*/
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1128)
public DmcAttribute<?> addMvString(String value) {
DmcAttribute<?> attr = get(DmtDMSAG.__mvString);
if (attr == null)
attr = new DmcTypeStringMV(DmtDMSAG.__mvString);
try{
setLastValue(attr.add(value));
add(DmtDMSAG.__mvString,attr);
}
catch(DmcValueException ex){
throw(new IllegalStateException("The type specific add() method shouldn't throw exceptions!",ex));
}
return(attr);
}
/**
* Returns true if we contain a valued keyed by the specified String.
* @param value String
*/
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1203)
public boolean mvStringContains(String value) {
DmcAttribute<?> attr = get(DmtDMSAG.__mvString);
if (attr == null)
return(false);
return(attr.contains(value));
}
/**
* Adds another mvString value.
* @param value A value compatible with String
*/
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1235)
public DmcAttribute<?> addMvString(Object value) throws DmcValueException {
DmcAttribute<?> attr = get(DmtDMSAG.__mvString);
if (attr == null)
attr = new DmcTypeStringMV(DmtDMSAG.__mvString);
setLastValue(attr.add(value));
add(DmtDMSAG.__mvString,attr);
return(attr);
}
/**
* Returns the number of values in mvString
*/
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1252)
public int getMvStringSize(){
DmcAttribute<?> attr = get(DmtDMSAG.__mvString);
if (attr == null){
if (DmtDMSAG.__mvString.indexSize == 0)
return(0);
else
return(DmtDMSAG.__mvString.indexSize);
}
return(attr.getMVSize());
}
/**
* Deletes a mvString value.
* @param value The String to be deleted from set of attribute values.
*/
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1310)
public DmcAttribute<?> delMvString(Object value) throws DmcValueException {
DmcAttribute<?> attr = get(DmtDMSAG.__mvString);
if ( (attr == null) && (getModifier()!= null))
delFromEmptyAttribute(new DmcTypeStringMV(DmtDMSAG.__mvString), value);
else
attr = del(DmtDMSAG.__mvString, value);
return(attr);
}
/**
* Deletes a mvString from the specified value.
* @param value String
*/
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1326)
public DmcAttribute<?> delMvString(String value) {
DmcAttribute<?> attr = get(DmtDMSAG.__mvString);
if ( (attr == null) && (getModifier()!= null))
delFromEmptyAttribute(new DmcTypeStringMV(DmtDMSAG.__mvString), value);
else
attr = del(DmtDMSAG.__mvString, value);
return(attr);
}
/**
* Removes the mvString attribute value.
*/
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1345)
public void remMvString(){
rem(DmtDMSAG.__mvString);
}
/**
* @return An Iterator of TestBasicNamedObjectFixedDMO objects.
*/
@SuppressWarnings("unchecked")
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:960)
public Iterator<TestBasicNamedObjectFixedREF> getMvTestBasicNamedObjectFixed(){
DmcTypeTestBasicNamedObjectFixedREFMV attr = (DmcTypeTestBasicNamedObjectFixedREFMV) get(DmtDMSAG.__mvTestBasicNamedObjectFixed);
if (attr == null)
return( ((List<TestBasicNamedObjectFixedREF>) Collections.EMPTY_LIST).iterator() );
if (DmcOmni.instance().lazyResolution()){
if (attr.doLazyResolution(this)){
rem(attr.getAttributeInfo());
return( ((List<TestBasicNamedObjectFixedREF>) Collections.EMPTY_LIST).iterator() );
}
}
return(attr.getMV());
}
/**
* @return An Iterator of TestBasicNamedObjectFixedREFs without attempting lazy resolution (if it's turned on).
*/
@SuppressWarnings("unchecked")
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:980)
public Iterator<TestBasicNamedObjectFixedREF> getMvTestBasicNamedObjectFixedREFs(){
DmcTypeTestBasicNamedObjectFixedREFMV attr = (DmcTypeTestBasicNamedObjectFixedREFMV) get(DmtDMSAG.__mvTestBasicNamedObjectFixed);
if (attr == null)
return( ((List<TestBasicNamedObjectFixedREF>) Collections.EMPTY_LIST).iterator() );
return(attr.getMV());
}
/**
* Adds another mvTestBasicNamedObjectFixed to the specified value.
* @param value TestBasicNamedObjectFixed
*/
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:994)
public DmcAttribute<?> addMvTestBasicNamedObjectFixed(TestBasicNamedObjectFixedDMO value) {
DmcAttribute<?> attr = get(DmtDMSAG.__mvTestBasicNamedObjectFixed);
if (attr == null)
attr = new DmcTypeTestBasicNamedObjectFixedREFMV(DmtDMSAG.__mvTestBasicNamedObjectFixed);
try{
setLastValue(attr.add(value));
add(DmtDMSAG.__mvTestBasicNamedObjectFixed,attr);
}
catch(DmcValueException ex){
throw(new IllegalStateException("The type specific add() method shouldn't throw exceptions!",ex));
}
return(attr);
}
/**
* Adds another mvTestBasicNamedObjectFixed value.
* @param value A value compatible with TestBasicNamedObjectFixed
*/
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1235)
public DmcAttribute<?> addMvTestBasicNamedObjectFixed(Object value) throws DmcValueException {
DmcAttribute<?> attr = get(DmtDMSAG.__mvTestBasicNamedObjectFixed);
if (attr == null)
attr = new DmcTypeTestBasicNamedObjectFixedREFMV(DmtDMSAG.__mvTestBasicNamedObjectFixed);
setLastValue(attr.add(value));
add(DmtDMSAG.__mvTestBasicNamedObjectFixed,attr);
return(attr);
}
/**
* Returns the number of values in mvTestBasicNamedObjectFixed
*/
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1252)
public int getMvTestBasicNamedObjectFixedSize(){
DmcAttribute<?> attr = get(DmtDMSAG.__mvTestBasicNamedObjectFixed);
if (attr == null){
if (DmtDMSAG.__mvTestBasicNamedObjectFixed.indexSize == 0)
return(0);
else
return(DmtDMSAG.__mvTestBasicNamedObjectFixed.indexSize);
}
return(attr.getMVSize());
}
/**
* Deletes a mvTestBasicNamedObjectFixed value.
* @param value The TestBasicNamedObjectFixed to be deleted from set of attribute values.
*/
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1291)
public DmcAttribute<?> delMvTestBasicNamedObjectFixed(Object value){
DmcAttribute<?> attr = get(DmtDMSAG.__mvTestBasicNamedObjectFixed);
if ( (attr == null) && (getModifier()!= null))
delFromEmptyAttribute(new DmcTypeTestBasicNamedObjectFixedREFMV(DmtDMSAG.__mvTestBasicNamedObjectFixed), value);
else
attr = del(DmtDMSAG.__mvTestBasicNamedObjectFixed, value);
return(attr);
}
/**
* Removes the mvTestBasicNamedObjectFixed attribute value.
*/
// org.dmd.dms.util.GenUtility.formatMV(GenUtility.java:1345)
public void remMvTestBasicNamedObjectFixed(){
rem(DmtDMSAG.__mvTestBasicNamedObjectFixed);
}
// org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:774)
public StringName getName(){
DmcTypeStringNameSV attr = (DmcTypeStringNameSV) get(MetaDMSAG.__name);
if (attr == null)
return(null);
return(attr.getSV());
}
/**
* Sets name to the specified value.
* @param value StringName
*/
// org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:814)
public void setName(StringName value) {
DmcAttribute<?> attr = get(MetaDMSAG.__name);
if (attr == null)
attr = new DmcTypeStringNameSV(MetaDMSAG.__name);
try{
attr.set(value);
set(MetaDMSAG.__name,attr);
}
catch(DmcValueException ex){
throw(new IllegalStateException("The type specific set() method shouldn't throw exceptions!",ex));
}
}
/**
* Sets name to the specified value.
* @param value A value compatible with DmcTypeStringNameSV
*/
// org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:867)
public void setName(Object value) throws DmcValueException {
DmcTypeStringNameSV attr = (DmcTypeStringNameSV) get(MetaDMSAG.__name);
if (attr == null)
attr = new DmcTypeStringNameSV(MetaDMSAG.__name);
attr.set(value);
set(MetaDMSAG.__name,attr);
}
/**
* Removes the name attribute value.
*/
// org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:887)
public void remName(){
rem(MetaDMSAG.__name);
}
// org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:774)
public String getSvString(){
DmcTypeStringSV attr = (DmcTypeStringSV) get(DmtDMSAG.__svString);
if (attr == null)
return(null);
return(attr.getSV());
}
/**
* Sets svString to the specified value.
* @param value String
*/
// org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:814)
public void setSvString(String value) {
DmcAttribute<?> attr = get(DmtDMSAG.__svString);
if (attr == null)
attr = new DmcTypeStringSV(DmtDMSAG.__svString);
try{
attr.set(value);
set(DmtDMSAG.__svString,attr);
}
catch(DmcValueException ex){
throw(new IllegalStateException("The type specific set() method shouldn't throw exceptions!",ex));
}
}
/**
* Sets svString to the specified value.
* @param value A value compatible with DmcTypeStringSV
*/
// org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:867)
public void setSvString(Object value) throws DmcValueException {
DmcTypeStringSV attr = (DmcTypeStringSV) get(DmtDMSAG.__svString);
if (attr == null)
attr = new DmcTypeStringSV(DmtDMSAG.__svString);
attr.set(value);
set(DmtDMSAG.__svString,attr);
}
/**
* Removes the svString attribute value.
*/
// org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:887)
public void remSvString(){
rem(DmtDMSAG.__svString);
}
}