code: synchronized Link[] clearLinks() {
          Link[] ret = null;
          if (count != 0) {
              ret = new Link[count];
              for (int i = 0; i < count; i++) {
                  ret[i] = links[i];
                  links[i] = null;
              }
              count = 0;
          }
          return ret;
      }
docs: /* clears the link table, returns a copy