//------------------------------------------------------------------------------- // This package was automatically generated from EXPRESS (ISO STEP 10303 part11) // by a java generator build with the meta CASE tool Platypus // (alain.plantec@univ-brest.fr) // // Please, be aware that any hand-made updating of this file can be lost!!. //------------------------------------------------------------------------------- package CheddarBridge; import java.util.*; import java.io.*; import step.core.*; class Generic_CacheStepRW extends Named_ObjectStepRW { public step.core.StepCoreObject coreObject() { return new Generic_Cache(); } public String entityName() { return Generic_Cache.EntityName(); } public Integer getNumberOfBlock(StepCoreRepository repo, StepInternalRepresentation si) throws Exception { ArrayList values = si.getValues(); StepValue stepVal = values.get( 2); return (Integer) convertedStepValue(repo, stepVal); } public Integer getBlockSize(StepCoreRepository repo, StepInternalRepresentation si) throws Exception { ArrayList values = si.getValues(); StepValue stepVal = values.get( 3); return (Integer) convertedStepValue(repo, stepVal); } public Integer getAssociativity(StepCoreRepository repo, StepInternalRepresentation si) throws Exception { ArrayList values = si.getValues(); StepValue stepVal = values.get( 4); return (Integer) convertedStepValue(repo, stepVal); } public Cache_Replacement_Type getCacheReplacement(StepCoreRepository repo, StepInternalRepresentation si) throws Exception { ArrayList values = si.getValues(); StepValue stepVal = values.get( 5); return Cache_Replacement_Type.fromString((String) convertedStepValue(repo, stepVal)); } public Double getHitTime(StepCoreRepository repo, StepInternalRepresentation si) throws Exception { ArrayList values = si.getValues(); StepValue stepVal = values.get( 6); return (Double) convertedStepValue(repo, stepVal); } public Double getMissTime(StepCoreRepository repo, StepInternalRepresentation si) throws Exception { ArrayList values = si.getValues(); StepValue stepVal = values.get( 7); return (Double) convertedStepValue(repo, stepVal); } public Integer getMissRate(StepCoreRepository repo, StepInternalRepresentation si) throws Exception { ArrayList values = si.getValues(); StepValue stepVal = values.get( 8); return (Integer) convertedStepValue(repo, stepVal); } public Cache_Coherence_Protocol_Type getCacheCoherenceProtocol(StepCoreRepository repo, StepInternalRepresentation si) throws Exception { ArrayList values = si.getValues(); StepValue stepVal = values.get( 9); return Cache_Coherence_Protocol_Type.fromString((String) convertedStepValue(repo, stepVal)); } public Cache_Type getCacheCategory(StepCoreRepository repo, StepInternalRepresentation si) throws Exception { ArrayList values = si.getValues(); StepValue stepVal = values.get(10); return Cache_Type.fromString((String) convertedStepValue(repo, stepVal)); } public void initializeCoreObject(StepCoreRepository repo, step.core.StepCoreObject coreObj, StepGenericInstance si) throws Exception { super.initializeCoreObject(repo, coreObj, si); Generic_Cache obj = (Generic_Cache) coreObj; obj.setNumberOfBlock(getNumberOfBlock(repo, (StepInternalRepresentation) si)); obj.setBlockSize(getBlockSize(repo, (StepInternalRepresentation) si)); obj.setAssociativity(getAssociativity(repo, (StepInternalRepresentation) si)); obj.setCacheReplacement(getCacheReplacement(repo, (StepInternalRepresentation) si)); obj.setHitTime(getHitTime(repo, (StepInternalRepresentation) si)); obj.setMissTime(getMissTime(repo, (StepInternalRepresentation) si)); obj.setMissRate(getMissRate(repo, (StepInternalRepresentation) si)); obj.setCacheCoherenceProtocol(getCacheCoherenceProtocol(repo, (StepInternalRepresentation) si)); obj.setCacheCategory(getCacheCategory(repo, (StepInternalRepresentation) si)); } public StepGenericInstance genericInstance(StepCoreRepository crepo, step.core.StepCoreObject coreObj) throws Exception { StepInternalRepresentation si = (StepInternalRepresentation) super.genericInstance(crepo, coreObj); Generic_Cache obj = (Generic_Cache) coreObj; si.add(stepValueOf(crepo, obj.getNumberOfBlock())); si.add(stepValueOf(crepo, obj.getBlockSize())); si.add(stepValueOf(crepo, obj.getAssociativity())); si.add(stepValueOf(crepo, obj.getCacheReplacement())); si.add(stepValueOf(crepo, obj.getHitTime())); si.add(stepValueOf(crepo, obj.getMissTime())); si.add(stepValueOf(crepo, obj.getMissRate())); si.add(stepValueOf(crepo, obj.getCacheCoherenceProtocol())); si.add(stepValueOf(crepo, obj.getCacheCategory())); return si; } }