Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.api.interop/src/com/oracle/truffle/api/interop/impl/ReadOnlyArrayList.java @ 22135:e70b20f4bb00
Implementing API for Java/Truffle interop. Based around JavaInterop.asJavaObject and JavaInterop.asTruffleObject methods. Connected to TruffleVM via Symbol.as(Class) wrapper. Verified by extended TCK.
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Mon, 07 Sep 2015 17:07:20 +0200 |
parents | 9c8c0937da41 |
children | fbe1eb7b4172 |
comparison
equal
deleted
inserted
replaced
22134:025869c88840 | 22135:e70b20f4bb00 |
---|---|
38 | 38 |
39 private ReadOnlyArrayList(T[] arr, int first, int last) { | 39 private ReadOnlyArrayList(T[] arr, int first, int last) { |
40 this.arr = arr; | 40 this.arr = arr; |
41 this.first = first; | 41 this.first = first; |
42 this.last = last; | 42 this.last = last; |
43 if (first > last) { | |
44 throw new IllegalArgumentException(); | |
45 } | |
43 } | 46 } |
44 | 47 |
45 public static <T> List<T> asList(T[] arr, int first, int last) { | 48 public static <T> List<T> asList(T[] arr, int first, int last) { |
46 return new ReadOnlyArrayList<>(arr, first, last); | 49 return new ReadOnlyArrayList<>(arr, first, last); |
47 } | 50 } |