View Javadoc

1   /*
2    * Copyright (c) 2008, the JUNG Project and the Regents of the University
3    * of California
4    * All rights reserved.
5    *
6    * This software is open-source under the BSD license; see either
7    * "license.txt" or
8    * http://jung.sourceforge.net/license.txt for a description.
9    */
10  
11  package edu.uci.ics.jung.io.graphml;
12  
13  import java.util.ArrayList;
14  import java.util.List;
15  
16  /**
17   * Metadata structure for the 'node' GraphML element.
18   *
19   * @author Nathan Mittler - nathan.mittler@gmail.com
20   * 
21   * @see "http://graphml.graphdrawing.org/specification.html"
22   */
23  public class NodeMetadata extends AbstractMetadata {
24  
25      private String id;
26      private String description;
27      private Object vertex;
28      final private List<PortMetadata> ports = new ArrayList<PortMetadata>();
29      
30      public String getId() {
31          return id;
32      }
33      
34      public void setId(String id) {
35          this.id = id;
36      }
37      
38      public String getDescription() {
39          return description;
40      }
41      
42      public void setDescription(String desc) {
43          this.description = desc;
44      }
45      
46      public void addPort(PortMetadata port) {
47          ports.add(port);
48      }
49      
50      public List<PortMetadata> getPorts() {
51          return ports;
52      }
53      
54      public Object getVertex() {
55          return vertex;
56      }
57  
58      public void setVertex(Object vertex) {
59          this.vertex = vertex;
60      }
61  
62      public MetadataType getMetadataType() {
63          return MetadataType.NODE;
64      }
65  
66  }