Frames No Frames

  %method %block %branch %line
net.jaekl.frank.octranspo.StopInfo
100%(9/9)
83%(24/29)
64%(14/22)
100%(32/32)

hit count method name method modifiers method signature
1 <clinit> [static] void <clinit>()
5 <init> [public] void <init>(java.lang.String,java.lang.String[],java.lang.Object[][])
11 endContents [public] void endContents(java.lang.String,java.lang.String,java.lang.String,java.lang.String)
5 endExternal [public] void endExternal(java.lang.String,java.lang.String,java.lang.String)
5 getDescr [public] java.lang.String getDescr()
3 getError [public] java.lang.String getError()
7 getNumRoutes [public] int getNumRoutes()
6 getRoute [public] net.jaekl.frank.octranspo.Route getRoute(int)
5 getStopNo [public] int getStopNo()

 1  
 package net.jaekl.frank.octranspo;
 2  
 
 3  
 import java.util.ArrayList;
 4  
 
 5  
 import net.jaekl.qd.xml.ParseResult;
 6  
 import net.jaekl.qd.xml.XmlParseException;
 7  
 
 8  Block: 1/1 
 public class StopInfo extends ParseResult
 9  
 {
 10  
 	// potential child tag names
 11  Block: 1/1 
 	public static String STOP_NO = "StopNo";
 12  
 	public static String DESCRIPTION = "StopDescription";	// Present in RouteSummary
 13  
 	public static String STOP_LABEL = "StopLabel";			// What NextTrips calls StopDescription
 14  
 	public static String ERROR = "Error";
 15  
 	public static String ROUTES = "Routes";
 16  
 	public static String ROUTE = "Route";
 17  
 
 18  
 	// data returned inside our element
 19  
 	int m_stopNo;
 20  
 	String m_descr;
 21  
 	String m_error;
 22  
 	ArrayList<Route> m_routes;
 23  
 
 24  
 	// Constructor
 25  
 	public StopInfo(String rootTagName, String[] internal, Object[][] external) {
 26  Block: 1/1 
 		super(rootTagName, internal, external);
 27  
 
 28  
 		m_stopNo = 0;
 29  
 		m_descr = "";
 30  
 		m_error = "";
 31  
 		m_routes = new ArrayList<Route>();
 32  
 	}
 33  
 
 34  
 	// -----------------------------
 35  
 	// Public methods to access data
 36  
 
 37  Block: 1/1 
 	public int getStopNo() { return m_stopNo; }
 38  Block: 1/1 
 	public String getDescr() { return m_descr; }
 39  Block: 1/1 
 	public String getError() { return m_error; }
 40  Block: 1/1 
 	public int getNumRoutes() { return m_routes.size(); }
 41  Block: 1/1 
 	public Route getRoute(int idx) { return m_routes.get(idx); }
 42  
 
 43  
 	// --------------------------
 44  
 	// ParseResult implementation
 45  
 
 46  
 	@Override
 47  
 	public void endContents(String uri, String localName, String qName, String chars) throws XmlParseException
 48  
 	{
 49  Block: 1/1 
 		assert (null != localName);
 50  
 
 51  Block: 1/1 Branch: 1/2 
 		if (localName.equals(STOP_NO)) {
 52  Block: 1/1 Branch: 1/1 
 			m_stopNo = Integer.parseInt(chars);
 53  
 		}
 54  Block: 1/1 Branch: 1/1 
 		else if (localName.equals(DESCRIPTION) || localName.equals(STOP_LABEL)) {
 55  Block: 1/1 Branch: 2/2 
 			m_descr = chars;
 56  
 		}
 57  Block: 1/1 Branch: 1/1 
 		else if (localName.equals(ERROR)) {
 58  Block: 1/1 Branch: 1/1 
 			m_error = chars;
 59  
 		}
 60  Block: 1/1 Branch: 1/1 
 	}
 61  
 	
 62  
 	@Override
 63  
 	public void endExternal(String uri, String localName, String qName) throws XmlParseException
 64  
 	{
 65  Block: 1/1 
 		if (localName.equals(ROUTE)) {
 66  Block: 1/1 Branch: 1/1 
 			ParseResult[] collected = collectParsedChildren(Route.class);
 67  
 			for (ParseResult pr : collected) {
 68  Block: 1/1 Branch: 1/1 
 				assert (pr instanceof Route);
 69  Block: 1/1 Branch: 1/2 
 				m_routes.add((Route)pr);
 70  
 			}
 71  
 		}
 72  Block: 1/1 Branch: 1/2 
 	}
 73  
 	
 74  
 	
 75  
 }
 76  
 

Report generated 11/12/14 11:31 PM