Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| OptaPlanner distribution 6.2.0.Beta2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.optaplanner.examples.tsp.domain
Class City

    java.lang.Object
      org.optaplanner.examples.common.domain.AbstractPersistable
          org.optaplanner.examples.tsp.domain.City

All Implemented Interfaces:
  Serializable, Comparable<AbstractPersistable>

    public class City

extends AbstractPersistable

See Also:
  Serialized Form

Field Summary

Fields inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
`id`

Constructor Summary
`City()`

Method Summary
`long` | `getDistance(City city)` The distance is not in miles or km, but in the TSPLIB's unit of measurement.
`double` | `getLatitude()`
`double` | `getLongitude()`
`String` | `getName()`
`String` | `getSafeName()`
`void` | `setLatitude(double latitude)`
`void` | `setLongitude(double longitude)`
`void` | `setName(String name)`
`String` | `toString()`

Methods inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
`compareTo, getId, setId`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### City

    public City()

Method Detail

### getName

    public String getName()

### setName

    public void setName(String name)

### getLatitude

    public double getLatitude()

### setLatitude

    public void setLatitude(double latitude)

### getLongitude

    public double getLongitude()

### setLongitude

    public void setLongitude(double longitude)

### getDistance

    public long getDistance(City city)

  The distance is not in miles or km, but in the TSPLIB's unit of measurement.

  Parameters:
    `city` - never null
  Returns:
    a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors

### toString

    public String toString()

  Overrides:
    `toString` in class `AbstractPersistable`

### getSafeName

    public String getSafeName()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| OptaPlanner distribution 6.2.0.Beta2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006-2014 JBoss by Red Hat. All Rights Reserved.