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

Class EmptyList

src/jvm/clojure/lang/PersistentList.java:153–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151
152
153 static class EmptyList extends Obj implements IPersistentList, List, ISeq, Counted, IHashEq{
154 static final int hasheq = Murmur3.hashOrdered(Collections.EMPTY_LIST);
155
156 public int hashCode(){
157 return 1;
158 }
159
160 public int hasheq(){
161 return hasheq;
162 }
163
164 public String toString() {
165 return "()";
166 }
167
168 public boolean equals(Object o) {
169 return (o instanceof Sequential || o instanceof List) && RT.seq(o) == null;
170 }
171
172 public boolean equiv(Object o){
173 return equals(o);
174 }
175
176 EmptyList(IPersistentMap meta){
177 super(meta);
178 }
179
180 public Object first() {
181 return null;
182 }
183
184 public ISeq next() {
185 return null;
186 }
187
188 public ISeq more() {
189 return this;
190 }
191
192 public PersistentList cons(Object o){
193 return new PersistentList(meta(), o, null, 1);
194 }
195
196 public IPersistentCollection empty(){
197 return this;
198 }
199
200 public EmptyList withMeta(IPersistentMap meta){
201 if(meta != meta())
202 return new EmptyList(meta);
203 return this;
204 }
205
206 public Object peek(){
207 return null;
208 }
209
210 public IPersistentList pop(){

Callers

nothing calls this directly

Calls 1

hashOrderedMethod · 0.95

Tested by

no test coverage detected