org.cpsolver.ifs.example.rpp

## Class Location

- java.lang.Object
- - org.cpsolver.ifs.model.Value<Rectangle,Location>
  - - org.cpsolver.ifs.example.rpp.Location

- All Implemented Interfaces:
    Comparable<Location>, AssignmentComparable<Location,Rectangle,Location>

      public class Location
      extends Value<Rectangle,Location>

  Location (value, i.e., a single placement of the rectangle). Location encodes X and Y coordinate.
  Version:
    IFS 1.3 (Iterative Forward Search)
    Copyright (C) 2006 - 2014 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.

- - ### Field Summary

    - ### Fields inherited from class org.cpsolver.ifs.model.Value

      `iValue`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Location(Rectangle rectangle, int x, int y)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object object)` Compare two coordinates.
    `String` | `getName()` Location's name.
    `int` | `getX()` Gets x coordinate
    `int` | `getY()` Gets y coordinate
    `boolean` | `hasIntersection(Location anotherLocation)` Returns true if the given location intersects with this location
    `String` | `toString()` String representation (for debugging and printing purposes).

    - ### Methods inherited from class org.cpsolver.ifs.model.Value

      `compareTo, compareTo, conflicts, conflicts, getDescription, getExtra, getId, hashCode, isConsistent, setExtra, setVariable, toDouble, toDouble, valueEquals, valueEquals, variable`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Location

          public Location(Rectangle rectangle,
                          int x,
                          int y)

      Constructor
      Parameters:
        `rectangle` - parent variable
        `x` - x coordinate
        `y` - y coordinate

  - ### Method Detail

    - #### getX

          public int getX()

      Gets x coordinate
      Returns:
        x coordinate

    - #### getY

          public int getY()

      Gets y coordinate
      Returns:
        y coordinate

    - #### equals

          public boolean equals(Object object)

      Compare two coordinates. It is based on comparison of the parent rectangle and x,y coordinates
      Overrides:
        `equals` in class `Value<Rectangle,Location>`

    - #### toString

          public String toString()

      String representation (for debugging and printing purposes). For example, rect43=[12,10] where rect43 is the name of the parent rectangle and [12,10] is the location.
      Overrides:
        `toString` in class `Value<Rectangle,Location>`

    - #### getName

          public String getName()

      Location's name. E.g., [12,10] where x=12 and y=10.
      Overrides:
        `getName` in class `Value<Rectangle,Location>`
      Returns:
        value name

    - #### hasIntersection

          public boolean hasIntersection(Location anotherLocation)

      Returns true if the given location intersects with this location
      Parameters:
        `anotherLocation` - given location
      Returns:
        true if the given location intersects with this location