Пример #1
0
bool Merch::getField(KeyedItem& target) const
{
    try
    {
        info.searchTreeRetrive(target.getKey(), target);
    }
    catch (TreeException e)
    {
        cout << "ERROR: Could not find field ";
        target.getItem()->display();
        cout << " in item " << searchKey << endl;
        return false;   // Desired field does not exist in this Merchandise
    } // end try

    return true;
} // end getField(KeyedItem&)
Пример #2
0
 bool leftTreeProperty(TreeNode* t, KeyedItem k)
 {
   return t == NULL ||
          ( t->item.getKey() < k.getKey() &&
           leftTreeProperty(t->leftChildPtr, t->item.getKey()) &&
           rightTreeProperty(t->rightChildPtr, t->item.getKey()));
 }
Пример #3
0
void Merch::setField(const KeyedItem& newValue)
{
    try
    {
        info.searchTreeInsert(newValue);
    }
    catch (TreeException e)
    {
        cout << "ERROR: Could not set field ";
        newValue.getItem()->display();
        cout << " in item " << searchKey << endl;
    } // end try
} // end setField()