Package com.trifork.clj_ds

Examples of com.trifork.clj_ds.IPersistentMap.valAt()


  /** return a list of elements at given key */
  @Override
  protected ESeq lookup(EObject key) {
    IPersistentMap ipm = deref();
    IPersistentCollection set = (IPersistentCollection) ipm.valAt(key);
    ESeq res = ERT.NIL;
    if (set == null) return res;
    for(ISeq s = set.seq(); s != null; s = s.next())
    {
      res = res.cons((EObject) s.first());
View Full Code Here


  }

  @Override
  protected EAtom member(EObject key) {
    IPersistentMap ipm = deref();
    IPersistentCollection set = (IPersistentCollection) ipm.valAt(key);
    if (set != null && set.count() != 0) {
      return ERT.TRUE;
    } else {
      return ERT.FALSE;
    }
View Full Code Here

     
      return res.reverse();
    }
   
    IPersistentMap map = deref();
    IPersistentCollection coll = (IPersistentCollection) map.valAt(key);
    if (coll == null) return ERT.NIL;
   
    return matcher.match_vars(ERT.NIL, coll.seq()).reverse();
  }
 
View Full Code Here

     
      return res.reverse();
    }
   
    IPersistentMap map = deref();
    IPersistentCollection coll = (IPersistentCollection) map.valAt(key);
    if (coll == null) return ERT.NIL;
   
    return matcher.match_members(ERT.NIL, coll.seq()).reverse();
  }
View Full Code Here

    if (key == null) {
      EBagCont cont0 = new EBagCont(matcher, map.seq(), null, limit);
      return cont0.select();
     
    } else {
      IPersistentCollection coll = (IPersistentCollection) map.valAt(key);
      if (coll == null) {
        return Native.am_$end_of_table;       
      } else {
        EBagCont cont0 = new EBagCont(matcher, null, coll.seq(), limit);
        return cont0.select();
View Full Code Here

    EObject key = matcher.getKey(keypos1);
    if (key == null) {
      res = matcher.match(res, (Map<EObject, ETuple>) map);
      if (ordered) res = res.reverse();
    } else {
      ETuple candidate = (ETuple) map.valAt(key);
      if (candidate != null) {
        res =  matcher.match(res, candidate);
      }
    }
   
View Full Code Here

    EObject key = matcher.getKey(keypos1);
    if (key == null) {
      res = matcher.match_members(res, (Map<EObject, ETuple>) map);
      if (ordered) res = res.reverse();
    } else {
      ETuple candidate = (ETuple) map.valAt(key);
      if (candidate != null) {
        res =  matcher.match_members(res, candidate);
      }
    }
   
View Full Code Here

    if (key == null) {
      ESetCont cont0 = new ESetCont(matcher, map.seq(), ordered, limit);
      return cont0.select();
     
    } else {
      ETuple candidate = (ETuple) map.valAt(key);
      if (candidate == null) return Native.am_$end_of_table;
      EObject res;
      if ((res = matcher.match(candidate)) != null) {
        return new ETuple2(ERT.NIL.cons(res), Native.am_$end_of_table);
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.