11adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov/**
211a89b445f3bde56bf07e6a0d04f0b0256dcb215Andrey Somov * Copyright (c) 2008, http://www.snakeyaml.org
31adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov *
41adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * Licensed under the Apache License, Version 2.0 (the "License");
51adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * you may not use this file except in compliance with the License.
61adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * You may obtain a copy of the License at
71adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov *
81adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov *     http://www.apache.org/licenses/LICENSE-2.0
91adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov *
101adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * Unless required by applicable law or agreed to in writing, software
111adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * distributed under the License is distributed on an "AS IS" BASIS,
121adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * See the License for the specific language governing permissions and
141adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * limitations under the License.
15050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov */
16050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somovpackage org.yaml.snakeyaml.immutable;
17050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov
18050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov/**
19050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov * Two public constructor with 2 argument are present
20050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov */
21050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somovpublic class Point2 {
22050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov    private final Integer x;
23050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov    private final Integer y;
24050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov
25050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov    public Integer getX() {
26050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov        return x;
27050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov    }
28050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov
29050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov    public Integer getY() {
30050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov        return y;
31050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov    }
32050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov
33050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov    public Point2(Double x, Double y) {
34050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov        this.x = x.intValue();
35050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov        this.y = y.intValue();
36050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov    }
37050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov
38050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov    public Point2(Integer x, Integer y) {
39050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov        this.x = x;
40050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov        this.y = y;
41050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov    }
42050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov
43050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov    @Override
44050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov    public String toString() {
45050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov        return "<Point2 x=" + String.valueOf(x) + " y=" + String.valueOf(y) + ">";
46050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov    }
47050c422c295a0ff956f79ba91c4c5a21b255f721Andrey Somov}
48