Ejemplo n.º 1
0
  @Override
  public InstancePropertyMap getPropertiesForEdge(long edgeId) {
    if (!_edgeInstances.containsKey(edgeId)) {
      _edgeInstances.put(edgeId, new InstancePropertyMap(edgeId, getEdgeProperties()));
    }

    return _edgeInstances.get(edgeId);
  }
Ejemplo n.º 2
0
  @Override
  public InstancePropertyMap getPropertiesForVertex(long vertexId) {
    assert (_template.containsVertex(vertexId));

    if (!_vertexInstances.containsKey(vertexId)) {
      _vertexInstances.put(vertexId, new InstancePropertyMap(vertexId, getVertexProperties()));
    }

    return _vertexInstances.get(vertexId);
  }
Ejemplo n.º 3
0
  public void addPropertiesForEdge(InstancePropertyMap instancePropertyMap) {
    if (instancePropertyMap == null) {
      throw new IllegalArgumentException();
    }
    if (_edgeInstances.containsKey(instancePropertyMap.getId())) {
      // property already set for this edge
      throw new IllegalArgumentException();
    }

    _edgeInstances.put(instancePropertyMap.getId(), instancePropertyMap);
  }
Ejemplo n.º 4
0
  public void addPropertiesForVertex(InstancePropertyMap instancePropertyMap) {
    if (instancePropertyMap == null) {
      throw new IllegalArgumentException();
    }
    if (_vertexInstances.containsKey(instancePropertyMap.getId())) {
      // property already set for this vertex
      throw new IllegalArgumentException();
    }

    assert (_template.containsVertex(instancePropertyMap.getId()));

    _vertexInstances.put(instancePropertyMap.getId(), instancePropertyMap);
  }
Ejemplo n.º 5
0
 @Override
 public Collection<InstancePropertyMap> getPropertiesForVertices() {
   return Collections.unmodifiableCollection(_vertexInstances.values());
 }