sPFFramework/src/main/java/it/polimi/spf/framework/services/ActivityConsumerRouteTable.java
public Collection<ActivityVerb> getVerbSupport() {
		Map<String, ActivityVerb> entries = new HashMap<String, ActivityVerb>();

		String[] columns = { Contract.APP_ID, Contract.SERVICE_NAME, Contract.VERB };
		Cursor c = getReadableDatabase().query(true, Contract.TABLE_SERVICES, columns, null, null, null, null, null, null);

		int appIndex = c.getColumnIndexOrThrow(Contract.APP_ID);
		int verbIndex = c.getColumnIndexOrThrow(Contract.VERB);
		int svcIndex = c.getColumnIndexOrThrow(Contract.SERVICE_NAME);

		while (c.moveToNext()) {
			String verb = c.getString(verbIndex);
			String appId = c.getString(appIndex);
			String svcName = c.getString(svcIndex);

			ActivityVerb d = entries.get(verb);
			if (d == null) {
				d = new ActivityVerb(verb);
				entries.put(verb, d);
			}

			d.addSupportingService(new ServiceIdentifier(appId, svcName));
		}

		c.close();

		for (ActivityVerb d : entries.values()) {
			d.setDefaultApp(getServiceForInternal(d.getVerb()));
		}

		return entries.values();
	}
public Collection<ActivityVerb> getVerbSupport() {
		Map<String, ActivityVerb> entries = new HashMap<String, ActivityVerb>();

		String[] columns = { Contract.APP_ID, Contract.SERVICE_NAME, Contract.VERB };
		Cursor c = getReadableDatabase().query(true, Contract.TABLE_SERVICES, columns, null, null, null, null, null, null);

		int appIndex = c.getColumnIndexOrThrow(Contract.APP_ID);
		int verbIndex = c.getColumnIndexOrThrow(Contract.VERB);
		int svcIndex = c.getColumnIndexOrThrow(Contract.SERVICE_NAME);

		while (c.moveToNext()) {
			String verb = c.getString(verbIndex);
			String appId = c.getString(appIndex);
			String svcName = c.getString(svcIndex);

			ActivityVerb d = entries.get(verb);
			if (d == null) {
				d = new ActivityVerb(verb);
				entries.put(verb, d);
			}

			d.addSupportingService(new ServiceIdentifier(appId, svcName));
		}

		c.close();

		for (ActivityVerb d : entries.values()) {
			d.setDefaultApp(getServiceForInternal(d.getVerb()));
		}

		return entries.values();
	}
public Collection < ActivityVerb > getVerbSupport ( ) { Map < String , ActivityVerb > entries = new HashMap < String , ActivityVerb > ( ) ; String [ ] columns = { Contract . APP_ID , Contract . SERVICE_NAME , Contract . VERB } ; Cursor c = getReadableDatabase ( ) . query ( true , Contract . TABLE_SERVICES , columns , null , null , null , null , null , null ) ; int appIndex = c . getColumnIndexOrThrow ( Contract . APP_ID ) ; int verbIndex = c . getColumnIndexOrThrow ( Contract . VERB ) ; int svcIndex = c . getColumnIndexOrThrow ( Contract . SERVICE_NAME ) ; while ( c . moveToNext ( ) ) { String verb = c . getString ( verbIndex ) ; String appId = c . getString ( appIndex ) ; String svcName = c . getString ( svcIndex ) ; ActivityVerb d = entries . get ( verb ) ; if ( d == null ) { d = new ActivityVerb ( verb ) ; entries . put ( verb , d ) ; } d . addSupportingService ( new ServiceIdentifier ( appId , svcName ) ) ; } c . close ( ) ; for ( ActivityVerb d : entries . values ( ) ) { d . setDefaultApp ( getServiceForInternal ( d . getVerb ( ) ) ) ; } return entries . values ( ) ; }
Returns a list containing the default service for each verb, as an
instance of {@link ActivityVerb}

@return - the list of {@link ActivityVerb}
Returns a list containing the default service for each verb as an instance of { @link ActivityVerb }