Java Doc for AssetUtil.java in  » Science » Cougaar12_4 » org » cougaar » glm » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » Cougaar12_4 » org.cougaar.glm.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.cougaar.lib.util.UTILAsset
      org.cougaar.glm.util.AssetUtil

AssetUtil
public class AssetUtil extends UTILAsset (Code)
This class contains utility functions for getting Assets.


Field Summary
final public static  RoleAMMO_PORT_ROLE
    
final public static  RoleAMMO_PORT_ROLE_ALT
    
final public static  RoleCARGO_PORT_ROLE
    
 GLMPreferenceglmPrefHelper
    
 GLMPrepPhraseglmPrepHelper
    
protected  intlatestUID
    
 GLMMeasuremeasureHelper
    

Constructor Summary
public  AssetUtil(Logger logger)
    

Method Summary
public  VectorExpandAsset(PlanningFactory theFactory, Asset asset)
    
 convert an AssetGroup/AggregateAsset into it's component assets,
 recursing through any contained AssetGroup/AggregateAssets as
 needed.
 Note : Convoys are AssetGroups, so the contents of the convoy
 will also appear on the result list.
 Will take an aggregate asset and create new instances that are
 copies of the asset of the aggregation.
public  booleancheckTaskAgainstRoleSchedule(Asset a, Task t)
     Check to see if the task fits in the role schedule of the asset. DON'T perform any allocation, assignment, etc.
public  OrganizationfindPortOrg(GeolocLocation loc, Enumeration ports_en, String myClusterName)
     Utility method - find the organization corresponding to the port at the given location
Parameters:
  loc - he location
Parameters:
  ports_en - a list of ports to search: probably obtained by a call togetOrganizationAssets()
Parameters:
  myClusterName - used for logger.isDebugEnabled()()ging purposes.
protected synchronized  intgetLatestUID()
    
public  GeolocLocationgetMostRecentKnownPosition(Asset a, Date time)
     Necessary for accurate ship location computation. NOTE that travel isn't taken into account in that if the time specified is in the middle of the time when the asset is traveling between tasks, the position reported will be the end of the last task.
public  StringgetNodeNames(TransportationRoute route)
     Inefficient...
public  OrganizationgetOrg(HashMap table, String geolocCode)
     Finds the organization with the given geolocCode in the given table.
public  OrganizationgetOrgAsst(Iterator assets, String desiredRole)
     Utility method for finding organization/cluster assets.
public  ListgetOrgAssts(Iterator assets, String desiredRole)
     Utility method for finding organization/cluster assets.
public  ListgetOrgList(HashMap table, String geolocCode)
    
public  GeolocLocationgetOrgLocation(Organization o)
    
public  OrganizationgetSelf(Enumeration clusterAssets)
     This call gets oneself as an organization asset.
public  StringgetUniqueTag(Asset a)
    
public  booleanhasOrg(HashMap table, String geolocCode)
    
public  booleanisAmmo(Asset asset)
     check to see if an asset represents ammo works with an aggregate asset too.
public  booleanisAmmoPort(Asset p)
    
public  booleanisCargoPort(Asset p)
    
public  booleanisConsumable(Asset asset)
    
public  booleanisPallet(Asset asset)
    
public  booleanisPassenger(Asset asset)
    
public  booleanisPrepoTask(Task t)
    
 See if a task is a prepo task (i.e.
public  booleanisRepairable(Asset asset)
    
public  booleanisStandardContainer(Asset a)
    
public  booleanisVehicle(Asset a)
     Determines if the asset passed in is a vehicle (for purposes of ship loading) or not.
public  booleanisVehicleOrAircraft(Asset a)
     Determines if the asset passed in is a vehicle (for purposes of ship loading) or not OR is a crated aircraft.
final public  ConvoymakeConvoy(PlanningFactory root, String uniqueID)
    
public  HashMaporgAssetLocation(List organizations)
     creates a HashMap of organizations with their geolocCodes as keys.
public  voidsetMaxCubicFt(double max)
     These control how big something must be before it is made into distinct assets instead of remaining within an aggregate asset.
public  voidsetMaxSqFt(double max)
    
public  AreatotalAdjustedArea(Asset asset)
    
public  VolumetotalAdjustedVolume(Asset asset)
    
public  AreatotalArea(Asset asset)
    
public  AreatotalArea(Asset asset, boolean ignoreContainers)
    
public  longtotalContainers(Asset asset)
    
public  doubletotalCubicMeters(Asset asset)
    
public  MasstotalMass(Asset asset)
    
public  doubletotalSquareFeet(Asset asset)
     helper function, gets the total square feet footprint of an asset ( regardless of whether it's an Asset, AssetGroup, AggregateAsset, or whatever)
Parameters:
  asset - the asset double the area of the asset in sqr.
public  doubletotalTons(Asset asset)
    
public  VolumetotalVolume(Asset asset)
    
public  VolumetotalVolume(Asset asset, boolean ignoreVehiclesAndContainers)
    

Field Detail
AMMO_PORT_ROLE
final public static Role AMMO_PORT_ROLE(Code)



AMMO_PORT_ROLE_ALT
final public static Role AMMO_PORT_ROLE_ALT(Code)



CARGO_PORT_ROLE
final public static Role CARGO_PORT_ROLE(Code)



glmPrefHelper
GLMPreference glmPrefHelper(Code)



glmPrepHelper
GLMPrepPhrase glmPrepHelper(Code)



latestUID
protected int latestUID(Code)



measureHelper
GLMMeasure measureHelper(Code)




Constructor Detail
AssetUtil
public AssetUtil(Logger logger)(Code)




Method Detail
ExpandAsset
public Vector ExpandAsset(PlanningFactory theFactory, Asset asset)(Code)
 convert an AssetGroup/AggregateAsset into it's component assets,
 recursing through any contained AssetGroup/AggregateAssets as
 needed.
 Note : Convoys are AssetGroups, so the contents of the convoy
 will also appear on the result list.
 Will take an aggregate asset and create new instances that are
 copies of the asset of the aggregation.  These will have
 item id's like "xxx-7_of_9_from_yyy", where xxx is the original id, 
 the quantity of the aggregate asset is 9, and yyy is the number of times
 this method has been called.  Yes, you might ask, why not use the
 aggregate's UID?  Well this seems to be null.  Why not the agg's asset? 
 Well, this is just a prototype, so two different aggregations will
 have the same asset, giving us the same UID.
 This allows the receipt of two aggregates of the same type of object
 creating distinct subobjects.  Otherwise a M1A1-7_of_9 from one aggregate
 would be equals() and hashcode() equal to a M1A1-7_of_9 from another.  
 This is needed since now Assets are equal on the basis of type and item
 PG equality.  (01/23/99 GWFV)
 Will not break up aggregate
 assets where the items are smaller than one cubic foot.
 

Parameters:
  asset - AssetGroup/AggreateAsset to divide Vector of sub-objects



checkTaskAgainstRoleSchedule
public boolean checkTaskAgainstRoleSchedule(Asset a, Task t)(Code)
Check to see if the task fits in the role schedule of the asset. DON'T perform any allocation, assignment, etc. just check for enough space. FOR NOW, (!!FIXIT!!) we're assuming the ship is EMPTY unless fully allocated, i.e. you have to manage the loading yourself without actually adding something on the ship until you add everything in one big block. You can actually get into the guts of the asset and check the role schedule for yourself if you really want to, but it's kind of ugly. There are two possible legal cases (i.e. no nulls or other errors) in which this method will return false: the role schedule doesn't have availability for a task, or the role schedule already has plan elements in the time window where we want the task to fit that make the schedule unfeasible.



findPortOrg
public Organization findPortOrg(GeolocLocation loc, Enumeration ports_en, String myClusterName)(Code)
Utility method - find the organization corresponding to the port at the given location
Parameters:
  loc - he location
Parameters:
  ports_en - a list of ports to search: probably obtained by a call togetOrganizationAssets()
Parameters:
  myClusterName - used for logger.isDebugEnabled()()ging purposes. the port that matches the location.



getLatestUID
protected synchronized int getLatestUID()(Code)



getMostRecentKnownPosition
public GeolocLocation getMostRecentKnownPosition(Asset a, Date time)(Code)
Necessary for accurate ship location computation. NOTE that travel isn't taken into account in that if the time specified is in the middle of the time when the asset is traveling between tasks, the position reported will be the end of the last task. This is as intended. If the time specified is in the middle of a task, we interpolate. (!!FIXIT!!) GeolocLocation representing the current position of the assetat the time specified. returns null if none found



getNodeNames
public String getNodeNames(TransportationRoute route)(Code)
Inefficient... string that lists the nodes in the route



getOrg
public Organization getOrg(HashMap table, String geolocCode)(Code)
Finds the organization with the given geolocCode in the given table.
Parameters:
  table - the table to search
Parameters:
  geolocCode - the string to search for Organization the organization with the geolocCode.



getOrgAsst
public Organization getOrgAsst(Iterator assets, String desiredRole)(Code)
Utility method for finding organization/cluster assets.
Parameters:
  assets - the Enumeration of assets received from the asset container
Parameters:
  desiredRole - a string describing the capable role of an organizationthe string is defined in the mycluster-prototype-ini.dat file in the topsconfig directory. Organization that has the role described in desiredRole



getOrgAssts
public List getOrgAssts(Iterator assets, String desiredRole)(Code)
Utility method for finding organization/cluster assets.
Parameters:
  assets - the Enumeration of assets received from the asset container
Parameters:
  desiredRole - a string describing the capable role of an organizationthe string is defined in the mycluster-prototype-ini.dat file in the topsconfig directory. Organization that has the role described in desiredRole



getOrgList
public List getOrgList(HashMap table, String geolocCode)(Code)



getOrgLocation
public GeolocLocation getOrgLocation(Organization o)(Code)
get the GeolocoLocation of an organization
Parameters:
  o - the organization



getSelf
public Organization getSelf(Enumeration clusterAssets)(Code)
This call gets oneself as an organization asset.
Parameters:
  clusterAssets - the En of assets received from the asset container Organization which represents current cluster



getUniqueTag
public String getUniqueTag(Asset a)(Code)



hasOrg
public boolean hasOrg(HashMap table, String geolocCode)(Code)



isAmmo
public boolean isAmmo(Asset asset)(Code)
check to see if an asset represents ammo works with an aggregate asset too. Something is ammo it's an instance of org.cougaar.glm.ldm.asset.Ammunition OR The type identification PG's nomenclature is Ammunition
See Also:   org.cougaar.glm.ldm.asset.Ammunition
Parameters:
  asset - the asset to check boolean



isAmmoPort
public boolean isAmmoPort(Asset p)(Code)
test if port is an ammo port
Parameters:
  p - Organization to be tested true if is an ammo port



isCargoPort
public boolean isCargoPort(Asset p)(Code)
test if organization is a non-ammo port
Parameters:
  p - Organization to be tested true if it is a generic port



isConsumable
public boolean isConsumable(Asset asset)(Code)
check to see if an asset represents a consumable
Parameters:
  asset - the asset to check boolean



isPallet
public boolean isPallet(Asset asset)(Code)
check to see if an asset represents a Pallet
Parameters:
  asset - the asset to check boolean



isPassenger
public boolean isPassenger(Asset asset)(Code)
check to see if an asset represents a passenger
Parameters:
  asset - the asset to check boolean



isPrepoTask
public boolean isPrepoTask(Task t)(Code)
 See if a task is a prepo task (i.e. 
 already packed in a ship hanging arround
 in the middle of the ocean somewhere).
 The check is made to see if the task has a WITH
 preposition.
 We look up the ship referred to by the String (Ship ID) 
 in GlobalSea, where the ships are owned.
 

Parameters:
  t - task to check boolean



isRepairable
public boolean isRepairable(Asset asset)(Code)
check to see if an asset represents a repairable
Parameters:
  asset - the asset to check boolean



isStandardContainer
public boolean isStandardContainer(Asset a)(Code)
Determines if the asset passed in is a standard container or not



isVehicle
public boolean isVehicle(Asset a)(Code)
Determines if the asset passed in is a vehicle (for purposes of ship loading) or not.



isVehicleOrAircraft
public boolean isVehicleOrAircraft(Asset a)(Code)
Determines if the asset passed in is a vehicle (for purposes of ship loading) or not OR is a crated aircraft. These items are packed on ship by area.



makeConvoy
final public Convoy makeConvoy(PlanningFactory root, String uniqueID)(Code)



orgAssetLocation
public HashMap orgAssetLocation(List organizations)(Code)
creates a HashMap of organizations with their geolocCodes as keys.
Parameters:
  organizations - the en of organizations to be put in the hashmap HashMap the newly constructed table with geolocCodes as keys,and the corresponding organization as object.



setMaxCubicFt
public void setMaxCubicFt(double max)(Code)
These control how big something must be before it is made into distinct assets instead of remaining within an aggregate asset.



setMaxSqFt
public void setMaxSqFt(double max)(Code)



totalAdjustedArea
public Area totalAdjustedArea(Asset asset)(Code)
get the total Area of an asset regardless of whether it's an Asset, AssetGroup, AggregateAsset, or whatever BUT adjusted for the peculiar semantics of asset handling in GlobalSea >Vehicles only have footprint area >Containers only have volume
Parameters:
  asset - the asset Area the total area of the asset



totalAdjustedVolume
public Volume totalAdjustedVolume(Asset asset)(Code)
get the total Volume of an asset ( regardless of whether it's an Asset, AssetGroup, AggregateAsset, or whatever)
Parameters:
  asset - the asset Volume the total volume of the asset



totalArea
public Area totalArea(Asset asset)(Code)
get the total Area of an asset regardless of whether it's an Asset, AssetGroup, AggregateAsset, or whatever
Parameters:
  asset - the asset Area the total area of the asset



totalArea
public Area totalArea(Asset asset, boolean ignoreContainers)(Code)



totalContainers
public long totalContainers(Asset asset)(Code)



totalCubicMeters
public double totalCubicMeters(Asset asset)(Code)
helper function, gets the total volume of an asset ( regardless of whether it's an Asset, AssetGroup, AggregateAsset, or whatever)
Parameters:
  asset - the asset double the volume of the asset in cubic meters



totalMass
public Mass totalMass(Asset asset)(Code)
get the total Mass of an asset ( regardless of whether it's an Asset, AssetGroup, AggregateAsset, or whatever)
Parameters:
  asset - the asset Mass the total mass of the asset



totalSquareFeet
public double totalSquareFeet(Asset asset)(Code)
helper function, gets the total square feet footprint of an asset ( regardless of whether it's an Asset, AssetGroup, AggregateAsset, or whatever)
Parameters:
  asset - the asset double the area of the asset in sqr. ft.



totalTons
public double totalTons(Asset asset)(Code)
helper function, gets the total mass of an asset ( regardless of whether it's an Asset, AssetGroup, AggregateAsset, or whatever)
Parameters:
  asset - the asset double the mass of the asset in cubic meters



totalVolume
public Volume totalVolume(Asset asset)(Code)
get the total Volume of an asset ( regardless of whether it's an Asset, AssetGroup, AggregateAsset, or whatever)
Parameters:
  asset - the asset Volume the total volume of the asset



totalVolume
public Volume totalVolume(Asset asset, boolean ignoreVehiclesAndContainers)(Code)



Fields inherited from org.cougaar.lib.util.UTILAsset
protected Logger logger(Code)(Java Doc)
protected UTILPreference prefHelper(Code)(Java Doc)

Methods inherited from org.cougaar.lib.util.UTILAsset
public boolean containsAssetGroup(Asset asset)(Code)(Java Doc)
public Asset createInstance(LDMServesPlugin ldm, String prototypeName, String bumperno)(Code)(Java Doc)
public Vector expandAssetGroup(AssetGroup group)(Code)(Java Doc)
public Task findClosestRoleScheduleTask(RoleSchedule rs, Date time, boolean check_backwards)(Code)(Java Doc)
public String getItemName(Asset item)(Code)(Java Doc)
public String getTypeName(Asset item)(Code)(Java Doc)
final public AssetGroup makeAssetGroup(PlanningFactory root, String id)(Code)(Java Doc)
final public AssetGroup makeAssetGroup(PlanningFactory root, Vector v)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.