⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xyconstraints.java

📁 模拟约索夫问题:   有N个人围成一圈从第一个人报数
💻 JAVA
字号:
/**
 * Copyright (c) 1996-2004 Borland Software Corp. All Rights Reserved.
 *
 * This SOURCE CODE FILE, which has been provided by Borland as part
 * of a Borland product for use ONLY by licensed users of the product,
 * includes CONFIDENTIAL and PROPRIETARY information of Borland.
 *
 * USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS
 * OF THE LICENSE STATEMENT AND LIMITED WARRANTY FURNISHED WITH
 * THE PRODUCT.
 *
 * IN PARTICULAR, YOU WILL INDEMNIFY AND HOLD BORLAND, ITS RELATED
 * COMPANIES AND ITS SUPPLIERS, HARMLESS FROM AND AGAINST ANY
 * CLAIMS OR LIABILITIES ARISING OUT OF THE USE, REPRODUCTION, OR
 * DISTRIBUTION OF YOUR PROGRAMS, INCLUDING ANY CLAIMS OR LIABILITIES
 * ARISING OUT OF OR RESULTING FROM THE USE, MODIFICATION, OR
 * DISTRIBUTION OF PROGRAMS OR FILES CREATED FROM, BASED ON, AND/OR
 * DERIVED FROM THIS SOURCE CODE FILE.
 */
//--------------------------------------------------------------------------------------------------
// Copyright (c) 1996 - 2004 Borland Software Corporation. All Rights Reserved.
//--------------------------------------------------------------------------------------------------
package com.borland.jbcl.layout;

public class XYConstraints implements Cloneable, java.io.Serializable
{
  int x;
  int y;
  int width;       // <= 0 means use the components's preferred size
  int height;      // <= 0 means use the components's preferred size

  public XYConstraints() {
    this(0, 0, 0, 0);
  }

  public XYConstraints(int x, int y, int width, int height) {
    this.x = x;
    this.y = y;
    this.width = width;
    this.height = height;
  }

  public int  getX() { return x; }
  public void setX(int x) { this.x = x; }
  public int  getY() { return y; }
  public void setY(int y) { this.y = y; }
  public int  getWidth() { return width; }
  public void setWidth(int width) { this.width = width; }
  public int  getHeight() { return height; }
  public void setHeight(int height) { this.height = height; }

  /**
   * Returns the hashcode for this XYConstraints.
   */
  public int hashCode() {
    return x ^ (y*37) ^ (width*43) ^ (height*47);
  }

  /**
   * Checks whether two XYConstraints are equal.
   */
  public boolean equals(Object that) {
    if (that instanceof XYConstraints) {
      XYConstraints other = (XYConstraints)that;
      return other.x == x && other.y == y && other.width == width && other.height == height;
    }
    return false;
  }

  public Object clone() {
    return new XYConstraints(x, y, width, height);
  }

  public String toString() {
    return "XYConstraints[" + x + "," + y + "," + width + "," + height + "]";  
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -