code: private void addObjectIfNotFound(Object obj, Vector v)
    {
  
      int n = v.size();
      boolean addIt = true;
  
      for (int i = 0; i < n; i++)
      {
        if (v.elementAt(i) == obj)
        {
          addIt = false;
  
          break;
        }
      }
  
      if (addIt)
      {
        v.addElement(obj);
      }
    }
docs: Add object to vector if not already there.
  
  @param obj
  @param v