MCPcopy Index your code
hub / github.com/clojure/clojure / ASeq

Class ASeq

src/jvm/clojure/lang/ASeq.java:16–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14import java.util.*;
15
16public abstract class ASeq extends Obj implements ISeq, Sequential, List, Serializable, IHashEq {
17
18private static final long serialVersionUID = 4748650717905139299L;
19
20transient int _hash;
21transient int _hasheq;
22
23public String toString(){
24 return RT.printString(this);
25}
26
27public IPersistentCollection empty(){
28 return PersistentList.EMPTY;
29}
30
31protected ASeq(IPersistentMap meta){
32 super(meta);
33}
34
35
36protected ASeq(){
37}
38
39public boolean equiv(Object obj){
40
41 if(!(obj instanceof Sequential || obj instanceof List))
42 return false;
43
44 if(this instanceof Counted && obj instanceof Counted &&
45 ((Counted)this).count() != ((Counted)obj).count())
46 return false;
47
48 ISeq ms = RT.seq(obj);
49 for(ISeq s = seq(); s != null; s = s.next(), ms = ms.next())
50 {
51 if(ms == null || !Util.equiv(s.first(), ms.first()))
52 return false;
53 }
54 return ms == null;
55
56}
57
58public boolean equals(Object obj){
59 if(this == obj) return true;
60 if(!(obj instanceof Sequential || obj instanceof List))
61 return false;
62 ISeq ms = RT.seq(obj);
63 for(ISeq s = seq(); s != null; s = s.next(), ms = ms.next())
64 {
65 if(ms == null || !Util.equals(s.first(), ms.first()))
66 return false;
67 }
68 return ms == null;
69
70}
71
72public int hashCode(){
73 if(_hash == 0)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected