Package com.trifork.clj_ds

Examples of com.trifork.clj_ds.IMapEntry


    private final ISeq coll;
    private final ISeq map_seq;

    ELSeq(ISeq map) {
      IMapEntry collent = (IMapEntry)map.first();
      IPersistentCollection c = (IPersistentCollection) collent.getValue();
     
      while (c.count() == 0) {
        map = map.next();
        collent = (IMapEntry) map.first();
        c = (IPersistentCollection) collent.getValue();
      }
     
      coll = c.seq();
      map_seq = map.next();
    }
View Full Code Here


      // oops, .. tablescan
      ESeq res = ERT.NIL;
     
      IPersistentMap map = deref();
      for (ISeq entseq = map.seq(); entseq != null; entseq = entseq.next()) {
        IMapEntry ent = (IMapEntry) entseq.first();

        if (ent == null) continue;
       
        Seqable coll = (Seqable)ent.getValue();
        res = matcher.match_vars(res, coll.seq());
      }
     
      return res.reverse();
    }
View Full Code Here

      // oops, .. tablescan
      ESeq res = ERT.NIL;
     
      IPersistentMap map = deref();
      for (ISeq entseq = map.seq(); entseq != null; entseq = entseq.next()) {
        IMapEntry ent = (IMapEntry) entseq.first();

        if (ent == null) break;
       
        Seqable coll = (Seqable)ent.getValue();
        res = matcher.match_members(res, coll.seq());
      }
     
      return res.reverse();
    }
View Full Code Here

      ISeq map_seq = map_ent;
      ISeq coll_seq = coll_ent;
      while ((seq_has_more(map_seq) || seq_has_more(coll_seq)) && (limit < 0 || count < limit)) {
       
        if (!seq_has_more(coll_seq)) {
          IMapEntry ent = (IMapEntry) map_seq.first();
          IPersistentCollection coll = (IPersistentCollection) ent.getValue();
          coll_seq = coll.seq();
          map_seq = map_seq.next();
        }
       
        assert seq_has_more(coll_seq);
View Full Code Here

      ESeq vals = ERT.NIL;
     
      ISeq map_seq = this.ent;
      while (seq_has_more(map_seq) && (limit < 0 || count < limit)) {
       
        IMapEntry mape = (IMapEntry) map_seq.first();
        map_seq = map_seq.next();
       
        ETuple candidate = (ETuple) mape.getValue();
        EObject res;
        if ((res = matcher.match(candidate)) != null) {
          count += 1;
          vals = vals.cons(res);
        }
View Full Code Here

      return null;
    }

    @Override
    public Object first() {
      IMapEntry elem_count_pair = (IMapEntry) pairs.first();
      return elem_count_pair.getKey();
    }
View Full Code Here

      return next;
    }

    @Override
    public ISeq next() {
      IMapEntry elem_count_pair = (IMapEntry) pairs.first();
      int count = (Integer) elem_count_pair.getValue();
      if (count == pos + 1) {
        ISeq succ = pairs.next();
        if (succ == null) {
          return null;
        } else {
View Full Code Here

        entseq = ((Reversible)map).rseq();
      } catch (Exception e) {
        throw new InternalError("cannot reverse");
      }
      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

    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
      protected Object run(IPersistentMap map) {
     
        EObject key = get_key(obj);
       
        IMapEntry candidateEntry = map.entryAt(key);
        if (candidateEntry == null) return null;
        EObject candidate = (EObject)candidateEntry.val();
        if (candidate != null && obj.equalsExactly(candidate)) {
          try {
            map = map.without(key);
            set(map);
          } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.trifork.clj_ds.IMapEntry

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.