MATSIM
Static Public Member Functions | Private Member Functions | List of all members
org.matsim.utils.objectattributes.ObjectAttributesUtils Class Reference

Static Public Member Functions

static void copyAllAttributes (ObjectAttributes source, ObjectAttributes destination, String objectId)
 
static Collection< String > getAllAttributeNames (ObjectAttributes attributes, final String objectId)
 

Private Member Functions

 ObjectAttributesUtils ()
 

Detailed Description

Author
mrieser / Senozon AG

Definition at line 30 of file ObjectAttributesUtils.java.

Constructor & Destructor Documentation

◆ ObjectAttributesUtils()

org.matsim.utils.objectattributes.ObjectAttributesUtils.ObjectAttributesUtils ( )
private

Definition at line 32 of file ObjectAttributesUtils.java.

32  {
33  // abstract helper class
34  }

Member Function Documentation

◆ copyAllAttributes()

static void org.matsim.utils.objectattributes.ObjectAttributesUtils.copyAllAttributes ( ObjectAttributes  source,
ObjectAttributes  destination,
String  objectId 
)
static

Definition at line 36 of file ObjectAttributesUtils.java.

36  {
37  Map<String, Object> sAttrs = source.attributes.get(objectId);
38  if (sAttrs != null) {
39  Map<String, Object> dAttrs = destination.attributes.get(objectId);
40  if (dAttrs == null) {
41  dAttrs = new IdentityHashMap<String, Object>();
42  destination.attributes.put(objectId, dAttrs);
43  }
44  dAttrs.putAll(sAttrs);
45  }
46  }

◆ getAllAttributeNames()

static Collection<String> org.matsim.utils.objectattributes.ObjectAttributesUtils.getAllAttributeNames ( ObjectAttributes  attributes,
final String  objectId 
)
static

Definition at line 48 of file ObjectAttributesUtils.java.

48  {
49  Map<String, Object> map = attributes.attributes.get(objectId);
50  if (map == null) {
51  return Collections.emptyList();
52  }
53  return Collections.unmodifiableCollection(map.keySet());
54  }

The documentation for this class was generated from the following file: