Package com.trifork.clj_ds

Examples of com.trifork.clj_ds.ISeq


      return new EList(h, this);
    }

    @Override
    public ESeq tail() {
      ISeq c2 = coll.next();
      if (c2 == null) {
        if (map_seq == null || map_seq == map_seq.empty()) return ERT.NIL;
       
        return new ELSeq(map_seq);
      } else {
View Full Code Here


    IPersistentMap map = deref();
   
    if (map.count() == 0) {
      return Native.am_$end_of_table;
    } else {
      ISeq entseq = map.seq();
      IMapEntry<EObject, EObject> ent = (IMapEntry<EObject, EObject>) entseq.first();
      return (EObject) ent.getKey();
    }
  }
View Full Code Here

 
    public EObject select() {
      int count = 0;
      ESeq vals = ERT.NIL;
     
      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);
       
        ETuple candidate = (ETuple) coll_seq.first();
        coll_seq = coll_seq.next();
       
        EObject res;
        if ((res = matcher.match(candidate)) != null) {
          count += 1;
          vals = vals.cons(res);
View Full Code Here

 
    public EObject select() {
      int count = 0;
      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;
View Full Code Here

      return elem_count_pair.getKey();
    }

    @Override
    public ISeq more() {
      ISeq next = next();
      if (next == null)
        return PersistentList.EMPTY;
      return next;
    }
View Full Code Here

    @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 {
          return new ElemSeq(succ, 0, total-1);
        }
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

    IPersistentMap map = deref();
   
    if (map.count() == 0) {
      return Native.am_$end_of_table;
    } else {
      ISeq entseq;
      try {
        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

    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

      return new EList(h, this);
    }

    @Override
    public ESeq tail() {
      ISeq next = seq.next();
      if (next == null) return ERT.NIL;
      return new ELSeq(next);
    }
View Full Code Here

TOP

Related Classes of com.trifork.clj_ds.ISeq

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.