Package clojure.lang

Examples of clojure.lang.PersistentHashSet$TransientHashSet


        if (!(arg.respondsTo("intersection"))) throw context.getRuntime().newArgumentError("argument should be a set");
        IPersistentSet other = (IPersistentSet)DiametricUtils.getPersistentSet(context, arg);
        try {
            Var var = DiametricService.getFn("clojure.set", "intersection");
            if (set instanceof HashSet) {
                PersistentHashSet value = convertHashSetToPersistentHashSet(set);
                return DiametricUtils.convertJavaToRuby(context, var.invoke(value, other));
            } else {
                return DiametricUtils.convertJavaToRuby(context, var.invoke(set, other));
            }
        } catch (Throwable t) {
View Full Code Here


        if (!(arg.respondsTo("union"))) throw context.getRuntime().newArgumentError("argument should be a set");
        IPersistentSet other = (IPersistentSet)DiametricUtils.getPersistentSet(context, arg);
        try {
            Var var = DiametricService.getFn("clojure.set", "union");
            if (set instanceof HashSet) {
                PersistentHashSet value = convertHashSetToPersistentHashSet(set);
                return DiametricSet.getDiametricSet(context, (Set)var.invoke(value, other));
            } else {
                return DiametricSet.getDiametricSet(context, (Set)var.invoke(set, other));
            }
        } catch (Throwable t) {
View Full Code Here

        if (!(arg.respondsTo("difference"))) throw context.getRuntime().newArgumentError("argument should be a set");
        IPersistentSet other = (IPersistentSet)DiametricUtils.getPersistentSet(context, arg);
        try {
            Var var = DiametricService.getFn("clojure.set", "difference");
            if (set instanceof HashSet) {
                PersistentHashSet value = convertHashSetToPersistentHashSet(set);
                return DiametricSet.getDiametricSet(context, (Set)var.invoke(value, other));
            } else {
                return DiametricSet.getDiametricSet(context, (Set)var.invoke(set, other));
            }
        } catch (Throwable t) {
View Full Code Here

    if (t instanceof Value) {
      Value<?> ev=(Value<?>) t;
      return values.contains(ev.value);
    }
    if (t instanceof ValueSet) {
      @SuppressWarnings("rawtypes")
      PersistentHashSet tvs=((ValueSet) t).values;
      return tvs.containsAll(values);
    }

    return false;
  }
View Full Code Here

    return false;
  }
 
  @Override
  public Type intersection(Type t) {
    PersistentHashSet values=this.values;
    ISeq s=values.seq();
    while(s!=null) {
      Object o=s.first();
      if (!t.checkInstance(o)) {
        values=(PersistentHashSet) values.disjoin(o);
      }
      s=s.next();
    }
    return update(values);
  }
View Full Code Here

TOP

Related Classes of clojure.lang.PersistentHashSet$TransientHashSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.