MutableArray.jet 425 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
/**
  These declarations are "shallow" in the sense that they are not really compiled, only the type-checker uses them
*/

virtual class ReadOnlyArray<out T> : ISized {
  [operator] fun get(index : Int) : T
}

virtual class WriteOnlyArray<in T> : ISized { // This is needed to keep IIterator's <T> covariant
  [operator] fun set(index : Int, value : T)
}

class MutableArray<T> : ReadOnlyArray<T>, WriteOnlyArray<T> {/*...*/}