Example usage for java.util SortedMap remove

List of usage examples for java.util SortedMap remove

Introduction

In this page you can find the example usage for java.util SortedMap remove.

Prototype

V remove(Object key);

Source Link

Document

Removes the mapping for a key from this map if it is present (optional operation).

Usage

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableUInt16Table.java

public void deleteTableUInt16(MSSBamAuthorization Authorization, MSSBamTableUInt16Buff Buff) {
    final String S_ProcName = "MSSBamRamTableUInt16Table.deleteTableUInt16() ";
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();

    pkey.setRequiredId(schema.nextAnyObjIdGen());
    MSSBamTableUInt16Buff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteTableUInt16",
                "Existing record not found", "TableUInt16", pkey);
    }/* ww  w .  jav  a  2 s  . c  o m*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTableUInt16",
                pkey);
    }
    MSSBamTableUInt16ByContainerIdxKey keyContainerIdx = schema.getFactoryTableUInt16().newContainerIdxKey();
    keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamTableUInt16Buff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByContainerIdx.get(keyContainerIdx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableUInt32Table.java

public void updateTableUInt32(MSSBamAuthorization Authorization, MSSBamTableUInt32Buff Buff) {
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamTableUInt32Buff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTableUInt32",
                "Existing record not found", "TableUInt32", pkey);
    }/*from   w  w w  .  ja  v a 2s . com*/
    MSSBamTableUInt32ByContainerIdxKey existingKeyContainerIdx = schema.getFactoryTableUInt32()
            .newContainerIdxKey();
    existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId());

    MSSBamTableUInt32ByContainerIdxKey newKeyContainerIdx = schema.getFactoryTableUInt32().newContainerIdxKey();
    newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId());

    // Check unique indexes

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableUInt32Def().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateTableUInt32", "Superclass", "SuperClass", "UInt32Def", null);
            }
        }
    }

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTable().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredContainerId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateTableUInt32", "Container", "CTable", "Table", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamTableUInt32Buff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    subdict = dictByContainerIdx.get(existingKeyContainerIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByContainerIdx.containsKey(newKeyContainerIdx)) {
        subdict = dictByContainerIdx.get(newKeyContainerIdx);
    } else {
        subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamTableUInt32Buff>();
        dictByContainerIdx.put(newKeyContainerIdx, subdict);
    }
    subdict.put(pkey, Buff);

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableUInt32Table.java

public void deleteTableUInt32(MSSBamAuthorization Authorization, MSSBamTableUInt32Buff Buff) {
    final String S_ProcName = "MSSBamRamTableUInt32Table.deleteTableUInt32() ";
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();

    pkey.setRequiredId(schema.nextAnyObjIdGen());
    MSSBamTableUInt32Buff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteTableUInt32",
                "Existing record not found", "TableUInt32", pkey);
    }// w ww.  j  av a 2  s  .  co  m
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTableUInt32",
                pkey);
    }
    MSSBamTableUInt32ByContainerIdxKey keyContainerIdx = schema.getFactoryTableUInt32().newContainerIdxKey();
    keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamTableUInt32Buff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByContainerIdx.get(keyContainerIdx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableUInt64Table.java

public void updateTableUInt64(MSSBamAuthorization Authorization, MSSBamTableUInt64Buff Buff) {
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamTableUInt64Buff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTableUInt64",
                "Existing record not found", "TableUInt64", pkey);
    }/*from ww w .  j a v  a 2  s  . c o  m*/
    MSSBamTableUInt64ByContainerIdxKey existingKeyContainerIdx = schema.getFactoryTableUInt64()
            .newContainerIdxKey();
    existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId());

    MSSBamTableUInt64ByContainerIdxKey newKeyContainerIdx = schema.getFactoryTableUInt64().newContainerIdxKey();
    newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId());

    // Check unique indexes

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableUInt64Def().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateTableUInt64", "Superclass", "SuperClass", "UInt64Def", null);
            }
        }
    }

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTable().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredContainerId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateTableUInt64", "Container", "CTable", "Table", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamTableUInt64Buff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    subdict = dictByContainerIdx.get(existingKeyContainerIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByContainerIdx.containsKey(newKeyContainerIdx)) {
        subdict = dictByContainerIdx.get(newKeyContainerIdx);
    } else {
        subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamTableUInt64Buff>();
        dictByContainerIdx.put(newKeyContainerIdx, subdict);
    }
    subdict.put(pkey, Buff);

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableUInt64Table.java

public void deleteTableUInt64(MSSBamAuthorization Authorization, MSSBamTableUInt64Buff Buff) {
    final String S_ProcName = "MSSBamRamTableUInt64Table.deleteTableUInt64() ";
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();

    pkey.setRequiredId(schema.nextAnyObjIdGen());
    MSSBamTableUInt64Buff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteTableUInt64",
                "Existing record not found", "TableUInt64", pkey);
    }// w w w . j a  v  a 2s .c  o  m
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTableUInt64",
                pkey);
    }
    MSSBamTableUInt64ByContainerIdxKey keyContainerIdx = schema.getFactoryTableUInt64().newContainerIdxKey();
    keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamTableUInt64Buff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByContainerIdx.get(keyContainerIdx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableUuidGenTable.java

public void updateTableUuidGen(MSSBamAuthorization Authorization, MSSBamTableUuidGenBuff Buff) {
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamTableUuidGenBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                "updateTableUuidGen", "Existing record not found", "TableUuidGen", pkey);
    }//from w  w  w.  ja v  a  2 s. c o  m
    MSSBamTableUuidGenByContainerIdxKey existingKeyContainerIdx = schema.getFactoryTableUuidGen()
            .newContainerIdxKey();
    existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId());

    MSSBamTableUuidGenByContainerIdxKey newKeyContainerIdx = schema.getFactoryTableUuidGen()
            .newContainerIdxKey();
    newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId());

    // Check unique indexes

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableUuidGenDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateTableUuidGen", "Superclass", "SuperClass", "UuidGenDef", null);
            }
        }
    }

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTable().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredContainerId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateTableUuidGen", "Container", "CTable", "Table", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamTableUuidGenBuff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    subdict = dictByContainerIdx.get(existingKeyContainerIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByContainerIdx.containsKey(newKeyContainerIdx)) {
        subdict = dictByContainerIdx.get(newKeyContainerIdx);
    } else {
        subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamTableUuidGenBuff>();
        dictByContainerIdx.put(newKeyContainerIdx, subdict);
    }
    subdict.put(pkey, Buff);

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableUuidGenTable.java

public void deleteTableUuidGen(MSSBamAuthorization Authorization, MSSBamTableUuidGenBuff Buff) {
    final String S_ProcName = "MSSBamRamTableUuidGenTable.deleteTableUuidGen() ";
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();

    pkey.setRequiredId(schema.nextAnyObjIdGen());
    MSSBamTableUuidGenBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                "deleteTableUuidGen", "Existing record not found", "TableUuidGen", pkey);
    }/*w  ww.j  a  v  a2s  .  c o m*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTableUuidGen",
                pkey);
    }
    MSSBamTableUuidGenByContainerIdxKey keyContainerIdx = schema.getFactoryTableUuidGen().newContainerIdxKey();
    keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamTableUuidGenBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByContainerIdx.get(keyContainerIdx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableUuidTable.java

public void updateTableUuid(MSSBamAuthorization Authorization, MSSBamTableUuidBuff Buff) {
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamTableUuidBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTableUuid",
                "Existing record not found", "TableUuid", pkey);
    }/*from   www  .  j  a  v a  2s  . c om*/
    MSSBamTableUuidByContainerIdxKey existingKeyContainerIdx = schema.getFactoryTableUuid()
            .newContainerIdxKey();
    existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId());

    MSSBamTableUuidByContainerIdxKey newKeyContainerIdx = schema.getFactoryTableUuid().newContainerIdxKey();
    newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId());

    // Check unique indexes

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableUuidDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateTableUuid", "Superclass", "SuperClass", "UuidDef", null);
            }
        }
    }

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTable().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredContainerId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateTableUuid", "Container", "CTable", "Table", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamTableUuidBuff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    subdict = dictByContainerIdx.get(existingKeyContainerIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByContainerIdx.containsKey(newKeyContainerIdx)) {
        subdict = dictByContainerIdx.get(newKeyContainerIdx);
    } else {
        subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamTableUuidBuff>();
        dictByContainerIdx.put(newKeyContainerIdx, subdict);
    }
    subdict.put(pkey, Buff);

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableUuidTable.java

public void deleteTableUuid(MSSBamAuthorization Authorization, MSSBamTableUuidBuff Buff) {
    final String S_ProcName = "MSSBamRamTableUuidTable.deleteTableUuid() ";
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();

    pkey.setRequiredId(schema.nextAnyObjIdGen());
    MSSBamTableUuidBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteTableUuid",
                "Existing record not found", "TableUuid", pkey);
    }//w ww.jav a2 s  .co  m
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTableUuid",
                pkey);
    }
    MSSBamTableUuidByContainerIdxKey keyContainerIdx = schema.getFactoryTableUuid().newContainerIdxKey();
    keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamTableUuidBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByContainerIdx.get(keyContainerIdx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTagTable.java

public void updateTag(MSSBamAuthorization Authorization, MSSBamTagBuff Buff) {
    MSSBamTagPKey pkey = schema.getFactoryTag().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamTagBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTag",
                "Existing record not found", "Tag", pkey);
    }/*w  w  w.  jav  a2 s  . com*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateTag", pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    MSSBamTagByTenantIdxKey existingKeyTenantIdx = schema.getFactoryTag().newTenantIdxKey();
    existingKeyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    MSSBamTagByTenantIdxKey newKeyTenantIdx = schema.getFactoryTag().newTenantIdxKey();
    newKeyTenantIdx.setRequiredTenantId(Buff.getRequiredTenantId());

    MSSBamTagByNameIdxKey existingKeyNameIdx = schema.getFactoryTag().newNameIdxKey();
    existingKeyNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyNameIdx.setRequiredName(existing.getRequiredName());

    MSSBamTagByNameIdxKey newKeyNameIdx = schema.getFactoryTag().newNameIdxKey();
    newKeyNameIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyNameIdx.setRequiredName(Buff.getRequiredName());

    // Check unique indexes

    if (!existingKeyNameIdx.equals(newKeyNameIdx)) {
        if (dictByNameIdx.containsKey(newKeyNameIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateTag",
                    "TagNameIdx", newKeyNameIdx);
        }
    }

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTenant().readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTag",
                        "Container", "TagTenant", "Tenant", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamTagPKey, MSSBamTagBuff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    subdict = dictByTenantIdx.get(existingKeyTenantIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByTenantIdx.containsKey(newKeyTenantIdx)) {
        subdict = dictByTenantIdx.get(newKeyTenantIdx);
    } else {
        subdict = new TreeMap<MSSBamTagPKey, MSSBamTagBuff>();
        dictByTenantIdx.put(newKeyTenantIdx, subdict);
    }
    subdict.put(pkey, Buff);

    dictByNameIdx.remove(existingKeyNameIdx);
    dictByNameIdx.put(newKeyNameIdx, Buff);

}