Package org.opentcs.data.model

# Class Location

java.lang.Object
org.opentcs.data.TCSObject<E>
org.opentcs.data.model.TCSResource<Location>
org.opentcs.data.model.Location

All Implemented Interfaces:
  `java.io.Serializable`

    public class Location
    extends TCSResource<Location>
    implements java.io.Serializable

A location at which a `Vehicle` may perform an action.

A location must be linked to at least one `Point` to be reachable for a vehicle. It may be linked to multiple points. As long as a link's specific set of allowed operations is empty (which is the default), all operations defined by the location's referenced `LocationType` are allowed at the linked point. If the link's set of allowed operations is not empty, only the operations contained in it are allowed at the linked point.

See Also:
  `LocationType`, Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type | Class | Description
  --- | --- | ---
  `static class` | `Location.Layout` | Contains information regarding the grahical representation of a location.
  `static class` | `Location.Link` | A link connecting a point and a location, expressing that the location is reachable from the point.

- ## Field Summary

  ### Fields inherited from class org.opentcs.data.TCSObject

  `reference`

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `Location​(java.lang.String name, TCSObjectReference<LocationType> type)` | Creates a new Location.

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `java.util.Set<Location.Link>` | `getAttachedLinks()` | Returns a set of links attached to this location.
  `Location.Layout` | `getLayout()` | Returns the information regarding the grahical representation of this location.
  `PeripheralInformation` | `getPeripheralInformation()` | Returns details about the peripheral devices this location may represent.
  `Triple` | `getPosition()` | Returns the physical coordinates of this location in mm.
  `TCSObjectReference<LocationType>` | `getType()` | Returns a reference to the type of this location.
  `boolean` | `isLocked()` | Returns the lock status of this location (i.e.
  `Location` | `withAttachedLinks​(java.util.Set<Location.Link> attachedLinks)` | Creates a copy of this object, with the given attached links.
  `TCSObject<Location>` | `withHistory​(ObjectHistory history)` | Creates a copy of this object, with the given history.
  `TCSObject<Location>` | `withHistoryEntry​(ObjectHistory.Entry entry)` | Creates a copy of this object, with the given history entry integrated.
  `Location` | `withLayout​(Location.Layout layout)` | Creates a copy of this object, with the given layout.
  `Location` | `withLocked​(boolean locked)` | Creates a copy of this object, with the given locked flag.
  `Location` | `withPeripheralInformation​(PeripheralInformation peripheralInformation)` | Creates a copy of this object, with the given peripheral information.
  `Location` | `withPosition​(Triple position)` | Creates a copy of this object, with the given position.
  `Location` | `withProperties​(java.util.Map<java.lang.String,​java.lang.String> properties)` | Creates a copy of this object, with the given properties.
  `Location` | `withProperty​(java.lang.String key, java.lang.String value)` | Creates a copy of this object, with the given property integrated.

  ### Methods inherited from class org.opentcs.data.model.TCSResource

  `getReference`

  ### Methods inherited from class org.opentcs.data.TCSObject

  `equals, getHistory, getName, getProperties, getProperty, hashCode, listWithoutNullValues, mapWithoutNullValues, propertiesWith, setWithoutNullValues, toString`

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

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

- ## Constructor Details

  - ### Location

    public Location​(java.lang.String name, TCSObjectReference<LocationType> type)
    Creates a new Location. this.locked = false;
    Parameters:
      `name` - The new location's name.
      `type` - The new location's type.

- ## Method Details

  - ### withProperty

    public Location withProperty​(java.lang.String key, java.lang.String value)
    Description copied from class: `TCSObject`
    Creates a copy of this object, with the given property integrated.
    Specified by:
      `withProperty` in class `TCSObject<Location>`
    Parameters:
      `key` - The key of the property to be changed.
      `value` - The new value of the property, or `null`, if the property is to be removed.
    Returns:
      A copy of this object, with the given property integrated.

  - ### withProperties

    public Location withProperties​(java.util.Map<java.lang.String,​java.lang.String> properties)
    Description copied from class: `TCSObject`
    Creates a copy of this object, with the given properties.
    Specified by:
      `withProperties` in class `TCSObject<Location>`
    Parameters:
      `properties` - The properties.
    Returns:
      A copy of this object, with the given properties.

  - ### withHistoryEntry

    public TCSObject<Location> withHistoryEntry​(ObjectHistory.Entry entry)
    Description copied from class: `TCSObject`
    Creates a copy of this object, with the given history entry integrated.
    Specified by:
      `withHistoryEntry` in class `TCSObject<Location>`
    Parameters:
      `entry` - The history entry to be integrated.
    Returns:
      A copy of this object, with the given history entry integrated.

  - ### withHistory

    public TCSObject<Location> withHistory​(ObjectHistory history)
    Description copied from class: `TCSObject`
    Creates a copy of this object, with the given history.
    Specified by:
      `withHistory` in class `TCSObject<Location>`
    Parameters:
      `history` - The history.
    Returns:
      A copy of this object, with the given history.

  - ### getPosition

    public Triple getPosition()
    Returns the physical coordinates of this location in mm.
    Returns:
      The physical coordinates of this location in mm.

  - ### withPosition

    public Location withPosition​(Triple position)
    Creates a copy of this object, with the given position.
    Parameters:
      `position` - The value to be set in the copy.
    Returns:
      A copy of this object, differing in the given value.

  - ### getType

    public TCSObjectReference<LocationType> getType()
    Returns a reference to the type of this location.
    Returns:
      A reference to the type of this location.

  - ### getAttachedLinks

    public java.util.Set<Location.Link> getAttachedLinks()
    Returns a set of links attached to this location.
    Returns:
      A set of links attached to this location.

  - ### withAttachedLinks

    public Location withAttachedLinks​(@Nonnull java.util.Set<Location.Link> attachedLinks)
    Creates a copy of this object, with the given attached links.
    Parameters:
      `attachedLinks` - The value to be set in the copy.
    Returns:
      A copy of this object, differing in the given value.

  - ### getPeripheralInformation

    @Nonnull public PeripheralInformation getPeripheralInformation()
    Returns details about the peripheral devices this location may represent.
    Returns:
      Details about the peripheral devices this location may represent.

  - ### withPeripheralInformation

    public Location withPeripheralInformation​(@Nonnull PeripheralInformation peripheralInformation)
    Creates a copy of this object, with the given peripheral information.
    Parameters:
      `peripheralInformation` - The value to be set in the copy.
    Returns:
      A copy of this object, differing in the given value.

  - ### isLocked

    public boolean isLocked()
    Returns the lock status of this location (i.e. whether it my be used by vehicles or not).
    Returns:
      `true` if this location is currently locked (i.e. it may not be used by vehicles), else `false`.

  - ### withLocked

    public Location withLocked​(boolean locked)
    Creates a copy of this object, with the given locked flag.
    Parameters:
      `locked` - The value to be set in the copy.
    Returns:
      A copy of this object, differing in the given value.

  - ### getLayout

    public Location.Layout getLayout()
    Returns the information regarding the grahical representation of this location.
    Returns:
      The information regarding the grahical representation of this location.

  - ### withLayout

    public Location withLayout​(Location.Layout layout)
    Creates a copy of this object, with the given layout.
    Parameters:
      `layout` - The value to be set in the copy.
    Returns:
      A copy of this object, differing in the given value.