Esempio n. 1
0
 /**
  * This returns a Product identifier from the product description return from a JDBC
  * getDatabaseProductName()
  */
 public static DatabaseProduct productFromProductDescription(String productDescription) {
   int size = DatabaseProductConstants.DB_SIZE;
   for (int i = 0; i < size; i++) {
     DatabaseProduct product = products[i];
     if (product != null) {
       if (product.matchesDescription(productDescription)) {
         return product;
       }
     }
   }
   ;
   return null;
 }
Esempio n. 2
0
 /**
  * This returns a Product identifier from the product description return from a JDBC
  * getDatabaseProductName()
  */
 public static int productCodeFromProductDescription(String productDescription) {
   DatabaseProduct product = productFromProductDescription(productDescription);
   if (product == null) return -1;
   return product.code();
 }
Esempio n. 3
0
 static void registerProduct(DatabaseProduct product) {
   products[product.code()] = product;
   keyToProduct.atKey_put(product.key(), product);
 }