Java Doc for DirectDataHelper.java in  » Science » Cougaar12_4 » org » cougaar » lib » vishnu » client » custom » 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.lib.vishnu.client.custom 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.cougaar.lib.vishnu.client.custom.DirectDataHelper

DirectDataHelper
public class DirectDataHelper implements DataHelper(Code)
Fills in the fields of Vishnu objects sent to the Vishnu Scheduler.

Scans the format document to determine the types of each field of data. This is necessary with direct translation because when a field is added its attributes must be set. These are :

- datatype - the field type

- is_subobject - is the field's type a primitive or a subobject

- is_key - is this field the key field for the object

- is_list - is this field a list


Inner Class :protected class ObjectInfo

Field Summary
protected  DateendOfWorld
    
protected  MapgeolocCodeCache
    
protected  MaplatLonCache
    
protected  Loggerlogger
    
protected  Mapobjects
    
protected  SchedulingDataschedData
    

Constructor Summary
public  DirectDataHelper(Document formatDoc, SchedulingData schedData, Logger logger)
     Sets up the endOfWorld time, used in createRoleScheduleListField.

Method Summary
public  voidaddListValue(Object parent, String fieldName, String type, Object toAppend)
    
public  voidcreateAvailableScheduleListField(Object object, String name, Asset asset)
    
public  voidcreateBooleanField(Object parent, String name, boolean value)
    
public  voidcreateDateField(Object parent, String name, Date date)
    
public  ObjectcreateField(Object parent, String name)
    
public  ObjectcreateField(Object parent, String name, String value)
    
public  voidcreateField(Object parent, String parentType, String name, String value)
     Generic field creation

Given the parentType and the name of the field, looks up the other field attributes in the objects map, using the isKey, isList, and getType methods.

public  ObjectcreateFieldPair(String name, String value)
    
public  voidcreateFloatField(Object parent, String name, float value)
    
public  voidcreateGeoloc(Object parent, String parentFieldName, NamedPosition loc)
     Translate a Cougaar GeolocLocation into the equivalent Vishnu structure.
public  voidcreateLatLon(Object parent, String parentFieldName, LatLonPoint loc)
    
public  ObjectcreateObject(Object parent, String type)
    
public  voidcreateRoleScheduleListField(Object object, String name, Asset asset)
     Translate an asset's role schedule into a list of Vishnu intervals The interval has a start and end time and the verb of plan element in the role schedule.
protected  voidcreateScheduleFields(Collection schedule, SchObject resource, String name)
    
protected  StringgetType(String parentType, String name)
    
protected  booleanisKey(String parentType, String name)
     In all of these methods (isKey, isList, isSub, getType),
if a type is not found in the objects map, it may
be because it's a predefined type.
protected  booleanisList(String parentType, String name)
    
protected  booleanisPredefined(String type)
    
protected  booleanisSub(String parentType, String name)
    
protected  voidscanFormatDoc(Document formatDoc)
     Scans the format document to determine the types of each field of data.
public  ObjectstartList(Object object, String name)
    

Field Detail
endOfWorld
protected Date endOfWorld(Code)
used in createRoleScheduleListField



geolocCodeCache
protected Map geolocCodeCache(Code)



latLonCache
protected Map latLonCache(Code)



logger
protected Logger logger(Code)



objects
protected Map objects(Code)
holds Vishnu object attributes per type



schedData
protected SchedulingData schedData(Code)
reference to SchedulingData object, used whenever a date is created




Constructor Detail
DirectDataHelper
public DirectDataHelper(Document formatDoc, SchedulingData schedData, Logger logger)(Code)
Sets up the endOfWorld time, used in createRoleScheduleListField.
See Also:   DirectDataHelper.createRoleScheduleListField
Parameters:
  formatDoc - - the object format document




Method Detail
addListValue
public void addListValue(Object parent, String fieldName, String type, Object toAppend)(Code)



createAvailableScheduleListField
public void createAvailableScheduleListField(Object object, String name, Asset asset)(Code)



createBooleanField
public void createBooleanField(Object parent, String name, boolean value)(Code)
shortcut to create a boolean field on parent



createDateField
public void createDateField(Object parent, String name, Date date)(Code)
shortcut to create a date field on parent



createField
public Object createField(Object parent, String name)(Code)
not used in this helper



createField
public Object createField(Object parent, String name, String value)(Code)
not used in this helper



createField
public void createField(Object parent, String parentType, String name, String value)(Code)
Generic field creation

Given the parentType and the name of the field, looks up the other field attributes in the objects map, using the isKey, isList, and getType methods.

This map is set in scanFormatDoc.
See Also:   DirectDataHelper.scanFormatDoc
See Also:   DirectDataHelper.objects
Parameters:
  parent - SchObject object to add the field to
Parameters:
  parentType - type of the SchObject
Parameters:
  name - field name
Parameters:
  value - field's value




createFieldPair
public Object createFieldPair(String name, String value)(Code)
not used in this helper



createFloatField
public void createFloatField(Object parent, String name, float value)(Code)
shortcut to create a float field on parent



createGeoloc
public void createGeoloc(Object parent, String parentFieldName, NamedPosition loc)(Code)
Translate a Cougaar GeolocLocation into the equivalent Vishnu structure. The field names here are all "parentFieldName".name, e.g. from.geolocCode. Adds a latlong SchObject to the parent object, and adds the geoloc to the parent. Uses a geolocCode and latLon Cache to drastically reduce the number of Geoloc and latLon objects that are created.
Parameters:
  parent - - the SchObject to add the parentFieldName geoloc field to
Parameters:
  parentFieldName - - the base name of the geoloc field
Parameters:
  loc - - the Cougaar GeolocLocation to translate into a Vishnu structure



createLatLon
public void createLatLon(Object parent, String parentFieldName, LatLonPoint loc)(Code)



createObject
public Object createObject(Object parent, String type)(Code)
create a vanilla Vishnu object
Parameters:
  parent - - ignored here
Parameters:
  type - - ignored here



createRoleScheduleListField
public void createRoleScheduleListField(Object object, String name, Asset asset)(Code)
Translate an asset's role schedule into a list of Vishnu intervals The interval has a start and end time and the verb of plan element in the role schedule.
Parameters:
  object - - the SchObject to add the name list field to
Parameters:
  name - - the name of the list field
Parameters:
  asset - - the asset with the role schedule



createScheduleFields
protected void createScheduleFields(Collection schedule, SchObject resource, String name)(Code)



getType
protected String getType(String parentType, String name)(Code)



isKey
protected boolean isKey(String parentType, String name)(Code)
In all of these methods (isKey, isList, isSub, getType),
if a type is not found in the objects map, it may
be because it's a predefined type.

This should never happen, though.




isList
protected boolean isList(String parentType, String name)(Code)



isPredefined
protected boolean isPredefined(String type)(Code)



isSub
protected boolean isSub(String parentType, String name)(Code)



scanFormatDoc
protected void scanFormatDoc(Document formatDoc)(Code)
Scans the format document to determine the types of each field of data. Stores this information in the objects map.
Parameters:
  formatDoc - the object format document



startList
public Object startList(Object object, String name)(Code)



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.