Package org.dmd.dmt.shared.generated.dmo

Source Code of org.dmd.dmt.shared.generated.dmo.PrimitiveTMDMO

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.DmcObject;                                        // Structural class - (GenUtility.java:347)
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.StringToString;                             // Primitive type and !auxiliary class - (GenUtility.java:267)
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.DmcTypeStringToStringMAP;         // Required type - (GenUtility.java:324)

/**
* null
* <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 PrimitiveTMDMO  extends DmcObject  implements Serializable  {

    public final static String constructionClassName = "PrimitiveTM";


    static {
    }

    public PrimitiveTMDMO() {
        super("PrimitiveTM");
    }

    protected PrimitiveTMDMO(String oc) {
        super(oc);
    }

    @Override
    public PrimitiveTMDMO getNew(){
        PrimitiveTMDMO rc = new PrimitiveTMDMO();
        return(rc);
    }

    @Override
    public PrimitiveTMDMO getSlice(DmcSliceInfo info){
        PrimitiveTMDMO rc = new PrimitiveTMDMO();
        populateSlice(rc,info);
        return(rc);
    }

    public PrimitiveTMDMO(DmcTypeModifierMV mods) {
        super("PrimitiveTM");
        modrec(true);
        setModifier(mods);
    }

    public PrimitiveTMDMO getModificationRecorder(){
        PrimitiveTMDMO rc = new PrimitiveTMDMO();
        rc.setModifier(new DmcTypeModifierMV(MetaDMSAG.__modify));
        rc.modrec(true);
        return(rc);
    }

    /**
     * @return An Iterator of StringToString objects.
     */
    @SuppressWarnings("unchecked")
    // org.dmd.dms.util.GenUtility.formatMAPPED(GenUtility.java:1430)
    public Iterator<StringToString> getTmString(){
        DmcTypeStringToStringMAP attr = (DmcTypeStringToStringMAP) get(DmtDMSAG.__tmString);
        if (attr == null)
            return( ((List<StringToString>) Collections.EMPTY_LIST).iterator());

        return(attr.getMV());
    }

    /**
     * @param key The key of the value you want.
     * @return The StringToString associated with the specified key.
     */
    // org.dmd.dms.util.GenUtility.formatMAPPED(GenUtility.java:1462)
    public StringToString getTmString(Object key){
        DmcTypeStringToStringMAP attr = (DmcTypeStringToStringMAP) get(DmtDMSAG.__tmString);
        if (attr == null)
            return(null);

        return(attr.getByKey(key));
    }

    /**
     * @return The first key of the map.
     */
    // org.dmd.dms.util.GenUtility.formatMAPPED(GenUtility.java:1482)
    public String getTmStringFirstKey(){
        DmcTypeStringToStringMAP attr = (DmcTypeStringToStringMAP) get(DmtDMSAG.__tmString);
        if (attr == null)
            return(null);

        return(attr.firstKey());
    }

    /**
     * Adds another tmString value.
     * @param value A value compatible with StringToString
     */
    // org.dmd.dms.util.GenUtility.formatMAPPED(GenUtility.java:1500)
    public DmcAttribute<?> addTmString(Object value) throws DmcValueException {
        DmcAttribute<?> attr = get(DmtDMSAG.__tmString);
        if (attr == null)
            attr = new DmcTypeStringToStringMAP(DmtDMSAG.__tmString);
       
        setLastValue(attr.add(value));
        add(DmtDMSAG.__tmString,attr);
        return(attr);
    }

    /**
     * Adds another tmString value.
     * @param value StringToString
     */
    // org.dmd.dms.util.GenUtility.formatMAPPED(GenUtility.java:1537)
    public DmcAttribute<?> addTmString(StringToString value) {
        DmcAttribute<?> attr = get(DmtDMSAG.__tmString);
        if (attr == null)
            attr = new DmcTypeStringToStringMAP(DmtDMSAG.__tmString);
       
        try{
            setLastValue(attr.add(value));
            add(DmtDMSAG.__tmString,attr);
        }
        catch(DmcValueException ex){
            throw(new IllegalStateException("The type specific add() method shouldn't throw exceptions!",ex));
        }
        return(attr);
    }

    /**
     * Deletes a tmString value.
     * @param key The key of the StringToString to be deleted from the map of attribute values.
     */
    // org.dmd.dms.util.GenUtility.formatMAPPED(GenUtility.java:1617)
    public DmcAttribute<?> delTmString(Object key){
        DmcAttribute<?> attr = get(DmtDMSAG.__tmString);
       
        if ( (attr == null) && (getModifier()!= null))
            delFromEmptyAttribute(new DmcTypeStringToStringMAP(DmtDMSAG.__tmString), key);
        if (attr == null)
            return(null);
       
        attr = del(DmtDMSAG.__tmString, key);
       
        return(attr);
    }

    /**
     * Deletes a tmString value.
     * @param key the String key value
     */
    // org.dmd.dms.util.GenUtility.formatMAPPED(GenUtility.java:1635)
    public DmcAttribute<?> delTmString(String key) {
        DmcAttribute<?> attr = get(DmtDMSAG.__tmString);
       
        if ( (attr == null) && (getModifier()!= null))
            delFromEmptyAttribute(new DmcTypeStringToStringMAP(DmtDMSAG.__tmString), key);
        if (attr == null)
            return(null);
       
        attr = del(DmtDMSAG.__tmString, key);
       
        return(attr);
    }

    /**
     * Removes the tmString attribute value.
     */
    // org.dmd.dms.util.GenUtility.formatMAPPED(GenUtility.java:1689)
    public void remTmString(){
         rem(DmtDMSAG.__tmString);
    }




}
TOP

Related Classes of org.dmd.dmt.shared.generated.dmo.PrimitiveTMDMO

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.