Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PaarFeld<T> {
- private Feld<T> a, b;
- private int length;
- public PaarFeld(Feld<T> a, Feld<T> b) {
- this.length = (a.size() < b.size()) ? a.size() : b.size();
- this.a = a;
- this.b = b;
- }
- public Paar<T> get(int i) throws ArrayIndexOutOfBoundsException {
- if(i < length) {
- return new Paar<T>(a.get(i), b.get(i));
- } else {
- throw new ArrayIndexOutOfBoundsException();
- }
- }
- public int size() {
- return this.length;
- }
- public Paar<T> set(int i, Paar<T> result){
- Paar<T> result1;
- result1 = new Paar <T>(a.get(i), b.get(i));
- return result1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement