com.kuka.nav.fleet.graph.properties
Interface PropertyHolder

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultPropertyHolder

public interface PropertyHolder
extends Serializable

Holds a set of properties of type Property.


Field Summary
static Integer ROBOTTYPEALL
          Special robot type identifier used for properties that are not associated to a specific robot type.
 
Method Summary
 PropertyHolder add(Integer robotTypeId, Property property)
          Adds the given property to this property holder.
 PropertyHolder add(Property property)
          Adds the given property to this property holder.
 PropertyHolder addAll(Collection<com.kuka.util.Pair<Integer,Property>> entries)
          Adds a number of property entries to this property holder.
 void addPropertyHolderListener(PropertyHolderListener listener)
          Adds the given listener.
 Object clone()
          Clones the property holder (method is protected in Object)
<T extends Property>
boolean
containsAny(Class<T> propertyType)
          Checks if for any robot type the given property type exists.
 Collection<com.kuka.util.Pair<Integer,Property>> entries()
           
 void firePropertyHolderChanged()
          Notifies all contained listeners that this property holder has changed.
<T extends Property>
T
get(Class<T> propertyType)
          Returns the value of the property with the specified type or null if it does not exist.
<T extends Property>
T
get(Integer robotTypeId, Class<T> propertyType)
          If the property of the specified type is associated to the given robot type or all robot types, the value of this property is returned.
 Collection<Property> getAll()
           
 Collection<Property> getAll(Integer robotTypeId)
           
 Integer getCorrespondingRobotType(Property property)
          Returns the corresponding robot type id.
<T extends Property>
T
getSpecific(Integer robotTypeId, Class<T> propertyType)
          If the property of the specified type is associated to the given robot type, the value of this property is returned.
<T extends Property>
T
getSuperProperty(Integer robotTypeId, Class<T> superPropertyType)
          Checks whether the property holder has a property for the given robot type that is a subclass of the given super property type.
 PropertyHolder remove(Class<? extends Property> propertyType)
          Removes the property from this property holder.
 PropertyHolder remove(Integer robotTypeId, Class<? extends Property> propertyType)
          Removes the property associated with the given robot type from this property holder.
 PropertyHolder removeAny(Class<? extends Property> propertyType)
          Removes the properties associated with any robot type from this property holder and returns it.
 void removePropertyHolderListener(PropertyHolderListener listener)
          Removes the given listener.
 Collection<Property> values()
           
<T extends Property>
Collection<T>
values(Class<T> propertyType)
          Returns a collection of all properties of the given type.
 Collection<Property> values(Integer robotTypeId)
          Returns a collection of all properties for the given robot type.
 

Field Detail

ROBOTTYPEALL

static final Integer ROBOTTYPEALL
Special robot type identifier used for properties that are not associated to a specific robot type.

Method Detail

add

PropertyHolder add(Property property)
Adds the given property to this property holder. If the holder previously contained the given property, the old property value is replaced. The property is not associated with any robot type.

Parameters:
property - The property to add.
Returns:
this property holder

add

PropertyHolder add(Integer robotTypeId,
                   Property property)
Adds the given property to this property holder. If the holder previously contained the given property, the old property value is replaced. The property is associated with the given robot type.

Parameters:
robotTypeId - the robot type identifier
property - the property to add
Returns:
this property holder

addAll

PropertyHolder addAll(Collection<com.kuka.util.Pair<Integer,Property>> entries)
Adds a number of property entries to this property holder.

Parameters:
entries - a collection of entries of property and associated robot type id
Returns:
this property holder

remove

PropertyHolder remove(Class<? extends Property> propertyType)
Removes the property from this property holder. Then returns this property holder.

Parameters:
propertyType - The property type to remove.
Returns:
this property holder

remove

PropertyHolder remove(Integer robotTypeId,
                      Class<? extends Property> propertyType)
Removes the property associated with the given robot type from this property holder. Then returns this property holder.

Parameters:
robotTypeId - the robot
propertyType - The property type to remove.
Returns:
this property holder

removeAny

PropertyHolder removeAny(Class<? extends Property> propertyType)
Removes the properties associated with any robot type from this property holder and returns it.

Parameters:
propertyType - The property type to remove.
Returns:
this property holder

get

<T extends Property> T get(Class<T> propertyType)
Returns the value of the property with the specified type or null if it does not exist.

Type Parameters:
T - the type of the property
Parameters:
propertyType - The type of the property.
Returns:
The value of the property.

get

<T extends Property> T get(Integer robotTypeId,
                           Class<T> propertyType)
If the property of the specified type is associated to the given robot type or all robot types, the value of this property is returned. Otherwise, null is returned.

Type Parameters:
T - the type of the property
Parameters:
robotTypeId - the robot type id
propertyType - The type of the property.
Returns:
The value of the property.

getSpecific

<T extends Property> T getSpecific(Integer robotTypeId,
                                   Class<T> propertyType)
If the property of the specified type is associated to the given robot type, the value of this property is returned. Otherwise, null is returned.

Type Parameters:
T - the type of the property
Parameters:
robotTypeId - the robot type id
propertyType - The type of the property.
Returns:
The value of the property.

getSuperProperty

<T extends Property> T getSuperProperty(Integer robotTypeId,
                                        Class<T> superPropertyType)
Checks whether the property holder has a property for the given robot type that is a subclass of the given super property type. The first such property is cast to the given super property class and returned. If no such property exists, null is returned.

Type Parameters:
T - the type of the super property.
Parameters:
robotTypeId - the robot type id.
superPropertyType - the super property.
Returns:
the property.

getAll

Collection<Property> getAll()
Returns:
A collection of all properties not associated to a specific robot type.

getAll

Collection<Property> getAll(Integer robotTypeId)
Parameters:
robotTypeId - a robot type id
Returns:
A collection of all properties associated to the given robot type.

values

Collection<Property> values()
Returns:
A collection of all properties.

values

<T extends Property> Collection<T> values(Class<T> propertyType)
Returns a collection of all properties of the given type.

Type Parameters:
T - the type of the property
Parameters:
propertyType - the property type
Returns:
a collection of all properties of the given type

values

Collection<Property> values(Integer robotTypeId)
Returns a collection of all properties for the given robot type.

Parameters:
robotTypeId - a robot type id
Returns:
a collection of all properties for the given robot type

entries

Collection<com.kuka.util.Pair<Integer,Property>> entries()
Returns:
A collection with robot types for which properties are defined.

getCorrespondingRobotType

Integer getCorrespondingRobotType(Property property)
Returns the corresponding robot type id. Compares the properties by reference.

Parameters:
property - the property
Returns:
the robot type id

containsAny

<T extends Property> boolean containsAny(Class<T> propertyType)
Checks if for any robot type the given property type exists.

Type Parameters:
T - the type of the property
Parameters:
propertyType - the property type
Returns:
true if for any robot type the given property type exists, false otherwise

addPropertyHolderListener

void addPropertyHolderListener(PropertyHolderListener listener)
Adds the given listener.

Parameters:
listener - the listener to add

removePropertyHolderListener

void removePropertyHolderListener(PropertyHolderListener listener)
Removes the given listener.

Parameters:
listener - the listener to remove

firePropertyHolderChanged

void firePropertyHolderChanged()
Notifies all contained listeners that this property holder has changed.


clone

Object clone()
             throws CloneNotSupportedException
Clones the property holder (method is protected in Object)

Returns:
clone of property holder
Throws:
CloneNotSupportedException


Copyright © 2019. All rights reserved.