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.MSSBamRamISOTimezoneTable.java

public void deleteISOTimezone(MSSBamAuthorization Authorization, MSSBamISOTimezoneBuff Buff) {
    final String S_ProcName = "MSSBamRamISOTimezoneTable.deleteISOTimezone() ";
    MSSBamISOTimezonePKey pkey = schema.getFactoryISOTimezone().newPKey();

    pkey.setRequiredISOTimezoneId(schema.nextISOTimezoneIdGen());
    MSSBamISOTimezoneBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteISOTimezone",
                "Existing record not found", "ISOTimezone", pkey);
    }//from  ww w  .j  a va2s  .  c  om
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteISOTimezone",
                pkey);
    }
    MSSBamISOTimezoneByOffsetIdxKey keyOffsetIdx = schema.getFactoryISOTimezone().newOffsetIdxKey();
    keyOffsetIdx.setRequiredTZHourOffset(existing.getRequiredTZHourOffset());
    keyOffsetIdx.setRequiredTZMinOffset(existing.getRequiredTZMinOffset());

    MSSBamISOTimezoneByUTZNameIdxKey keyUTZNameIdx = schema.getFactoryISOTimezone().newUTZNameIdxKey();
    keyUTZNameIdx.setRequiredTZName(existing.getRequiredTZName());

    MSSBamISOTimezoneByIso8601IdxKey keyIso8601Idx = schema.getFactoryISOTimezone().newIso8601IdxKey();
    keyIso8601Idx.setRequiredIso8601(existing.getRequiredIso8601());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<MSSBamISOTimezonePKey, MSSBamISOTimezoneBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByOffsetIdx.get(keyOffsetIdx);
    subdict.remove(pkey);

    dictByUTZNameIdx.remove(keyUTZNameIdx);

    subdict = dictByIso8601Idx.get(keyIso8601Idx);
    subdict.remove(pkey);

}

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

public void updateLegalEntity(MSSBamAuthorization Authorization, MSSBamLegalEntityBuff Buff) {
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamLegalEntityBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateLegalEntity",
                "Existing record not found", "LegalEntity", pkey);
    }//from  w w w.  ja v a2  s.c om
    MSSBamLegalEntityByChildrenIdxKey existingKeyChildrenIdx = schema.getFactoryLegalEntity()
            .newChildrenIdxKey();
    existingKeyChildrenIdx.setOptionalContainerDomainId(existing.getOptionalContainerDomainId());

    MSSBamLegalEntityByChildrenIdxKey newKeyChildrenIdx = schema.getFactoryLegalEntity().newChildrenIdxKey();
    newKeyChildrenIdx.setOptionalContainerDomainId(Buff.getOptionalContainerDomainId());

    // Check unique indexes

    // Validate foreign keys

    {
        boolean allNull = true;

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

    // Update is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamLegalEntityBuff> subdict;

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

    subdict = dictByChildrenIdx.get(existingKeyChildrenIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByChildrenIdx.containsKey(newKeyChildrenIdx)) {
        subdict = dictByChildrenIdx.get(newKeyChildrenIdx);
    } else {
        subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamLegalEntityBuff>();
        dictByChildrenIdx.put(newKeyChildrenIdx, subdict);
    }
    subdict.put(pkey, Buff);

}

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

public void deleteLegalEntity(MSSBamAuthorization Authorization, MSSBamLegalEntityBuff Buff) {
    final String S_ProcName = "MSSBamRamLegalEntityTable.deleteLegalEntity() ";
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();

    pkey.setRequiredId(schema.nextAnyObjIdGen());
    MSSBamLegalEntityBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteLegalEntity",
                "Existing record not found", "LegalEntity", pkey);
    }// ww w. ja v a 2s.c o m
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteLegalEntity",
                pkey);
    }
    MSSBamLegalEntityByChildrenIdxKey keyChildrenIdx = schema.getFactoryLegalEntity().newChildrenIdxKey();
    keyChildrenIdx.setOptionalContainerDomainId(existing.getOptionalContainerDomainId());

    // Validate reverse foreign keys

    if (schema.getTableCompany().readDerivedByIdIdx(Authorization, existing.getRequiredId()) != null) {
        throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteLegalEntity",
                "Superclass", "SuperClass", "Company", pkey);
    }

    if (schema.getTableUser().readDerivedByIdIdx(Authorization, existing.getRequiredId()) != null) {
        throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteLegalEntity",
                "Superclass", "SuperClass", "User", pkey);
    }

    // Delete is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamLegalEntityBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByChildrenIdx.get(keyChildrenIdx);
    subdict.remove(pkey);

}

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

public void updateLicense(MSSBamAuthorization Authorization, MSSBamLicenseBuff Buff) {
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamLicenseBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateLicense",
                "Existing record not found", "License", pkey);
    }//from   w  w w . java 2s .  co  m
    MSSBamLicenseByDomainIdxKey existingKeyDomainIdx = schema.getFactoryLicense().newDomainIdxKey();
    existingKeyDomainIdx.setRequiredDomainId(existing.getRequiredDomainId());

    MSSBamLicenseByDomainIdxKey newKeyDomainIdx = schema.getFactoryLicense().newDomainIdxKey();
    newKeyDomainIdx.setRequiredDomainId(Buff.getRequiredDomainId());

    // Check unique indexes

    // Validate foreign keys

    {
        boolean allNull = true;

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

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableDomain().readDerivedByIdIdx(Authorization, Buff.getRequiredDomainId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateLicense", "Container", "Domain", "Domain", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamLicenseBuff> subdict;

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

    subdict = dictByDomainIdx.get(existingKeyDomainIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByDomainIdx.containsKey(newKeyDomainIdx)) {
        subdict = dictByDomainIdx.get(newKeyDomainIdx);
    } else {
        subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamLicenseBuff>();
        dictByDomainIdx.put(newKeyDomainIdx, subdict);
    }
    subdict.put(pkey, Buff);

}

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

public void deleteLicense(MSSBamAuthorization Authorization, MSSBamLicenseBuff Buff) {
    final String S_ProcName = "MSSBamRamLicenseTable.deleteLicense() ";
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();

    pkey.setRequiredId(schema.nextAnyObjIdGen());
    MSSBamLicenseBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteLicense",
                "Existing record not found", "License", pkey);
    }/*from w w  w.j  a  v  a2  s .c o m*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteLicense",
                pkey);
    }
    MSSBamLicenseByDomainIdxKey keyDomainIdx = schema.getFactoryLicense().newDomainIdxKey();
    keyDomainIdx.setRequiredDomainId(existing.getRequiredDomainId());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamLicenseBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByDomainIdx.get(keyDomainIdx);
    subdict.remove(pkey);

}

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

public void updateMajorVersion(MSSBamAuthorization Authorization, MSSBamMajorVersionBuff Buff) {
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamMajorVersionBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                "updateMajorVersion", "Existing record not found", "MajorVersion", pkey);
    }/* w  ww . java 2 s  . co  m*/
    MSSBamMajorVersionByProjIdxKey existingKeyProjIdx = schema.getFactoryMajorVersion().newProjIdxKey();
    existingKeyProjIdx.setRequiredProjectId(existing.getRequiredProjectId());

    MSSBamMajorVersionByProjIdxKey newKeyProjIdx = schema.getFactoryMajorVersion().newProjIdxKey();
    newKeyProjIdx.setRequiredProjectId(Buff.getRequiredProjectId());

    // Check unique indexes

    // Validate foreign keys

    {
        boolean allNull = true;

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

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableProject().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredProjectId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateMajorVersion", "Container", "Project", "Project", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamMajorVersionBuff> subdict;

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

    subdict = dictByProjIdx.get(existingKeyProjIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByProjIdx.containsKey(newKeyProjIdx)) {
        subdict = dictByProjIdx.get(newKeyProjIdx);
    } else {
        subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamMajorVersionBuff>();
        dictByProjIdx.put(newKeyProjIdx, subdict);
    }
    subdict.put(pkey, Buff);

}

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

public void deleteMajorVersion(MSSBamAuthorization Authorization, MSSBamMajorVersionBuff Buff) {
    final String S_ProcName = "MSSBamRamMajorVersionTable.deleteMajorVersion() ";
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();

    pkey.setRequiredId(schema.nextAnyObjIdGen());
    MSSBamMajorVersionBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                "deleteMajorVersion", "Existing record not found", "MajorVersion", pkey);
    }/*from w ww. jav a 2 s. c o m*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteMajorVersion",
                pkey);
    }
    MSSBamMajorVersionByProjIdxKey keyProjIdx = schema.getFactoryMajorVersion().newProjIdxKey();
    keyProjIdx.setRequiredProjectId(existing.getRequiredProjectId());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamMajorVersionBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByProjIdx.get(keyProjIdx);
    subdict.remove(pkey);

}

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

public void updateMemo(MSSBamAuthorization Authorization, MSSBamMemoBuff Buff) {
    MSSBamMemoPKey pkey = schema.getFactoryMemo().newPKey();
    pkey.setRequiredMemoId(Buff.getRequiredMemoId());
    MSSBamMemoBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateMemo",
                "Existing record not found", "Memo", pkey);
    }/*  ww w  .j ava2 s . c om*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateMemo", pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    MSSBamMemoByMemoContactIdxKey existingKeyMemoContactIdx = schema.getFactoryMemo().newMemoContactIdxKey();
    existingKeyMemoContactIdx.setRequiredContactId(existing.getRequiredContactId());

    MSSBamMemoByMemoContactIdxKey newKeyMemoContactIdx = schema.getFactoryMemo().newMemoContactIdxKey();
    newKeyMemoContactIdx.setRequiredContactId(Buff.getRequiredContactId());

    MSSBamMemoByUDescrIdxKey existingKeyUDescrIdx = schema.getFactoryMemo().newUDescrIdxKey();
    existingKeyUDescrIdx.setRequiredContactId(existing.getRequiredContactId());
    existingKeyUDescrIdx.setRequiredDescription(existing.getRequiredDescription());

    MSSBamMemoByUDescrIdxKey newKeyUDescrIdx = schema.getFactoryMemo().newUDescrIdxKey();
    newKeyUDescrIdx.setRequiredContactId(Buff.getRequiredContactId());
    newKeyUDescrIdx.setRequiredDescription(Buff.getRequiredDescription());

    // Check unique indexes

    if (!existingKeyUDescrIdx.equals(newKeyUDescrIdx)) {
        if (dictByUDescrIdx.containsKey(newKeyUDescrIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateMemo",
                    "MemoUDescrIdx", newKeyUDescrIdx);
        }
    }

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableContact().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredContactId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateMemo", "Container", "MemoContact", "Contact", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamMemoPKey, MSSBamMemoBuff> subdict;

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

    subdict = dictByMemoContactIdx.get(existingKeyMemoContactIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByMemoContactIdx.containsKey(newKeyMemoContactIdx)) {
        subdict = dictByMemoContactIdx.get(newKeyMemoContactIdx);
    } else {
        subdict = new TreeMap<MSSBamMemoPKey, MSSBamMemoBuff>();
        dictByMemoContactIdx.put(newKeyMemoContactIdx, subdict);
    }
    subdict.put(pkey, Buff);

    dictByUDescrIdx.remove(existingKeyUDescrIdx);
    dictByUDescrIdx.put(newKeyUDescrIdx, Buff);

}

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

public void deleteMemo(MSSBamAuthorization Authorization, MSSBamMemoBuff Buff) {
    final String S_ProcName = "MSSBamRamMemoTable.deleteMemo() ";
    MSSBamMemoPKey pkey = schema.getFactoryMemo().newPKey();

    pkey.setRequiredMemoId(schema.nextMemoIdGen());
    MSSBamMemoBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteMemo",
                "Existing record not found", "Memo", pkey);
    }/*from w w w .  j  av  a  2 s . c  o  m*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteMemo", pkey);
    }
    MSSBamMemoByMemoContactIdxKey keyMemoContactIdx = schema.getFactoryMemo().newMemoContactIdxKey();
    keyMemoContactIdx.setRequiredContactId(existing.getRequiredContactId());

    MSSBamMemoByUDescrIdxKey keyUDescrIdx = schema.getFactoryMemo().newUDescrIdxKey();
    keyUDescrIdx.setRequiredContactId(existing.getRequiredContactId());
    keyUDescrIdx.setRequiredDescription(existing.getRequiredDescription());

    // Validate reverse foreign keys

    if (schema.getTableMemoTag().readDerivedByMemoIdx(Authorization, existing.getRequiredMemoId()).length > 0) {
        throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteMemo",
                "Container", "MemoTagMemo", "MemoTag", pkey);
    }

    // Delete is valid

    SortedMap<MSSBamMemoPKey, MSSBamMemoBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByMemoContactIdx.get(keyMemoContactIdx);
    subdict.remove(pkey);

    dictByUDescrIdx.remove(keyUDescrIdx);

}

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

public void updateMemoTag(MSSBamAuthorization Authorization, MSSBamMemoTagBuff Buff) {
    MSSBamMemoTagPKey pkey = schema.getFactoryMemoTag().newPKey();
    pkey.setRequiredMemoId(Buff.getRequiredMemoId());
    pkey.setRequiredTagId(Buff.getRequiredTagId());
    MSSBamMemoTagBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateMemoTag",
                "Existing record not found", "MemoTag", pkey);
    }// w w w.j a va 2 s. c o m
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateMemoTag",
                pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    MSSBamMemoTagByMemoIdxKey existingKeyMemoIdx = schema.getFactoryMemoTag().newMemoIdxKey();
    existingKeyMemoIdx.setRequiredMemoId(existing.getRequiredMemoId());

    MSSBamMemoTagByMemoIdxKey newKeyMemoIdx = schema.getFactoryMemoTag().newMemoIdxKey();
    newKeyMemoIdx.setRequiredMemoId(Buff.getRequiredMemoId());

    MSSBamMemoTagByTagIdxKey existingKeyTagIdx = schema.getFactoryMemoTag().newTagIdxKey();
    existingKeyTagIdx.setRequiredTagId(existing.getRequiredTagId());

    MSSBamMemoTagByTagIdxKey newKeyTagIdx = schema.getFactoryMemoTag().newTagIdxKey();
    newKeyTagIdx.setRequiredTagId(Buff.getRequiredTagId());

    // Check unique indexes

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableMemo().readDerivedByIdIdx(Authorization, Buff.getRequiredMemoId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateMemoTag", "Container", "MemoTagMemo", "Memo", null);
            }
        }
    }

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTag().readDerivedByIdIdx(Authorization, Buff.getRequiredTagId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateMemoTag", "Lookup", "Tag", "Tag", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamMemoTagPKey, MSSBamMemoTagBuff> subdict;

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

    subdict = dictByMemoIdx.get(existingKeyMemoIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByMemoIdx.containsKey(newKeyMemoIdx)) {
        subdict = dictByMemoIdx.get(newKeyMemoIdx);
    } else {
        subdict = new TreeMap<MSSBamMemoTagPKey, MSSBamMemoTagBuff>();
        dictByMemoIdx.put(newKeyMemoIdx, subdict);
    }
    subdict.put(pkey, Buff);

    subdict = dictByTagIdx.get(existingKeyTagIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByTagIdx.containsKey(newKeyTagIdx)) {
        subdict = dictByTagIdx.get(newKeyTagIdx);
    } else {
        subdict = new TreeMap<MSSBamMemoTagPKey, MSSBamMemoTagBuff>();
        dictByTagIdx.put(newKeyTagIdx, subdict);
    }
    subdict.put(pkey, Buff);

}