Point.java in  » Script » java2script » org » eclipse » swt » graphics » Java Source Code / Java Documentation 2Java Source Code and Java Documentation

Home
Java Source Code / Java Documentation 2
1.2D
2.3D
3.Ajax
4.Algebra
5.App Engine
6.Aspect
7.Assemble
8.Cache
9.Cassandra
10.Chat
11.Cloud
12.CMS
13.CouchDB
14.Crypt
15.Database
16.Distributed
17.Eclipse
18.Facebook
19.File
20.Forum
21.GAE
22.Game
23.Google tech
24.Graph
25.Graphic
26.GWT
27.Hibernate
28.HTML
29.HTTP
30.Image
31.IntelliJ
32.IRC
33.J2EE
34.J2ME
35.JDBC
36.JPA
37.JSON
38.JSR
39.JUnit
40.JVM
41.Language
42.Linux
43.Math
44.Maven
45.Media
46.Messenger
47.MiddleWare
48.Mobile
49.Mock
50.MongoDB
51.Mp3
52.Music
53.MVC
54.Network
55.OpenID
56.OSGi
57.Parse
58.Persist
59.Petri
60.Phone
61.Physics
62.REST
63.Robot
64.RPC
65.RSS
66.Ruby
67.Script
68.Search
69.Spring
70.SQL
71.SSH
72.Sudoku
73.Swing
74.Tapestry
75.Test
76.Text
77.Torrent
78.Twitter
79.UML
80.UnTagged
81.Utilities
82.Web
83.Wiki
84.XML
Java Source Code / Java Documentation 2 » Script » java2script » org.eclipse.swt.graphics 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


        /*******************************************************************************
         * Copyright (c) 2000, 2005 IBM Corporation and others.
         * All rights reserved. This program and the accompanying materials
         * are made available under the terms of the Eclipse Public License v1.0
         * which accompanies this distribution, and is available at
         * http://www.eclipse.org/legal/epl-v10.html
         *
         * Contributors:
         *     IBM Corporation - initial API and implementation
         *******************************************************************************/package org.eclipse.swt.graphics;

        import org.eclipse.swt.internal.SerializableCompatibility;

        /**
         * Instances of this class represent places on the (x, y)
         * coordinate plane.
         * <p>
         * The coordinate space for rectangles and points is considered
         * to have increasing values downward and to the right from its
         * origin making this the normal, computer graphics oriented notion
         * of (x, y) coordinates rather than the strict mathematical one.
         * </p>
         * <p>
         * The hashCode() method in this class uses the values of the public
         * fields to compute the hash value. When storing instances of the
         * class in hashed collections, do not modify these fields after the
         * object has been inserted.  
         * </p>
         * <p>
         * Application code does <em>not</em> need to explicitly release the
         * resources managed by each instance when those instances are no longer
         * required, and thus no <code>dispose()</code> method is provided.
         * </p>
         *
         * @see Rectangle
         */

        public final class Point implements  SerializableCompatibility {

            /**
             * the x coordinate of the point
             */
            public int x;

            /**
             * the y coordinate of the point
             */
            public int y;

            static final long serialVersionUID = 3257002163938146354L;

            /**
             * Constructs a new point with the given x and y coordinates.
             *
             * @param x the x coordinate of the new point
             * @param y the y coordinate of the new point
             */
            public Point(int x, int y) {
                this .x = x;
                this .y = y;
            }

            /**
             * Compares the argument to the receiver, and returns true
             * if they represent the <em>same</em> object using a class
             * specific comparison.
             *
             * @param object the object to compare with this object
             * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
             *
             * @see #hashCode()
             */
            public boolean equals(Object object) {
                if (object == this )
                    return true;
                if (!(object instanceof  Point))
                    return false;
                Point p = (Point) object;
                return (p.x == this .x) && (p.y == this .y);
            }

            /**
             * Returns an integer hash code for the receiver. Any two 
             * objects that return <code>true</code> when passed to 
             * <code>equals</code> must return the same value for this
             * method.
             *
             * @return the receiver's hash
             *
             * @see #equals(Object)
             */
            public int hashCode() {
                return x ^ y;
            }

            /**
             * Returns a string containing a concise, human-readable
             * description of the receiver.
             *
             * @return a string representation of the point
             */
            public String toString() {
                return "Point {" + x + ", " + y + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            }

        }
ww___w.___j___a___v___a__2_s._c___om | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.