diff --git a/doc/CamelComponents/CamelREST.html b/doc/CamelComponents/CamelREST.html index 8357b2e..f1f7d2c 100644 --- a/doc/CamelComponents/CamelREST.html +++ b/doc/CamelComponents/CamelREST.html @@ -2,7 +2,7 @@ - + CamelREST diff --git a/doc/CamelComponents/package-summary.html b/doc/CamelComponents/package-summary.html index 1df3b0d..e6cf54a 100644 --- a/doc/CamelComponents/package-summary.html +++ b/doc/CamelComponents/package-summary.html @@ -2,7 +2,7 @@ - + CamelComponents diff --git a/doc/CamelComponents/package-tree.html b/doc/CamelComponents/package-tree.html index cf8e42b..96f3af6 100644 --- a/doc/CamelComponents/package-tree.html +++ b/doc/CamelComponents/package-tree.html @@ -2,7 +2,7 @@ - + CamelComponents Class Hierarchy diff --git a/doc/MainApp.html b/doc/MainApp.html index bbd50cf..75e8f80 100644 --- a/doc/MainApp.html +++ b/doc/MainApp.html @@ -2,7 +2,7 @@ - + MainApp diff --git a/doc/Models/Arrival.html b/doc/Models/Arrival.html index 0aade8c..3472e97 100644 --- a/doc/Models/Arrival.html +++ b/doc/Models/Arrival.html @@ -2,7 +2,7 @@ - + Arrival diff --git a/doc/Models/Direction.html b/doc/Models/Direction.html index f031edb..41132c4 100644 --- a/doc/Models/Direction.html +++ b/doc/Models/Direction.html @@ -2,7 +2,7 @@ - + Direction diff --git a/doc/Models/StationsWrapper.html b/doc/Models/StationsWrapper.html index ff607b5..e6f1382 100644 --- a/doc/Models/StationsWrapper.html +++ b/doc/Models/StationsWrapper.html @@ -2,7 +2,7 @@ - + StationsWrapper diff --git a/doc/Models/Time.html b/doc/Models/Time.html index a0fe9a5..71b3d35 100644 --- a/doc/Models/Time.html +++ b/doc/Models/Time.html @@ -2,7 +2,7 @@ - + Time diff --git a/doc/Models/TimeTable.html b/doc/Models/TimeTable.html index 2715c8d..43ff9b5 100644 --- a/doc/Models/TimeTable.html +++ b/doc/Models/TimeTable.html @@ -2,7 +2,7 @@ - + TimeTable diff --git a/doc/Models/TimetablesWrapper.html b/doc/Models/TimetablesWrapper.html index 12a838d..113df97 100644 --- a/doc/Models/TimetablesWrapper.html +++ b/doc/Models/TimetablesWrapper.html @@ -2,7 +2,7 @@ - + TimetablesWrapper diff --git a/doc/Models/TransportStation.html b/doc/Models/TransportStation.html index b61f248..dbff724 100644 --- a/doc/Models/TransportStation.html +++ b/doc/Models/TransportStation.html @@ -2,7 +2,7 @@ - + TransportStation diff --git a/doc/Models/Vehicle.html b/doc/Models/Vehicle.html index 3a24e59..997e152 100644 --- a/doc/Models/Vehicle.html +++ b/doc/Models/Vehicle.html @@ -2,7 +2,7 @@ - + Vehicle diff --git a/doc/Models/VehiclesWrapper.html b/doc/Models/VehiclesWrapper.html index a39f242..d00d892 100644 --- a/doc/Models/VehiclesWrapper.html +++ b/doc/Models/VehiclesWrapper.html @@ -2,7 +2,7 @@ - + VehiclesWrapper diff --git a/doc/Models/package-summary.html b/doc/Models/package-summary.html index 41b778f..24f0b64 100644 --- a/doc/Models/package-summary.html +++ b/doc/Models/package-summary.html @@ -2,7 +2,7 @@ - + Models diff --git a/doc/Models/package-tree.html b/doc/Models/package-tree.html index 35038f2..2fa4144 100644 --- a/doc/Models/package-tree.html +++ b/doc/Models/package-tree.html @@ -2,7 +2,7 @@ - + Models Class Hierarchy diff --git a/doc/STPTMain.html b/doc/STPTMain.html index c27c164..deecdca 100644 --- a/doc/STPTMain.html +++ b/doc/STPTMain.html @@ -2,7 +2,7 @@ - + STPTMain diff --git a/doc/allclasses-index.html b/doc/allclasses-index.html index 9fd7219..d9c1c91 100644 --- a/doc/allclasses-index.html +++ b/doc/allclasses-index.html @@ -2,7 +2,7 @@ - + All Classes diff --git a/doc/allclasses.html b/doc/allclasses.html index 5d1a8bd..944cd32 100644 --- a/doc/allclasses.html +++ b/doc/allclasses.html @@ -2,7 +2,7 @@ - + All Classes diff --git a/doc/allpackages-index.html b/doc/allpackages-index.html index 2e72a7f..ae1567f 100644 --- a/doc/allpackages-index.html +++ b/doc/allpackages-index.html @@ -2,7 +2,7 @@ - + All Packages diff --git a/doc/constant-values.html b/doc/constant-values.html index a9fb9fe..6ad2dac 100644 --- a/doc/constant-values.html +++ b/doc/constant-values.html @@ -2,7 +2,7 @@ - + Constant Field Values diff --git a/doc/core/Interactor.html b/doc/core/Interactor.html index cf41de1..6521dfa 100644 --- a/doc/core/Interactor.html +++ b/doc/core/Interactor.html @@ -2,7 +2,7 @@ - + Interactor diff --git a/doc/core/StationsInteractor.html b/doc/core/StationsInteractor.html index 4263c3e..51e8ee3 100644 --- a/doc/core/StationsInteractor.html +++ b/doc/core/StationsInteractor.html @@ -2,7 +2,7 @@ - + StationsInteractor @@ -27,7 +27,7 @@ catch(err) { } //--> -var data = {"i0":10,"i1":10}; +var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -197,15 +197,50 @@

Method Summary

Description +org.w3c.dom.Node +createStation​(java.lang.Integer new_id, + int lineID, + java.lang.String lineName, + int stationID, + java.lang.String rawStationName, + java.lang.String friendlyStationName, + java.lang.String shortStationName, + java.lang.String junctionName, + double x, + double y, + java.lang.Boolean is_invalid, + java.lang.String verif, + java.lang.String verif_date, + java.lang.String gmaps_links, + java.lang.String info_comm) +  + + +org.w3c.dom.Node +createStation​(TransportStation t) +  + + +org.w3c.dom.Document +deleteStation​(java.lang.Integer id) +  + + org.w3c.dom.NodeList getAllStations()   - + org.w3c.dom.Node getStation​(java.lang.Integer station_id)   + +org.w3c.dom.Document +replaceStation​(java.lang.Integer id, + TransportStation t) +  + @@ -311,9 +350,14 @@

createVehicle

createVehicle

public org.w3c.dom.Node createVehicle​(Vehicle v)
                                throws javax.xml.xpath.XPathExpressionException
+
Method for creating a new vehicle which is used by JAXB binding.
+
Parameters:
+
v - Vehicle: Vehicle element representing the new element to be added.
+
Returns:
+
Returns a Node element representing the newly added vehicle element.
Throws:
-
javax.xml.xpath.XPathExpressionException
+
javax.xml.xpath.XPathExpressionException - @see XPathExpressionException
@@ -325,9 +369,15 @@

createVehicle

getAllVehicles

public org.w3c.dom.NodeList getAllVehicles()
                                     throws javax.xml.xpath.XPathExpressionException
+
Method for querying for all available vehicles, taken from the parent XML document. + + The querying is done by passing the following xPath expression to the XPathUtils object: + "/vehicles-root/vehicles/vehicle"
+
Returns:
+
NodeList: A list of Nodes representing all the matched elements found by the query.
Throws:
-
javax.xml.xpath.XPathExpressionException
+
javax.xml.xpath.XPathExpressionException - @see XPathExpressionException
@@ -339,9 +389,20 @@

getAllVehicles

getVehicle

public org.w3c.dom.Node getVehicle​(java.lang.Integer vehicle_id)
                             throws javax.xml.xpath.XPathExpressionException
+
Method for finding a vehicle based on a given id. + + The querying is done by passing the searched id in the following xPath expression, and passing the expression to + the XPathUtils class: + "//vehicle[@id=%s]" + + The vehicle whose id matches the required id will be returned.
+
Parameters:
+
vehicle_id - Integer: Searched vehicle id.
+
Returns:
+
Node: If the vehicle with the requested id has been found, it will be returned.
Throws:
-
javax.xml.xpath.XPathExpressionException
+
javax.xml.xpath.XPathExpressionException - @see XPathExpressionException
@@ -353,9 +414,20 @@

getVehicle

deleteVehicle

public org.w3c.dom.Document deleteVehicle​(java.lang.Integer id)
                                    throws javax.xml.xpath.XPathExpressionException
+
Method for deleting an element of type vehicle based on a given id. + + The querying to find the vehicle whose specific id is the requested one is done by passing the following xPath + expression to the XPathUtils object: + "//vehicle[@id=%s]" + + If the requested vehicle is found, it will be removed from its parent in the XML document.
+
Parameters:
+
id - Integer: id for finding the requested vehicle.
+
Returns:
+
Document: The XML document which has the requested vehicle deleted.
Throws:
-
javax.xml.xpath.XPathExpressionException
+
javax.xml.xpath.XPathExpressionException - @see XPathExpressionException
@@ -368,9 +440,19 @@

replaceVehicle

public org.w3c.dom.Document replaceVehicle​(java.lang.Integer id,
                                            Vehicle vehicle)
                                     throws javax.xml.xpath.XPathExpressionException
+
Method for replacing an element of type vehicle with a new Vehicle, based on a given id. + + The querying to find the requested vehicle to be replaced will be done by using the existent + getVehicle(Integer id) method. If the vehicle is found, a new vehicle is created with the new requirements and + the parent will now replace the old vehicle with the new one.
+
Parameters:
+
id - Integer: id for finding the requested vehicle.
+
vehicle - Vehicle: Replacement for the old vehicle element.
+
Returns:
+
Document: The XML document which has the requested vehicle replaced.
Throws:
-
javax.xml.xpath.XPathExpressionException
+
javax.xml.xpath.XPathExpressionException - @see XPathExpressionException
diff --git a/doc/core/package-summary.html b/doc/core/package-summary.html index 57b34a8..b44b734 100644 --- a/doc/core/package-summary.html +++ b/doc/core/package-summary.html @@ -2,7 +2,7 @@ - + core diff --git a/doc/core/package-tree.html b/doc/core/package-tree.html index 5ecd4b7..f7818d7 100644 --- a/doc/core/package-tree.html +++ b/doc/core/package-tree.html @@ -2,7 +2,7 @@ - + core Class Hierarchy diff --git a/doc/deprecated-list.html b/doc/deprecated-list.html index 9c5cc3d..eb08943 100644 --- a/doc/deprecated-list.html +++ b/doc/deprecated-list.html @@ -2,7 +2,7 @@ - + Deprecated List diff --git a/doc/help-doc.html b/doc/help-doc.html index c238499..6548f5b 100644 --- a/doc/help-doc.html +++ b/doc/help-doc.html @@ -2,7 +2,7 @@ - + API Help diff --git a/doc/index-files/index-1.html b/doc/index-files/index-1.html index c438e37..3ebb0c9 100644 --- a/doc/index-files/index-1.html +++ b/doc/index-files/index-1.html @@ -2,7 +2,7 @@ - + A-Index diff --git a/doc/index-files/index-10.html b/doc/index-files/index-10.html index 1a2d9b3..384f2d0 100644 --- a/doc/index-files/index-10.html +++ b/doc/index-files/index-10.html @@ -2,7 +2,7 @@ - + P-Index diff --git a/doc/index-files/index-11.html b/doc/index-files/index-11.html index d3b8afe..a2a18d2 100644 --- a/doc/index-files/index-11.html +++ b/doc/index-files/index-11.html @@ -2,7 +2,7 @@ - + Q-Index @@ -103,7 +103,7 @@

Q

QueryXPathString(String) - Method in class parsers.XPathUtils
-
Method which, given a query in the form of a String object, generates a ArrayList of responses using +
Method which, given a query in the form of a String object, generates a ArrayList of responses using XPath.
diff --git a/doc/index-files/index-12.html b/doc/index-files/index-12.html index 91d8059..91ee4c3 100644 --- a/doc/index-files/index-12.html +++ b/doc/index-files/index-12.html @@ -2,7 +2,7 @@ - + R-Index @@ -99,8 +99,14 @@

R

rawStationName - Variable in class Models.TransportStation
 
-
replaceVehicle(Integer, Vehicle) - Method in class core.VehiclesInteractor
+
replaceStation(Integer, TransportStation) - Method in class core.StationsInteractor
+
 
+
replaceTimeTable(Integer, TimeTable) - Method in class core.TimeTablesInteractor
 
+
replaceVehicle(Integer, Vehicle) - Method in class core.VehiclesInteractor
+
+
Method for replacing an element of type vehicle with a new Vehicle, based on a given id.
+
A C D F G I J L M P Q R S T V W X 
All Classes All Packages diff --git a/doc/index-files/index-13.html b/doc/index-files/index-13.html index 5529192..2ed1bd5 100644 --- a/doc/index-files/index-13.html +++ b/doc/index-files/index-13.html @@ -2,7 +2,7 @@ - + S-Index diff --git a/doc/index-files/index-14.html b/doc/index-files/index-14.html index 5973373..4a0a710 100644 --- a/doc/index-files/index-14.html +++ b/doc/index-files/index-14.html @@ -2,7 +2,7 @@ - + T-Index diff --git a/doc/index-files/index-15.html b/doc/index-files/index-15.html index c9b89f1..8966f19 100644 --- a/doc/index-files/index-15.html +++ b/doc/index-files/index-15.html @@ -2,7 +2,7 @@ - + V-Index @@ -118,7 +118,10 @@

V

Class which holds the implementation for interacting with a vehicle object.
VehiclesInteractor(String) - Constructor for class core.VehiclesInteractor
-
 
+
+
Constructor of the VehiclesInteractor class, which calls the parent class for creating the marshalled XML + document.
+
VehiclesWrapper - Class in Models
Class which holds the wrapper for the Vehicle object.
diff --git a/doc/index-files/index-16.html b/doc/index-files/index-16.html index 69d9a80..e784e0a 100644 --- a/doc/index-files/index-16.html +++ b/doc/index-files/index-16.html @@ -2,7 +2,7 @@ - + W-Index diff --git a/doc/index-files/index-17.html b/doc/index-files/index-17.html index cff9d02..b6abcab 100644 --- a/doc/index-files/index-17.html +++ b/doc/index-files/index-17.html @@ -2,7 +2,7 @@ - + X-Index diff --git a/doc/index-files/index-2.html b/doc/index-files/index-2.html index 83e57ec..ac5fef8 100644 --- a/doc/index-files/index-2.html +++ b/doc/index-files/index-2.html @@ -2,7 +2,7 @@ - + C-Index @@ -117,12 +117,22 @@

C

 
createDirection(Integer, ArrayList<Arrival>) - Method in class core.TimeTablesInteractor
 
-
createTimeTable(Integer, int, ArrayList<Direction>) - Method in class core.TimeTablesInteractor
+
createStation(Integer, int, String, int, String, String, String, String, double, double, Boolean, String, String, String, String) - Method in class core.StationsInteractor
 
-
createVehicle(Integer, String, String) - Method in class core.VehiclesInteractor
+
createStation(TransportStation) - Method in class core.StationsInteractor
 
-
createVehicle(Vehicle) - Method in class core.VehiclesInteractor
+
createTimeTable(int, ArrayList<Direction>) - Method in class core.TimeTablesInteractor
+
 
+
createTimeTable(TimeTable) - Method in class core.TimeTablesInteractor
 
+
createVehicle(Integer, String, String) - Method in class core.VehiclesInteractor
+
+
Method which is used for creating a new element of the type vehicle.
+
+
createVehicle(Vehicle) - Method in class core.VehiclesInteractor
+
+
Method for creating a new vehicle which is used by JAXB binding.
+
A C D F G I J L M P Q R S T V W X 
All Classes All Packages diff --git a/doc/index-files/index-3.html b/doc/index-files/index-3.html index 32acb1f..1017a39 100644 --- a/doc/index-files/index-3.html +++ b/doc/index-files/index-3.html @@ -2,7 +2,7 @@ - + D-Index @@ -97,8 +97,14 @@

D

-
deleteVehicle(Integer) - Method in class core.VehiclesInteractor
+
deleteStation(Integer) - Method in class core.StationsInteractor
+
 
+
deleteTimeTable(Integer) - Method in class core.TimeTablesInteractor
 
+
deleteVehicle(Integer) - Method in class core.VehiclesInteractor
+
+
Method for deleting an element of type vehicle based on a given id.
+
direction - Variable in class Models.TimeTable
 
Direction - Class in Models
diff --git a/doc/index-files/index-4.html b/doc/index-files/index-4.html index b2938c1..2b18afe 100644 --- a/doc/index-files/index-4.html +++ b/doc/index-files/index-4.html @@ -2,7 +2,7 @@ - + F-Index diff --git a/doc/index-files/index-5.html b/doc/index-files/index-5.html index 6036e8e..712b78b 100644 --- a/doc/index-files/index-5.html +++ b/doc/index-files/index-5.html @@ -2,7 +2,7 @@ - + G-Index @@ -102,7 +102,9 @@

G

getAllTimeTables() - Method in class core.TimeTablesInteractor
 
getAllVehicles() - Method in class core.VehiclesInteractor
-
 
+
+
Method for querying for all available vehicles, taken from the parent XML document.
+
getArticles() - Method in class Models.StationsWrapper
 
getArticles() - Method in class Models.TimetablesWrapper
@@ -120,7 +122,9 @@

G

getTimeTable(Integer) - Method in class core.TimeTablesInteractor
 
getVehicle(Integer) - Method in class core.VehiclesInteractor
-
 
+
+
Method for finding a vehicle based on a given id.
+
gmaps_links - Variable in class Models.TransportStation
 
diff --git a/doc/index-files/index-6.html b/doc/index-files/index-6.html index 210010e..36958ca 100644 --- a/doc/index-files/index-6.html +++ b/doc/index-files/index-6.html @@ -2,7 +2,7 @@ - + I-Index diff --git a/doc/index-files/index-7.html b/doc/index-files/index-7.html index 8ac1fc5..0fc3100 100644 --- a/doc/index-files/index-7.html +++ b/doc/index-files/index-7.html @@ -2,7 +2,7 @@ - + J-Index diff --git a/doc/index-files/index-8.html b/doc/index-files/index-8.html index 6f222d2..8dc65b0 100644 --- a/doc/index-files/index-8.html +++ b/doc/index-files/index-8.html @@ -2,7 +2,7 @@ - + L-Index diff --git a/doc/index-files/index-9.html b/doc/index-files/index-9.html index 9229ebd..0d4cffc 100644 --- a/doc/index-files/index-9.html +++ b/doc/index-files/index-9.html @@ -2,7 +2,7 @@ - + M-Index diff --git a/doc/index.html b/doc/index.html index 6a2f18c..705924e 100644 --- a/doc/index.html +++ b/doc/index.html @@ -2,7 +2,7 @@ - + Overview diff --git a/doc/member-search-index.js b/doc/member-search-index.js index 239a8dc..f0c0eff 100644 --- a/doc/member-search-index.js +++ b/doc/member-search-index.js @@ -1 +1 @@ -memberSearchIndex = [{"p":"Models","c":"Arrival","l":"Arrival()","url":"%3Cinit%3E()"},{"p":"Models","c":"Arrival","l":"Arrival(TransportStation, Time)","url":"%3Cinit%3E(Models.TransportStation,Models.Time)"},{"p":"Models","c":"Direction","l":"arrivals"},{"p":"CamelComponents","c":"CamelREST","l":"CamelREST()","url":"%3Cinit%3E()"},{"p":"CamelComponents","c":"CamelREST","l":"configure()"},{"p":"core","c":"TimeTablesInteractor","l":"createArrival(int, String, Time)","url":"createArrival(int,java.lang.String,Models.Time)"},{"p":"core","c":"TimeTablesInteractor","l":"createDirection(Integer, ArrayList)","url":"createDirection(java.lang.Integer,java.util.ArrayList)"},{"p":"core","c":"TimeTablesInteractor","l":"createTimeTable(Integer, int, ArrayList)","url":"createTimeTable(java.lang.Integer,int,java.util.ArrayList)"},{"p":"core","c":"VehiclesInteractor","l":"createVehicle(Integer, String, String)","url":"createVehicle(java.lang.Integer,java.lang.String,java.lang.String)"},{"p":"core","c":"VehiclesInteractor","l":"createVehicle(Vehicle)","url":"createVehicle(Models.Vehicle)"},{"p":"core","c":"VehiclesInteractor","l":"deleteVehicle(Integer)","url":"deleteVehicle(java.lang.Integer)"},{"p":"Models","c":"TimeTable","l":"direction"},{"p":"Models","c":"Direction","l":"Direction()","url":"%3Cinit%3E()"},{"p":"Models","c":"Direction","l":"Direction(int, ArrayList)","url":"%3Cinit%3E(int,java.util.ArrayList)"},{"p":"parsers","c":"XPathUtils","l":"doc"},{"p":"core","c":"Interactor","l":"document"},{"p":"Models","c":"TransportStation","l":"friendlyStationName"},{"p":"core","c":"StationsInteractor","l":"getAllStations()"},{"p":"core","c":"TimeTablesInteractor","l":"getAllTimeTables()"},{"p":"core","c":"VehiclesInteractor","l":"getAllVehicles()"},{"p":"Models","c":"StationsWrapper","l":"getArticles()"},{"p":"Models","c":"TimetablesWrapper","l":"getArticles()"},{"p":"Models","c":"VehiclesWrapper","l":"getArticles()"},{"p":"core","c":"Interactor","l":"getDocument()"},{"p":"core","c":"StationsInteractor","l":"getStation(Integer)","url":"getStation(java.lang.Integer)"},{"p":"core","c":"TimeTablesInteractor","l":"getTimeTable(Integer)","url":"getTimeTable(java.lang.Integer)"},{"p":"core","c":"VehiclesInteractor","l":"getVehicle(Integer)","url":"getVehicle(java.lang.Integer)"},{"p":"Models","c":"TransportStation","l":"gmaps_links"},{"p":"Models","c":"TransportStation","l":"info_comments"},{"p":"core","c":"Interactor","l":"Interactor(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"Models","c":"TransportStation","l":"is_invalid"},{"p":"","c":"STPTMain","l":"IterateNodeList(NodeList)","url":"IterateNodeList(org.w3c.dom.NodeList)"},{"p":"Models","c":"TransportStation","l":"junctionName"},{"p":"Models","c":"TransportStation","l":"lat"},{"p":"Models","c":"TransportStation","l":"lineID"},{"p":"Models","c":"TransportStation","l":"lineName"},{"p":"Models","c":"TransportStation","l":"longitude"},{"p":"","c":"STPTMain","l":"main(String[])","url":"main(java.lang.String[])"},{"p":"","c":"MainApp","l":"MainApp()","url":"%3Cinit%3E()"},{"p":"parsers","c":"ParserUtils","l":"parseJAXB()"},{"p":"parsers","c":"ParserUtils","l":"ParserUtils(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"parsers","c":"ParserUtils","l":"path_to_doc"},{"p":"core","c":"Interactor","l":"prettyPrintNode(Node)","url":"prettyPrintNode(org.w3c.dom.Node)"},{"p":"core","c":"Interactor","l":"prettyPrintNodeList(NodeList)","url":"prettyPrintNodeList(org.w3c.dom.NodeList)"},{"p":"parsers","c":"XPathUtils","l":"printNodes(NodeList)","url":"printNodes(org.w3c.dom.NodeList)"},{"p":"core","c":"Interactor","l":"putils"},{"p":"parsers","c":"XPathUtils","l":"QueryXPath(String)","url":"QueryXPath(java.lang.String)"},{"p":"parsers","c":"XPathUtils","l":"QueryXPathString(String)","url":"QueryXPathString(java.lang.String)"},{"p":"Models","c":"TransportStation","l":"rawStationName"},{"p":"core","c":"VehiclesInteractor","l":"replaceVehicle(Integer, Vehicle)","url":"replaceVehicle(java.lang.Integer,Models.Vehicle)"},{"p":"parsers","c":"ParserUtils","l":"SaveDoc(Document, String)","url":"SaveDoc(org.w3c.dom.Document,java.lang.String)"},{"p":"core","c":"Interactor","l":"SaveDocument(String)","url":"SaveDocument(java.lang.String)"},{"p":"Models","c":"TimetablesWrapper","l":"setArticles(List)","url":"setArticles(java.util.List)"},{"p":"Models","c":"StationsWrapper","l":"setArticles(List)","url":"setArticles(java.util.List)"},{"p":"Models","c":"VehiclesWrapper","l":"setArticles(List)","url":"setArticles(java.util.List)"},{"p":"Models","c":"TransportStation","l":"shortStationName"},{"p":"Models","c":"Arrival","l":"station"},{"p":"Models","c":"TransportStation","l":"stationID"},{"p":"core","c":"StationsInteractor","l":"StationsInteractor(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"Models","c":"StationsWrapper","l":"StationsWrapper()","url":"%3Cinit%3E()"},{"p":"","c":"STPTMain","l":"STPTMain()","url":"%3Cinit%3E()"},{"p":"Models","c":"Arrival","l":"time"},{"p":"Models","c":"Time","l":"time"},{"p":"Models","c":"Time","l":"Time()","url":"%3Cinit%3E()"},{"p":"Models","c":"Time","l":"Time(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"Models","c":"TimeTable","l":"TimeTable()","url":"%3Cinit%3E()"},{"p":"core","c":"TimeTablesInteractor","l":"TimeTablesInteractor(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"Models","c":"TimetablesWrapper","l":"TimetablesWrapper()","url":"%3Cinit%3E()"},{"p":"Models","c":"Arrival","l":"toString()"},{"p":"Models","c":"Time","l":"toString()"},{"p":"Models","c":"TransportStation","l":"toString()"},{"p":"Models","c":"Vehicle","l":"toString()"},{"p":"Models","c":"TransportStation","l":"TransportStation()","url":"%3Cinit%3E()"},{"p":"Models","c":"TransportStation","l":"TransportStation(int, String, int, String, String, String, String, double, double, Boolean, String, String, String, String)","url":"%3Cinit%3E(int,java.lang.String,int,java.lang.String,java.lang.String,java.lang.String,java.lang.String,double,double,java.lang.Boolean,java.lang.String,java.lang.String,java.lang.String,java.lang.String)"},{"p":"Models","c":"TransportStation","l":"TransportStation(int)","url":"%3Cinit%3E(int)"},{"p":"Models","c":"Vehicle","l":"Vehicle()","url":"%3Cinit%3E()"},{"p":"Models","c":"Vehicle","l":"Vehicle(int, String, String)","url":"%3Cinit%3E(int,java.lang.String,java.lang.String)"},{"p":"Models","c":"TimeTable","l":"vehicleID"},{"p":"Models","c":"Vehicle","l":"vehicleID"},{"p":"Models","c":"Vehicle","l":"vehicleName"},{"p":"core","c":"VehiclesInteractor","l":"VehiclesInteractor(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"Models","c":"VehiclesWrapper","l":"VehiclesWrapper()","url":"%3Cinit%3E()"},{"p":"Models","c":"Vehicle","l":"vehicleType"},{"p":"Models","c":"TransportStation","l":"verification_date"},{"p":"Models","c":"TransportStation","l":"verified"},{"p":"Models","c":"Direction","l":"way"},{"p":"parsers","c":"XPathUtils","l":"XPathUtils(Document)","url":"%3Cinit%3E(org.w3c.dom.Document)"},{"p":"parsers","c":"XPathUtils","l":"XPathUtils(Marshaller, StationsWrapper)","url":"%3Cinit%3E(javax.xml.bind.Marshaller,Models.StationsWrapper)"},{"p":"core","c":"Interactor","l":"xputils"}] \ No newline at end of file +memberSearchIndex = [{"p":"Models","c":"Arrival","l":"Arrival()","url":"%3Cinit%3E()"},{"p":"Models","c":"Arrival","l":"Arrival(TransportStation, Time)","url":"%3Cinit%3E(Models.TransportStation,Models.Time)"},{"p":"Models","c":"Direction","l":"arrivals"},{"p":"CamelComponents","c":"CamelREST","l":"CamelREST()","url":"%3Cinit%3E()"},{"p":"CamelComponents","c":"CamelREST","l":"configure()"},{"p":"core","c":"TimeTablesInteractor","l":"createArrival(int, String, Time)","url":"createArrival(int,java.lang.String,Models.Time)"},{"p":"core","c":"TimeTablesInteractor","l":"createDirection(Integer, ArrayList)","url":"createDirection(java.lang.Integer,java.util.ArrayList)"},{"p":"core","c":"StationsInteractor","l":"createStation(Integer, int, String, int, String, String, String, String, double, double, Boolean, String, String, String, String)","url":"createStation(java.lang.Integer,int,java.lang.String,int,java.lang.String,java.lang.String,java.lang.String,java.lang.String,double,double,java.lang.Boolean,java.lang.String,java.lang.String,java.lang.String,java.lang.String)"},{"p":"core","c":"StationsInteractor","l":"createStation(TransportStation)","url":"createStation(Models.TransportStation)"},{"p":"core","c":"TimeTablesInteractor","l":"createTimeTable(int, ArrayList)","url":"createTimeTable(int,java.util.ArrayList)"},{"p":"core","c":"TimeTablesInteractor","l":"createTimeTable(TimeTable)","url":"createTimeTable(Models.TimeTable)"},{"p":"core","c":"VehiclesInteractor","l":"createVehicle(Integer, String, String)","url":"createVehicle(java.lang.Integer,java.lang.String,java.lang.String)"},{"p":"core","c":"VehiclesInteractor","l":"createVehicle(Vehicle)","url":"createVehicle(Models.Vehicle)"},{"p":"core","c":"StationsInteractor","l":"deleteStation(Integer)","url":"deleteStation(java.lang.Integer)"},{"p":"core","c":"TimeTablesInteractor","l":"deleteTimeTable(Integer)","url":"deleteTimeTable(java.lang.Integer)"},{"p":"core","c":"VehiclesInteractor","l":"deleteVehicle(Integer)","url":"deleteVehicle(java.lang.Integer)"},{"p":"Models","c":"TimeTable","l":"direction"},{"p":"Models","c":"Direction","l":"Direction()","url":"%3Cinit%3E()"},{"p":"Models","c":"Direction","l":"Direction(int, ArrayList)","url":"%3Cinit%3E(int,java.util.ArrayList)"},{"p":"parsers","c":"XPathUtils","l":"doc"},{"p":"core","c":"Interactor","l":"document"},{"p":"Models","c":"TransportStation","l":"friendlyStationName"},{"p":"core","c":"StationsInteractor","l":"getAllStations()"},{"p":"core","c":"TimeTablesInteractor","l":"getAllTimeTables()"},{"p":"core","c":"VehiclesInteractor","l":"getAllVehicles()"},{"p":"Models","c":"StationsWrapper","l":"getArticles()"},{"p":"Models","c":"TimetablesWrapper","l":"getArticles()"},{"p":"Models","c":"VehiclesWrapper","l":"getArticles()"},{"p":"core","c":"Interactor","l":"getDocument()"},{"p":"core","c":"StationsInteractor","l":"getStation(Integer)","url":"getStation(java.lang.Integer)"},{"p":"core","c":"TimeTablesInteractor","l":"getTimeTable(Integer)","url":"getTimeTable(java.lang.Integer)"},{"p":"core","c":"VehiclesInteractor","l":"getVehicle(Integer)","url":"getVehicle(java.lang.Integer)"},{"p":"Models","c":"TransportStation","l":"gmaps_links"},{"p":"Models","c":"TransportStation","l":"info_comments"},{"p":"core","c":"Interactor","l":"Interactor(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"Models","c":"TransportStation","l":"is_invalid"},{"p":"","c":"STPTMain","l":"IterateNodeList(NodeList)","url":"IterateNodeList(org.w3c.dom.NodeList)"},{"p":"Models","c":"TransportStation","l":"junctionName"},{"p":"Models","c":"TransportStation","l":"lat"},{"p":"Models","c":"TransportStation","l":"lineID"},{"p":"Models","c":"TransportStation","l":"lineName"},{"p":"Models","c":"TransportStation","l":"longitude"},{"p":"","c":"STPTMain","l":"main(String[])","url":"main(java.lang.String[])"},{"p":"","c":"MainApp","l":"MainApp()","url":"%3Cinit%3E()"},{"p":"parsers","c":"ParserUtils","l":"parseJAXB()"},{"p":"parsers","c":"ParserUtils","l":"ParserUtils(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"parsers","c":"ParserUtils","l":"path_to_doc"},{"p":"core","c":"Interactor","l":"prettyPrintNode(Node)","url":"prettyPrintNode(org.w3c.dom.Node)"},{"p":"core","c":"Interactor","l":"prettyPrintNodeList(NodeList)","url":"prettyPrintNodeList(org.w3c.dom.NodeList)"},{"p":"parsers","c":"XPathUtils","l":"printNodes(NodeList)","url":"printNodes(org.w3c.dom.NodeList)"},{"p":"core","c":"Interactor","l":"putils"},{"p":"parsers","c":"XPathUtils","l":"QueryXPath(String)","url":"QueryXPath(java.lang.String)"},{"p":"parsers","c":"XPathUtils","l":"QueryXPathString(String)","url":"QueryXPathString(java.lang.String)"},{"p":"Models","c":"TransportStation","l":"rawStationName"},{"p":"core","c":"StationsInteractor","l":"replaceStation(Integer, TransportStation)","url":"replaceStation(java.lang.Integer,Models.TransportStation)"},{"p":"core","c":"TimeTablesInteractor","l":"replaceTimeTable(Integer, TimeTable)","url":"replaceTimeTable(java.lang.Integer,Models.TimeTable)"},{"p":"core","c":"VehiclesInteractor","l":"replaceVehicle(Integer, Vehicle)","url":"replaceVehicle(java.lang.Integer,Models.Vehicle)"},{"p":"parsers","c":"ParserUtils","l":"SaveDoc(Document, String)","url":"SaveDoc(org.w3c.dom.Document,java.lang.String)"},{"p":"core","c":"Interactor","l":"SaveDocument(String)","url":"SaveDocument(java.lang.String)"},{"p":"Models","c":"TimetablesWrapper","l":"setArticles(List)","url":"setArticles(java.util.List)"},{"p":"Models","c":"StationsWrapper","l":"setArticles(List)","url":"setArticles(java.util.List)"},{"p":"Models","c":"VehiclesWrapper","l":"setArticles(List)","url":"setArticles(java.util.List)"},{"p":"Models","c":"TransportStation","l":"shortStationName"},{"p":"Models","c":"Arrival","l":"station"},{"p":"Models","c":"TransportStation","l":"stationID"},{"p":"core","c":"StationsInteractor","l":"StationsInteractor(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"Models","c":"StationsWrapper","l":"StationsWrapper()","url":"%3Cinit%3E()"},{"p":"","c":"STPTMain","l":"STPTMain()","url":"%3Cinit%3E()"},{"p":"Models","c":"Arrival","l":"time"},{"p":"Models","c":"Time","l":"time"},{"p":"Models","c":"Time","l":"Time()","url":"%3Cinit%3E()"},{"p":"Models","c":"Time","l":"Time(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"Models","c":"TimeTable","l":"TimeTable()","url":"%3Cinit%3E()"},{"p":"core","c":"TimeTablesInteractor","l":"TimeTablesInteractor(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"Models","c":"TimetablesWrapper","l":"TimetablesWrapper()","url":"%3Cinit%3E()"},{"p":"Models","c":"Arrival","l":"toString()"},{"p":"Models","c":"Time","l":"toString()"},{"p":"Models","c":"TransportStation","l":"toString()"},{"p":"Models","c":"Vehicle","l":"toString()"},{"p":"Models","c":"TransportStation","l":"TransportStation()","url":"%3Cinit%3E()"},{"p":"Models","c":"TransportStation","l":"TransportStation(int, String, int, String, String, String, String, double, double, Boolean, String, String, String, String)","url":"%3Cinit%3E(int,java.lang.String,int,java.lang.String,java.lang.String,java.lang.String,java.lang.String,double,double,java.lang.Boolean,java.lang.String,java.lang.String,java.lang.String,java.lang.String)"},{"p":"Models","c":"TransportStation","l":"TransportStation(int)","url":"%3Cinit%3E(int)"},{"p":"Models","c":"Vehicle","l":"Vehicle()","url":"%3Cinit%3E()"},{"p":"Models","c":"Vehicle","l":"Vehicle(int, String, String)","url":"%3Cinit%3E(int,java.lang.String,java.lang.String)"},{"p":"Models","c":"TimeTable","l":"vehicleID"},{"p":"Models","c":"Vehicle","l":"vehicleID"},{"p":"Models","c":"Vehicle","l":"vehicleName"},{"p":"core","c":"VehiclesInteractor","l":"VehiclesInteractor(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"Models","c":"VehiclesWrapper","l":"VehiclesWrapper()","url":"%3Cinit%3E()"},{"p":"Models","c":"Vehicle","l":"vehicleType"},{"p":"Models","c":"TransportStation","l":"verification_date"},{"p":"Models","c":"TransportStation","l":"verified"},{"p":"Models","c":"Direction","l":"way"},{"p":"parsers","c":"XPathUtils","l":"XPathUtils(Document)","url":"%3Cinit%3E(org.w3c.dom.Document)"},{"p":"parsers","c":"XPathUtils","l":"XPathUtils(Marshaller, StationsWrapper)","url":"%3Cinit%3E(javax.xml.bind.Marshaller,Models.StationsWrapper)"},{"p":"core","c":"Interactor","l":"xputils"}] \ No newline at end of file diff --git a/doc/overview-summary.html b/doc/overview-summary.html index bb44845..3b66033 100644 --- a/doc/overview-summary.html +++ b/doc/overview-summary.html @@ -2,7 +2,7 @@ - + Generated Documentation (Untitled) diff --git a/doc/overview-tree.html b/doc/overview-tree.html index adcaeb2..0423409 100644 --- a/doc/overview-tree.html +++ b/doc/overview-tree.html @@ -2,7 +2,7 @@ - + Class Hierarchy diff --git a/doc/package-summary.html b/doc/package-summary.html index 247f527..10bfc84 100644 --- a/doc/package-summary.html +++ b/doc/package-summary.html @@ -2,7 +2,7 @@ - + <Unnamed> diff --git a/doc/package-tree.html b/doc/package-tree.html index 07bdd9c..1867f1b 100644 --- a/doc/package-tree.html +++ b/doc/package-tree.html @@ -2,7 +2,7 @@ - + Class Hierarchy diff --git a/doc/parsers/ParserUtils.html b/doc/parsers/ParserUtils.html index 2282a9e..0de2c02 100644 --- a/doc/parsers/ParserUtils.html +++ b/doc/parsers/ParserUtils.html @@ -2,7 +2,7 @@ - + ParserUtils diff --git a/doc/parsers/XPathUtils.html b/doc/parsers/XPathUtils.html index 731039a..2a4d191 100644 --- a/doc/parsers/XPathUtils.html +++ b/doc/parsers/XPathUtils.html @@ -2,7 +2,7 @@ - + XPathUtils @@ -221,7 +221,7 @@

Method Summary

java.util.ArrayList<java.lang.String> QueryXPathString​(java.lang.String query) -
Method which, given a query in the form of a String object, generates a ArrayList of responses using +
Method which, given a query in the form of a String object, generates a ArrayList of responses using XPath.
@@ -310,13 +310,13 @@

Method Detail

QueryXPathString

public java.util.ArrayList<java.lang.String> QueryXPathString​(java.lang.String query)
                                                        throws javax.xml.xpath.XPathExpressionException
-
Method which, given a query in the form of a String object, generates a ArrayList of responses using +
Method which, given a query in the form of a String object, generates a ArrayList of responses using XPath.
Parameters:
-
query - Query which will be used for generating the ArrayList results.
+
query - Query which will be used for generating the ArrayList results.
Returns:
-
ArrayList Results of the given query.
+
ArrayList Results of the given query.
Throws:
javax.xml.xpath.XPathExpressionException - @see XPathExpressionException
@@ -333,7 +333,7 @@

QueryXPath

Method which, given a query in the form of a String object, generates a NodeList of responses using XPath.
Parameters:
-
query - Query which will be used for generating the ArrayList results.
+
query - Query which will be used for generating the ArrayList results.
Returns:
NodeList Results of the given query.
Throws:
diff --git a/doc/parsers/package-summary.html b/doc/parsers/package-summary.html index b0cc598..85f12d8 100644 --- a/doc/parsers/package-summary.html +++ b/doc/parsers/package-summary.html @@ -2,7 +2,7 @@ - + parsers diff --git a/doc/parsers/package-tree.html b/doc/parsers/package-tree.html index 8e10b4d..455fe4f 100644 --- a/doc/parsers/package-tree.html +++ b/doc/parsers/package-tree.html @@ -2,7 +2,7 @@ - + parsers Class Hierarchy diff --git a/src/main/java/core/VehiclesInteractor.java b/src/main/java/core/VehiclesInteractor.java index 53b80d1..e88cf93 100644 --- a/src/main/java/core/VehiclesInteractor.java +++ b/src/main/java/core/VehiclesInteractor.java @@ -12,13 +12,41 @@ /** * Class which holds the implementation for interacting with a vehicle object. + * + * A vehicle element of of the following structure in the XML: + * + * {@code + * M42 + * Bus + * } + * + * Using the VehiclesInteractor class we can operate on such elements by parsing the XML document and using the + * XPathUtils class to query, delete, edit and add. */ public class VehiclesInteractor extends Interactor { + /** + * Constructor of the VehiclesInteractor class, which calls the parent class for creating the marshalled XML + * document. + * @param path_to_doc Path to the XML document which will be used by the interactor. + * @throws JAXBException @see JAXBException + * @throws ParserConfigurationException @see ParserConfigurationException + */ public VehiclesInteractor(String path_to_doc) throws JAXBException, ParserConfigurationException { super(path_to_doc); } + /** + * Method which is used for creating a new element of the type vehicle. + * + * This is achieved by using XPath for finding where to place the new vehicle element, and creating it based on the + * passed parameters. After creation, we append the new Element to the parent. + * @param new_id Integer: Id of the vehicle to be added. Example: 3306 + * @param vehicleName String: Name of the vehicle to be added. Example: M42 + * @param vehicleType String: Type of the vehicle to be added. Example: Bus + * @return Returns a Node object which represents the newly added vehicle element. + * @throws XPathExpressionException @see XPathExpressionException + */ public Node createVehicle(Integer new_id, String vehicleName, String vehicleType) throws XPathExpressionException { // get last vehicle ID, create a new node and add it to it's parent Element last_vehicle = (Element) (xputils.QueryXPath("//timetable[not(@vehicle_id <= preceding-sibling::timetable/@vehicle_id) and not(@vehicle_id <=following-sibling::timetable/@vehicle_id)]").item(0)); @@ -41,19 +69,59 @@ public Node createVehicle(Integer new_id, String vehicleName, String vehicleType return new_vehicle; } + /** + * Method for creating a new vehicle which is used by JAXB binding. + * @param v Vehicle: Vehicle element representing the new element to be added. + * @return Returns a Node element representing the newly added vehicle element. + * @throws XPathExpressionException @see XPathExpressionException + */ public Node createVehicle(Vehicle v) throws XPathExpressionException { return this.createVehicle(v.vehicleID, v.vehicleName, v.vehicleType); } + /** + * Method for querying for all available vehicles, taken from the parent XML document. + * + * The querying is done by passing the following xPath expression to the XPathUtils object: + * "/vehicles-root/vehicles/vehicle" + * + * @return NodeList: A list of Nodes representing all the matched elements found by the query. + * @throws XPathExpressionException @see XPathExpressionException + */ public NodeList getAllVehicles() throws XPathExpressionException { return xputils.QueryXPath("/vehicles-root/vehicles/vehicle"); } + /** + * Method for finding a vehicle based on a given id. + * + * The querying is done by passing the searched id in the following xPath expression, and passing the expression to + * the XPathUtils class: + * "//vehicle[@id=%s]" + * + * The vehicle whose id matches the required id will be returned. + * + * @param vehicle_id Integer: Searched vehicle id. + * @return Node: If the vehicle with the requested id has been found, it will be returned. + * @throws XPathExpressionException @see XPathExpressionException + */ public Node getVehicle(Integer vehicle_id) throws XPathExpressionException { return xputils.QueryXPath(String.format("//vehicle[@id=%s]", vehicle_id)).item(0); } + /** + * Method for deleting an element of type vehicle based on a given id. + * + * The querying to find the vehicle whose specific id is the requested one is done by passing the following xPath + * expression to the XPathUtils object: + * "//vehicle[@id=%s]" + * + * If the requested vehicle is found, it will be removed from its parent in the XML document. + * @param id Integer: id for finding the requested vehicle. + * @return Document: The XML document which has the requested vehicle deleted. + * @throws XPathExpressionException @see XPathExpressionException + */ public Document deleteVehicle(Integer id) throws XPathExpressionException { Element vehicle_to_delete = (Element) xputils.QueryXPath(String.format("//vehicle[@id=%s]", id)).item(0); vehicle_to_delete.getParentNode().removeChild(vehicle_to_delete); @@ -61,6 +129,17 @@ public Document deleteVehicle(Integer id) throws XPathExpressionException { return this.document; } + /** + * Method for replacing an element of type vehicle with a new Vehicle, based on a given id. + * + * The querying to find the requested vehicle to be replaced will be done by using the existent + * getVehicle(Integer id) method. If the vehicle is found, a new vehicle is created with the new requirements and + * the parent will now replace the old vehicle with the new one. + * @param id Integer: id for finding the requested vehicle. + * @param vehicle Vehicle: Replacement for the old vehicle element. + * @return Document: The XML document which has the requested vehicle replaced. + * @throws XPathExpressionException @see XPathExpressionException + */ public Document replaceVehicle(Integer id, Vehicle vehicle) throws XPathExpressionException { Node node_to_replace = this.getVehicle(id); Node new_au = this.createVehicle(vehicle.vehicleID, vehicle.vehicleName, vehicle.vehicleType); diff --git a/src/main/java/parsers/XPathUtils.java b/src/main/java/parsers/XPathUtils.java index 0902df7..6227998 100644 --- a/src/main/java/parsers/XPathUtils.java +++ b/src/main/java/parsers/XPathUtils.java @@ -47,11 +47,11 @@ public XPathUtils(Marshaller marshaller, StationsWrapper data) { } /** - * Method which, given a query in the form of a String object, generates a ArrayList of responses using + * Method which, given a query in the form of a String object, generates a ArrayList of responses using * XPath. * - * @param query Query which will be used for generating the ArrayList results. - * @return ArrayList Results of the given query. + * @param query Query which will be used for generating the ArrayList results. + * @return ArrayList Results of the given query. * @throws XPathExpressionException @see XPathExpressionException */ public ArrayList QueryXPathString(String query) throws XPathExpressionException { @@ -82,7 +82,7 @@ public ArrayList QueryXPathString(String query) throws XPathExpressionEx /** * Method which, given a query in the form of a String object, generates a NodeList of responses using XPath. - * @param query Query which will be used for generating the ArrayList results. + * @param query Query which will be used for generating the ArrayList results. * @return NodeList Results of the given query. * @throws XPathExpressionException @see XPathExpressionException */