FileDocCategorySizeDatePackage
ComInfoService.javaAPI DocApache Axis 1.41638Sat Apr 22 18:56:52 BST 2006samples.stock

ComInfoService

public class ComInfoService extends Object
author
Doug Davis (dug@us.ibm.com)

Fields Summary
Constructors Summary
Methods Summary
public java.lang.StringgetInfo(java.lang.String symbol, java.lang.String dataType)

    int        i, j ;
    String[]   types = { "symbol", "name", "address" };
    String[][] data = { {"IBM", 
                         "International Business Machines",
                          "Armonk, NY" },

                         {"MACR",
                          "Macromedia",
                          "Newton, MA" },

                         {"CSCO", 
                          "Cisco Systems", 
                          "San Jose, CA" } };

    for ( i = 0 ; i < types.length ; i++ )
      if ( types[i].equals( dataType ) ) break ;

    if ( i == types.length )
      return( "Unknown dataType: " + dataType );

    for ( j = 0 ; j < data.length ; j++ )
      if ( data[j][0].equals( symbol ) ) break ;

    if ( j == data.length )
      return( "Unknown symbol: " + symbol );
    
    return( data[j][i] );