/** * 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; }
/** * 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(); }
static void registerProduct(DatabaseProduct product) { products[product.code()] = product; keyToProduct.atKey_put(product.key(), product); }