コード例 #1
0
        public PathRelationShip Clone(Vertex vertex, IEntity entity)
        {
            PathRelationShip relationship = new PathRelationShip(vertex, entity);

            relationship.CopyFrom(this);
            return(relationship);
        }
コード例 #2
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="vertex"/> or <paramref name="entity"/> is null.
        /// </exception>
        public virtual PathRelationShip AddPathRelationShip(Vertex vertex, IEntity entity)
        {
            PathRelationShip path = new PathRelationShip(vertex, entity);

            AddPathRelationShip(path);
            return(path);
        }
コード例 #3
0
        protected virtual void AddPathRelationShip(PathRelationShip path)
        {
            AddRelationship(path);
            //the following two is to add the edges to the array we want. it is put here because both the insert new and the load will go through this stage.
            EdgeID edgeID = new EdgeID(path.FirstVertex.ID, path.SecondVertex.ID, path.Label);

            pathLabel.Add(edgeID);
        }
コード例 #4
0
 private void RemoveEdgeID(PathRelationShip path)
 {
     foreach (var item in pathLabel)//don't need label to remove the edgeLabe.
     {
         if (item.ID1 == path.FirstVertex.ID && item.ID2 == path.SecondVertex.ID)
         {
             pathLabel.Remove(item);
             break;
         }
     }
 }
コード例 #5
0
 private void UpdatePathID(PathRelationShip path)
 {
     foreach (EdgeID pair in pathLabel)
     {
         if (pair.ID1 == path.FirstVertex.OldID && pair.ID2 == path.SecondVertex.OldID)// this is dangerous which requires updatae edgeID after refreshing vertex label.Will change later.
         {
             pair.ID1         = path.FirstVertex.ID;
             pair.ID2         = path.SecondVertex.ID;
             pair.LabelOfEdge = path.Label;
         }
     }
 }
コード例 #6
0
        public bool InsertPathRelationShip(PathRelationShip path)
        {
            if (path != null && !relationships.Contains(path) &&
                entities.Contains(path.First) && entities.Contains(path.Second))
            {
                AddPathRelationShip(path);

                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #7
0
 private void UpdatePathID(PathRelationShip path)
 {
     foreach (EdgeID pair in pathLabel)
     {
         if (pair.ID1 == path.FirstVertex.OldID && pair.ID2 == path.SecondVertex.OldID)// this is dangerous which requires updatae edgeID after refreshing vertex label.Will change later.
         {
             pair.ID1 = path.FirstVertex.ID;
             pair.ID2 = path.SecondVertex.ID;
             pair.LabelOfEdge = path.Label;
         }
     }
 }
コード例 #8
0
 private void RemoveEdgeID(PathRelationShip path)
 {
     foreach (var item in pathLabel)//don't need label to remove the edgeLabe.
     {
         if (item.ID1 == path.FirstVertex.ID && item.ID2 == path.SecondVertex.ID)
         {
             pathLabel.Remove(item);
             break;
         }
     }
 }
コード例 #9
0
 protected virtual void AddPathRelationShip(PathRelationShip path)
 {
     AddRelationship(path);
     //the following two is to add the edges to the array we want. it is put here because both the insert new and the load will go through this stage.
     EdgeID edgeID = new EdgeID(path.FirstVertex.ID, path.SecondVertex.ID, path.Label);
     pathLabel.Add(edgeID);
 }
コード例 #10
0
        public bool InsertPathRelationShip(PathRelationShip path)
        {
            if (path != null && !relationships.Contains(path) &&
                entities.Contains(path.First) && entities.Contains(path.Second))
            {
                AddPathRelationShip(path);

                return true;

            }
            else
            {
                return false;
            }
        }
コード例 #11
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="vertex"/> or <paramref name="entity"/> is null.
        /// </exception>
        public virtual PathRelationShip AddPathRelationShip(Vertex vertex, IEntity entity)
        {
            PathRelationShip path = new PathRelationShip(vertex, entity);

            AddPathRelationShip(path);
            return path;
        }
コード例 #12
0
 public PathRelationShip Clone(Vertex vertex, IEntity entity)
 {
     PathRelationShip relationship = new PathRelationShip(vertex, entity);
     relationship.CopyFrom(this);
     return relationship;
 }