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

Class AMapEntry

src/jvm/clojure/lang/AMapEntry.java:17–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15import java.io.StringWriter;
16
17public abstract class AMapEntry extends APersistentVector implements IMapEntry{
18
19private static final long serialVersionUID = -5007980429903443802L;
20
21public Object nth(int i){
22 if(i == 0)
23 return key();
24 else if(i == 1)
25 return val();
26 else
27 throw new IndexOutOfBoundsException();
28}
29
30private IPersistentVector asVector(){
31 return LazilyPersistentVector.createOwning(key(), val());
32}
33
34public IPersistentVector assocN(int i, Object val){
35 return asVector().assocN(i, val);
36}
37
38public int count(){
39 return 2;
40}
41
42public ISeq seq(){
43 return asVector().seq();
44}
45
46public IPersistentVector cons(Object o){
47 return asVector().cons(o);
48}
49
50public IPersistentCollection empty(){
51 return null;
52}
53
54public IPersistentStack pop(){
55 return LazilyPersistentVector.createOwning(key());
56}
57
58public Object setValue(Object value){
59 throw new UnsupportedOperationException();
60}
61
62/*
63
64public boolean equals(Object obj){
65 return APersistentVector.doEquals(this, obj);
66}
67
68public int hashCode(){
69 //must match logic in APersistentVector
70 return 31 * (31 + Util.hash(key())) + Util.hash(val());
71// return Util.hashCombine(Util.hashCombine(0, Util.hash(key())), Util.hash(val()));
72}
73
74public String toString(){

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected