@ SuppressWarnings ( "unchecked" ) public < GR extends GrammaticalRelationAnnotation > boolean addArc ( Class < GR > arcLabel , TreeGraphNode node ) { if ( node == null ) { return false ; } if ( ! treeGraph ( ) . equals ( node . treeGraph ( ) ) ) { System . err . println ( "Warning: you are trying to add an arc from node " + this + " to node " + node + ", but they do not belong to the same TreeGraph!" ) ; } if ( ! label . containsKey ( arcLabel ) ) { label . set ( arcLabel , new HashSet < TreeGraphNode > ( ) ) ; } return ( ( Collection ) label . get ( arcLabel ) ) . add ( node ) ; }
Add a labeled arc from this node to the argument node .