Home » jdo2-tck-2.3-ea-src » org.apache.jdo.tck.pc.mylib » [javadoc | source]

    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    * 
    9    *     http://www.apache.org/licenses/LICENSE-2.0
   10    * 
   11    * Unless required by applicable law or agreed to in writing, software 
   12    * distributed under the License is distributed on an "AS IS" BASIS, 
   13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
   14    * See the License for the specific language governing permissions and 
   15    * limitations under the License.
   16    */
   17    
   18   package org.apache.jdo.tck.pc.mylib;
   19   
   20   /**
   21   * A simple class with two fields
   22   *
   23   * @author Dave Bristor
   24   */
   25   public class Point {
   26       public int x;
   27       public Integer y;
   28   
   29       public Point() { }
   30   
   31       public Point(int x, int y) {
   32           this.x = x;
   33           this.y = new Integer(y);
   34       }
   35   
   36       public Point(int x, Integer y) {
   37           this.x = x;
   38           this.y = y;
   39       }
   40   
   41       public String toString() {
   42           String rc = null;
   43   	Object obj = this;
   44           try {
   45   	    rc = obj.getClass().getName();
   46               //rc = Util.getClassName(this) + name();
   47           } catch (NullPointerException ex) {
   48               rc = "NPE getting Point's values";
   49           }
   50           return rc;
   51       }
   52   
   53       public int getX() {
   54           System.out.println("Hello from Point.getX");
   55           return x;
   56       }
   57   
   58       public Integer getY() {
   59           System.out.println("Hello from Point.getY");
   60           return y;
   61       }
   62       
   63       public String name() {
   64           return " x: " + getX() + ", y: " + getY().intValue();
   65       }
   66   }

Home » jdo2-tck-2.3-ea-src » org.apache.jdo.tck.pc.mylib » [javadoc | source]