} else if (asset instanceof AggregateAsset) { retval = grabUnit(((AggregateAsset)asset).getAsset()); } else { if (!((ALPAsset)asset).hasForUnitPG()) retval = null; else retval = ((ALPAsset)asset).getForUnitPG().getUnit();
} else { PropertyGroup forunit = asset.searchForPropertyGroup(ForUnitPG.class); if (forunit == null) retval = null; else retval = ((ForUnitPG)forunit).getUnit();
    private static String grabUnit(Asset asset) {	String retval = null;	String tempval = null;	if (asset instanceof AssetGroup) {	    Vector assetList = ((AssetGroup)asset).getAssets();	    for (int i = 0; i < assetList.size(); i++) {		tempval = grabUnit((Asset)assetList.elementAt(i));		if (tempval == null || (retval != null &&					!(tempval.equals(retval))))		    return null;		retval = tempval;	    }	} else if (asset instanceof AggregateAsset) {	    retval = grabUnit(((AggregateAsset)asset).getAsset());	} else { 	    if (!((ALPAsset)asset).hasForUnitPG()) retval = null;	    else retval = ((ALPAsset)asset).getForUnitPG().getUnit();	}	return retval;    }