判断List是否包含某元素Job

static boolean listIn(List list,
           anyType element)
{

  boolean   ret = false;
  ListEnumerator listE = list.getEnumerator();
  ;
  if (list.typeId() != typeof(element))
    ret = false;
  else
  {
    while (listE.moveNext())
    {
      if (listE.current() == element)
        ret = true;
    }

  } 

  return ret;

}

posted @ 2019-10-26 16:24  学习是进步的阶梯  阅读(362)  评论(0编辑  收藏  举报