MovabilityPG movabilityPG = ((GLMAsset)aggAsset.getAsset()).getMovabilityPG(); String ccc = null;  if (movabilityPG == null) logger.warn (getBindingSite().getAgentIdentifier() + " " + aggAsset.getAsset() + " was missing a movability PG, so could not determine cargo cat code."); else { ccc = movabilityPG.getCargoCategoryCode(); if (logger.isInfoEnabled ()) logger.info ("Aggregate's base asset " + aggAsset.getAsset() + " ccc was " + ccc); }
String ccc = getCategory((GLMAsset)aggAsset.getAsset());
  protected Set setDimensions (NewPhysicalPG physicalPG, Collection realAssets) {    double length = 0.0;    double width  = 0.0;    double area   = 0.0;    double volume = 0.0;    double height = 0.0;    double mass   = 0.0;    Object firstItem = realAssets.iterator().next();    PhysicalPG bulkPG     = (PhysicalPG)ldmf.createPropertyGroup(PhysicalPG.class);    PhysicalPG oversizePG = (PhysicalPG)ldmf.createPropertyGroup(PhysicalPG.class);    PhysicalPG outsizePG  = (PhysicalPG)ldmf.createPropertyGroup(PhysicalPG.class);    PhysicalPG nonAirPG   = (PhysicalPG)ldmf.createPropertyGroup(PhysicalPG.class);    NewCargoCatCodeDimensionPG cccdBulkPG     = (NewCargoCatCodeDimensionPG)ldmf.createPropertyGroup(CargoCatCodeDimensionPG.class);    cccdBulkPG.setDimensions(bulkPG);    NewCargoCatCodeDimensionPG cccdOversizePG = (NewCargoCatCodeDimensionPG)ldmf.createPropertyGroup(CargoCatCodeDimensionPG.class);    cccdOversizePG.setDimensions(oversizePG);    NewCargoCatCodeDimensionPG cccdOutsizePG  = (NewCargoCatCodeDimensionPG)ldmf.createPropertyGroup(CargoCatCodeDimensionPG.class);    cccdOutsizePG.setDimensions(outsizePG);    NewCargoCatCodeDimensionPG cccdNonAirPG   = (NewCargoCatCodeDimensionPG)ldmf.createPropertyGroup(CargoCatCodeDimensionPG.class);    cccdNonAirPG.setDimensions(nonAirPG);    if (firstItem instanceof AggregateAsset) { // there is only one item...      if (realAssets.size () > 1)	logger.error (getBindingSite().getAgentIdentifier() + " skipping some expanded items???");      AggregateAsset aggAsset = (AggregateAsset) firstItem;      PhysicalPG itemPhysicalPG = ((GLMAsset)aggAsset.getAsset()).getPhysicalPG();      MovabilityPG movabilityPG = ((GLMAsset)aggAsset.getAsset()).getMovabilityPG();      String ccc = null;      if (movabilityPG == null)	logger.warn (getBindingSite().getAgentIdentifier() + " " + aggAsset.getAsset() +		     " was missing a movability PG, so could not determine cargo cat code.");      else {	ccc = movabilityPG.getCargoCategoryCode();	if (logger.isInfoEnabled ())	  logger.info ("Aggregate's base asset " + aggAsset.getAsset() + " ccc was " + ccc);      }      if (itemPhysicalPG == null) {	if (!((GLMAsset)aggAsset.getAsset()).hasPersonPG())	  warn (".setDimensions - asset " + firstItem + 		"'s base asset " + (GLMAsset)aggAsset.getAsset() + " has no physical PG.");	else if (isDebugEnabled ())	  debug (".setDimensions - NOTE : asset " + firstItem + 		 "'s base asset " + (GLMAsset)aggAsset.getAsset() + " has no physical PG.");      }      else {	long quantity = aggAsset.getQuantity();	double q = (double)quantity;	// it doesn't make sense to display aggregate length, width, height,	// since they won't correspond to area and volume	area   = itemPhysicalPG.getFootprintArea().getSquareMeters() * q;	volume = itemPhysicalPG.getVolume().getCubicMeters() * q;	mass   = itemPhysicalPG.getMass().getKilograms() * q;		addToDimension (ccc, q, itemPhysicalPG, cccdBulkPG, cccdOversizePG, cccdOutsizePG, cccdNonAirPG);      }    }    else {      for (Iterator iter = realAssets.iterator(); iter.hasNext();) {	GLMAsset asset = (GLMAsset)iter.next();	PhysicalPG itemPhysicalPG = asset.getPhysicalPG();	MovabilityPG movabilityPG = asset.getMovabilityPG();	String ccc = null;	if (movabilityPG == null)	  logger.warn (getBindingSite().getAgentIdentifier() + " " + asset +		       " was missing a movability PG, so could not determine cargo cat code.");	else {	  ccc = movabilityPG.getCargoCategoryCode();	  if (logger.isInfoEnabled ())	    logger.info (asset.toString () + " ccc was " + ccc);	}	if (itemPhysicalPG == null)	  error ("Asset " + asset + " doesn't have a physical PG.");	else {	  // it doesn't make sense to display aggregate length, width, height,	  // since they won't correspond to area and volume	  area   += itemPhysicalPG.getFootprintArea().getSquareMeters();	  volume += itemPhysicalPG.getVolume().getCubicMeters();	  mass   += itemPhysicalPG.getMass().getKilograms();	  addToDimension (ccc, 1.0, itemPhysicalPG, cccdBulkPG, cccdOversizePG, cccdOutsizePG, cccdNonAirPG);	}      }    }    physicalPG.setMass  (new Mass     (mass,   Mass.KILOGRAMS ));    physicalPG.setFootprintArea(new Area (area,   Area.SQUARE_METERS));    physicalPG.setVolume(new Volume   (volume,   Volume.CUBIC_METERS));    if (isDebugEnabled()) {      debug (".setDimensions got " + realAssets.size () + " items.");      debug (".setDimensions low fi dimensions : " + 	     " m " + physicalPG.getMass () + 	     " a " + physicalPG.getFootprintArea () + 	     " v " + physicalPG.getVolume ());    }    Set cccds = new HashSet ();    if (cccdBulkPG.getDimensions().getFootprintArea () != null)      cccds.add (cccdBulkPG);    if (cccdOversizePG.getDimensions().getFootprintArea () != null)      cccds.add (cccdOversizePG);    if (cccdOutsizePG.getDimensions().getFootprintArea () != null)      cccds.add (cccdOutsizePG);    if (cccdNonAirPG.getDimensions().getFootprintArea () != null)      cccds.add (cccdNonAirPG);    return cccds;  }