Examples of IPersistentMap


Examples of com.trifork.clj_ds.IPersistentMap

  @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

Examples of com.trifork.clj_ds.IPersistentMap


  @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

Examples of com.trifork.clj_ds.IPersistentMap

    }
  }
 
  @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

Examples of com.trifork.clj_ds.IPersistentMap

    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

Examples of com.trifork.clj_ds.IPersistentMap

  }
 
  @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

Examples of seph.lang.persistent.IPersistentMap

    @SephMethod
    public final static SephObject with(SephObject receiver, LexicalScope scope, SThread thread, String[] keywordNames, MethodHandle[] keywordArguments) {
        if(keywordNames.length == 0) {
            return receiver;
        } else {
            IPersistentMap args = PersistentArrayMap.EMPTY;
            try {
                for(int i = 0; i < keywordNames.length; i++) {
                    args = args.associate(keywordNames[i], (SephObject)keywordArguments[i].invokeExact(thread, scope, true, true));
                }
            } catch(Throwable e) {
                e.printStackTrace();
                return null;
            }
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.