Package org.opentcs.data.model
Class Location
java.lang.Object
- 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
-
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.TCSObject
equals, getHistory, getName, getProperties, getProperty, hashCode, listWithoutNullValues, mapWithoutNullValues, propertiesWith, setWithoutNullValues, toString
-
Constructor Details
-
Location
Creates a new Location. this.locked = false;- Parameters:
name
- The new location's name.type
- The new location's type.
-
-
Method Details
-
withProperty
Description copied from class:TCSObject
Creates a copy of this object, with the given property integrated.- Specified by:
withProperty
in classTCSObject<Location>
- Parameters:
key
- The key of the property to be changed.value
- The new value of the property, ornull
, if the property is to be removed.- Returns:
- A copy of this object, with the given property integrated.
-
withProperties
Description copied from class:TCSObject
Creates a copy of this object, with the given properties.- Specified by:
withProperties
in classTCSObject<Location>
- Parameters:
properties
- The properties.- Returns:
- A copy of this object, with the given properties.
-
withHistoryEntry
Description copied from class:TCSObject
Creates a copy of this object, with the given history entry integrated.- Specified by:
withHistoryEntry
in classTCSObject<Location>
- Parameters:
entry
- The history entry to be integrated.- Returns:
- A copy of this object, with the given history entry integrated.
-
withHistory
Description copied from class:TCSObject
Creates a copy of this object, with the given history.- Specified by:
withHistory
in classTCSObject<Location>
- Parameters:
history
- The history.- Returns:
- A copy of this object, with the given history.
-
getPosition
Returns the physical coordinates of this location in mm.- Returns:
- The physical coordinates of this location in mm.
-
withPosition
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
Returns a reference to the type of this location.- Returns:
- A reference to the type of this location.
-
getAttachedLinks
Returns a set of links attached to this location.- Returns:
- A set of links attached to this location.
-
withAttachedLinks
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
Returns details about the peripheral devices this location may represent.- Returns:
- Details about the peripheral devices this location may represent.
-
withPeripheralInformation
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), elsefalse
.
-
withLocked
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
Returns the information regarding the grahical representation of this location.- Returns:
- The information regarding the grahical representation of this location.
-
withLayout
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.
-