private RegisterSpecList getResult() { if (regSpecList.isImmutable()) { result.setImmutable(); } return result; } }
private RegisterSpecList getResult() { if (regSpecList.isImmutable()) { result.setImmutable(); } return result; } }
private RegisterSpecList getResult() { if (regSpecList.isImmutable()) { result.setImmutable(); } return result; } }
private RegisterSpecList getResult() { if (regSpecList.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; }
/** * * @param sources old register list * @return new mapped register list, or old if nothing has changed. */ public final RegisterSpecList map(RegisterSpecList sources) { int sz = sources.size(); RegisterSpecList newSources = new RegisterSpecList(sz); for (int i = 0; i < sz; i++) { newSources.set(i, map(sources.get(i))); } newSources.setImmutable(); // Return the old sources if nothing has changed. return newSources.equals(sources) ? sources : newSources; }
/** * * @param sources old register list * @return new mapped register list, or old if nothing has changed. */ public final RegisterSpecList map(RegisterSpecList sources) { int sz = sources.size(); RegisterSpecList newSources = new RegisterSpecList(sz); for (int i = 0; i < sz; i++) { newSources.set(i, map(sources.get(i))); } newSources.setImmutable(); // Return the old sources if nothing has changed. return newSources.equals(sources) ? sources : newSources; }
/** * * @param sources old register list * @return new mapped register list, or old if nothing has changed. */ public final RegisterSpecList map(RegisterSpecList sources) { int sz = sources.size(); RegisterSpecList newSources = new RegisterSpecList(sz); for (int i = 0; i < sz; i++) { newSources.set(i, map(sources.get(i))); } newSources.setImmutable(); // Return the old sources if nothing has changed. return newSources.equals(sources) ? sources : newSources; }
/** * * @param sources old register list * @return new mapped register list, or old if nothing has changed. */ public final RegisterSpecList map(RegisterSpecList sources) { int sz = sources.size(); RegisterSpecList newSources = new RegisterSpecList(sz); for (int i = 0; i < sz; i++) { newSources.set(i, map(sources.get(i))); } newSources.setImmutable(); // Return the old sources if nothing has changed. return newSources.equals(sources) ? sources : newSources; }
/** * * @param sources old register list * @return new mapped register list, or old if nothing has changed. */ public final RegisterSpecList map(RegisterSpecList sources) { int sz = sources.size(); RegisterSpecList newSources = new RegisterSpecList(sz); for (int i = 0; i < sz; i++) { newSources.set(i, map(sources.get(i))); } newSources.setImmutable(); // Return the old sources if nothing has changed. return newSources.equals(sources) ? sources : newSources; } }
/** * * @param sources old register list * @return new mapped register list, or old if nothing has changed. */ public final RegisterSpecList map(RegisterSpecList sources) { int sz = sources.size(); RegisterSpecList newSources = new RegisterSpecList(sz); for (int i = 0; i < sz; i++) { newSources.set(i, map(sources.get(i))); } newSources.setImmutable(); // Return the old sources if nothing has changed. return newSources.equals(sources) ? sources : newSources; } }
/** * * @param sources old register list * @return new mapped register list, or old if nothing has changed. */ public final RegisterSpecList map(RegisterSpecList sources) { int sz = sources.size(); RegisterSpecList newSources = new RegisterSpecList(sz); for (int i = 0; i < sz; i++) { newSources.set(i, map(sources.get(i))); } newSources.setImmutable(); // Return the old sources if nothing has changed. return newSources.equals(sources) ? sources : newSources; } }
/** * * @param sources old register list * @return new mapped register list, or old if nothing has changed. */ public final RegisterSpecList map(RegisterSpecList sources) { int sz = sources.size(); RegisterSpecList newSources = new RegisterSpecList(sz); for (int i = 0; i < sz; i++) { newSources.set(i, map(sources.get(i))); } newSources.setImmutable(); // Return the old sources if nothing has changed. return newSources.equals(sources) ? sources : newSources; } }
/** * 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; }