/** * Gets the indicated element. It is an error to call this with the * index for an element which was never set; if you do that, this * will throw {@code NullPointerException}. * * @param n {@code >= 0, < size();} which element * @return {@code non-null;} the indicated element */ public RegisterSpec get(int n) { return (RegisterSpec) get0(n); }
/** * Gets the indicated element. It is an error to call this with the * index for an element which was never set; if you do that, this * will throw {@code NullPointerException}. * * @param n {@code >= 0, < size();} which element * @return {@code non-null;} the indicated element */ public RegisterSpec get(int n) { return (RegisterSpec) get0(n); }
/** * Gets the indicated element. It is an error to call this with the * index for an element which was never set; if you do that, this * will throw {@code NullPointerException}. * * @param n {@code >= 0, < size();} which element * @return {@code non-null;} the indicated element */ public RegisterSpec get(int n) { return (RegisterSpec) get0(n); }
/** * Gets the indicated element. It is an error to call this with the * index for an element which was never set; if you do that, this * will throw {@code NullPointerException}. * * @param n {@code >= 0, < size();} which element * @return {@code non-null;} the indicated element */ public RegisterSpec get(int n) { return (RegisterSpec) get0(n); }
/** * Gets the indicated element. It is an error to call this with the * index for an element which was never set; if you do that, this * will throw {@code NullPointerException}. * * @param n {@code >= 0, < size();} which element * @return {@code non-null;} the indicated element */ public RegisterSpec get(int n) { return (RegisterSpec) get0(n); }
/** * Gets the indicated element. It is an error to call this with the * index for an element which was never set; if you do that, this * will throw {@code NullPointerException}. * * @param n {@code >= 0, < size();} which element * @return {@code non-null;} the indicated element */ public RegisterSpec get(int n) { return (RegisterSpec) get0(n); }
/** * Gets the indicated element. It is an error to call this with the * index for an element which was never set; if you do that, this * will throw {@code NullPointerException}. * * @param n {@code >= 0, < size();} which element * @return {@code non-null;} the indicated element */ public RegisterSpec get(int n) { return (RegisterSpec) get0(n); }
/** * Gets the indicated element. It is an error to call this with the * index for an element which was never set; if you do that, this * will throw {@code NullPointerException}. * * @param n {@code >= 0, < size();} which element * @return {@code non-null;} the indicated element */ public RegisterSpec get(int n) { return (RegisterSpec) get0(n); }
/** * Returns a new instance, which is the same as this instance, * except that its last element is removed. Mutability of the * result is inherited from the original. * * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withoutLast() { int newSize = size() - 1; if (newSize == 0) { return EMPTY; } RegisterSpecList result = new RegisterSpecList(newSize); for (int i = 0; i < newSize; i++) { result.set0(i, get0(i)); } if (isImmutable()) { result.setImmutable(); } return result; }
/** * Returns a new instance, which is the same as this instance, * except that its first element is removed. Mutability of the * result is inherited from the original. * * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withoutFirst() { int newSize = size() - 1; if (newSize == 0) { return EMPTY; } RegisterSpecList result = new RegisterSpecList(newSize); for (int i = 0; i < newSize; i++) { result.set0(i, get0(i + 1)); } if (isImmutable()) { result.setImmutable(); } return result; }
/** * Returns a new instance, which is the same as this instance, * except that its last element is removed. Mutability of the * result is inherited from the original. * * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withoutLast() { int newSize = size() - 1; if (newSize == 0) { return EMPTY; } RegisterSpecList result = new RegisterSpecList(newSize); for (int i = 0; i < newSize; i++) { result.set0(i, get0(i)); } if (isImmutable()) { result.setImmutable(); } return result; }
/** * Returns a new instance, which is the same as this instance, * except that its first element is removed. Mutability of the * result is inherited from the original. * * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withoutFirst() { int newSize = size() - 1; if (newSize == 0) { return EMPTY; } RegisterSpecList result = new RegisterSpecList(newSize); for (int i = 0; i < newSize; i++) { result.set0(i, get0(i + 1)); } if (isImmutable()) { result.setImmutable(); } return result; }
/** * Returns a new instance, which is the same as this instance, * except that its last element is removed. Mutability of the * result is inherited from the original. * * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withoutLast() { int newSize = size() - 1; if (newSize == 0) { return EMPTY; } RegisterSpecList result = new RegisterSpecList(newSize); for (int i = 0; i < newSize; i++) { result.set0(i, get0(i)); } if (isImmutable()) { result.setImmutable(); } return result; }
/** * Returns a new instance, which is the same as this instance, * except that it has an additional element prepended to the original. * Mutability of the result is inherited from the original. * * @param spec {@code non-null;} the new first spec (to prepend) * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withFirst(RegisterSpec spec) { int sz = size(); RegisterSpecList result = new RegisterSpecList(sz + 1); for (int i = 0; i < sz; i++) { result.set0(i + 1, get0(i)); } result.set0(0, spec); if (isImmutable()) { result.setImmutable(); } return result; }
/** * Returns a new instance, which is the same as this instance, * except that it has an additional element prepended to the original. * Mutability of the result is inherited from the original. * * @param spec {@code non-null;} the new first spec (to prepend) * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withFirst(RegisterSpec spec) { int sz = size(); RegisterSpecList result = new RegisterSpecList(sz + 1); for (int i = 0; i < sz; i++) { result.set0(i + 1, get0(i)); } result.set0(0, spec); if (isImmutable()) { result.setImmutable(); } return result; }
/** * Returns a new instance, which is the same as this instance, * except that it has an additional element prepended to the original. * Mutability of the result is inherited from the original. * * @param spec {@code non-null;} the new first spec (to prepend) * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withFirst(RegisterSpec spec) { int sz = size(); RegisterSpecList result = new RegisterSpecList(sz + 1); for (int i = 0; i < sz; i++) { result.set0(i + 1, get0(i)); } result.set0(0, spec); if (isImmutable()) { result.setImmutable(); } return result; }
/** * Returns a new instance, which is the same as this instance, * except that it has an additional element prepended to the original. * Mutability of the result is inherited from the original. * * @param spec {@code non-null;} the new first spec (to prepend) * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withFirst(RegisterSpec spec) { int sz = size(); RegisterSpecList result = new RegisterSpecList(sz + 1); for (int i = 0; i < sz; i++) { result.set0(i + 1, get0(i)); } result.set0(0, spec); if (isImmutable()) { result.setImmutable(); } return result; }
/** * Returns a new instance, which is the same as this instance, * except that it has an additional element prepended to the original. * Mutability of the result is inherited from the original. * * @param spec {@code non-null;} the new first spec (to prepend) * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withFirst(RegisterSpec spec) { int sz = size(); RegisterSpecList result = new RegisterSpecList(sz + 1); for (int i = 0; i < sz; i++) { result.set0(i + 1, get0(i)); } result.set0(0, spec); if (isImmutable()) { result.setImmutable(); } return result; }
/** * Returns a new instance, which is the same as this instance, * except that it has an additional element prepended to the original. * Mutability of the result is inherited from the original. * * @param spec {@code non-null;} the new first spec (to prepend) * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withFirst(RegisterSpec spec) { int sz = size(); RegisterSpecList result = new RegisterSpecList(sz + 1); for (int i = 0; i < sz; i++) { result.set0(i + 1, get0(i)); } result.set0(0, spec); if (isImmutable()) { result.setImmutable(); } return result; }
/** * Returns a new instance, which is the same as this instance, * except that it has an additional element prepended to the original. * Mutability of the result is inherited from the original. * * @param spec {@code non-null;} the new first spec (to prepend) * @return {@code non-null;} an appropriately-constructed instance */ public RegisterSpecList withFirst(RegisterSpec spec) { int sz = size(); RegisterSpecList result = new RegisterSpecList(sz + 1); for (int i = 0; i < sz; i++) { result.set0(i + 1, get0(i)); } result.set0(0, spec); if (isImmutable()) { result.setImmutable(); } return result; }