Yurttas/PL/OOL/Java/F/02/04/02/01/DA.java

From ZCubes Wiki
Jump to navigation Jump to search
 1/**
 2 *  Copyright(C) 2004
 3 *  All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4 *
 5 *  Permission to use, copy, modify, and distribute this
 6 *  software and its documentation for EDUCATIONAL purposes
 7 *  and without fee is hereby granted provided that this
 8 *  copyright notice appears in all copies.
 9 *
10 *  date   : September 1, 2004.
11 *  author : Salih Yurttas.
12 */
13
14
15public class DA {
16
17  private final static int N0=4;
18  private double[] a0;
19
20  private final static int N1=4;
21  private double[] a1;
22
23  public DA(final double v0,
24            final double v1) {
25    this.a0 = new double[N0];
26    for(int i=0; i<N0; i++)
27      this.a0[i] = v0;
28
29    this.a1 = new double[N1];
30    for(int i=0; i<N1; i++)
31      this.a1[i] = v1;
32  }
33
34  public int getSize0() {
35    return this.N0;
36  }
37
38  public double[] getA0() {
39    return this.a0;
40  }
41
42  public void setA0(final double v) {
43    for(int i=0; i<N0; i++)
44      this.a0[i] = v;
45  }
46
47  public int getSize1() {
48    return this.N1;
49  }
50
51  public double[] getA1() {
52    return this.a1;
53  }
54
55  public void setA1(final double v) {
56    for(int i=0; i<N1; i++)
57      this.a1[i] = v;
58  }
59
60  public void output() {
61    for(int i=0; i<N0; i++)
62      System.out.println(this.a0[i]);
63
64    System.out.println();
65
66    for(int i=0; i<N1; i++)
67      System.out.println(this.a1[i]);
68    System.out.println();
69  }
70
71}