Package com.trifork.clj_ds

Examples of com.trifork.clj_ds.IPersistentMap


    bb.kill_x(reg);

    if (eq(getx(reg), t))
      return this;

    IPersistentMap new_xregs = xregs.assoc(reg, t);
    return new TypeMap(new_xregs, yregs, fregs, stacksize, bb, exh);
  }
View Full Code Here


  protected void insert_one(final ETuple value) {
    in_tx(new WithMap<Object>() {
      @Override
      protected Object run(IPersistentMap map) {
        EObject key = get_key(value);
        IPersistentMap new_map = map.assoc(key, value);
        set(new_map);
        return null;
      }
    });
  }
View Full Code Here

    }
  }
 
  @Override
  public ESeq slot() {
    IPersistentMap map = deref();
    if (map.count() == 0) return ERT.NIL;
    ISeq seq = map.seq();
    return new ELSeq(seq);
  }
View Full Code Here

  @Override
  protected EObject last() {
    if (!ordered) { return first(); }
   
    // no need to run in_tx if we're only reading
    IPersistentMap map = deref();
   
    if (map.count() == 0) {
      return Native.am_$end_of_table;
    } else {
      ISeq entseq;
      try {
        entseq = ((Reversible)map).rseq();
View Full Code Here


  @Override
  protected EObject first() {
    // no need to run in_tx if we're only reading
    IPersistentMap map = deref();
   
    if (map.count() == 0) {
      return Native.am_$end_of_table;
    } else {
      ISeq entseq = map.seq();
      if (entseq == null) return Native.am_$end_of_table;
      IMapEntry ent = (IMapEntry) entseq.first();
      if (ent == null) return Native.am_$end_of_table;
      return (EObject) ent.getKey();
    }
View Full Code Here

    }
  }
 
  @Override
  public ESeq match(EPattern matcher) {   
    IPersistentMap map = deref();
    ESeq res = ERT.NIL;
   
    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

    return res;
  }
 
  @Override
  public ESeq match_object(EPattern matcher) {   
    IPersistentMap map = deref();
    ESeq res = ERT.NIL;
   
    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

  }
 
  @Override
  public EObject select(final EMatchSpec matcher, int limit) {
   
    IPersistentMap map = deref();
   
    EObject key = matcher.getTupleKey(keypos1);
   
    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

Related Classes of com.trifork.clj_ds.IPersistentMap

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.