Example #1
0
  /**
   * have a look at the two arrays, and find the common elements (brute force)
   *
   * @param a first array
   * @param b second array
   * @return the common elements
   */
  protected static PropertyDescriptor[] getIntersectionFor(
      final PropertyDescriptor[] a, final PropertyDescriptor[] b, final PropertyDescriptor[] demo) {
    final Vector<PropertyDescriptor> res = new Vector<PropertyDescriptor>();

    for (int cnta = 0; cnta < a.length; cnta++) {
      final PropertyDescriptor thisP = a[cnta];
      for (int cntb = 0; cntb < b.length; cntb++) {
        final PropertyDescriptor thatP = b[cntb];
        if (thisP.equals(thatP)) {
          res.add(thisP);
        }
      }
    }
    return res.toArray(demo);
  }