public static List < GraphEntity > getEntities ( Graph g , String typeName ) throws NullEntity { GraphEntity [ ] ge = g . getEntities ( ) ; List < GraphEntity > result = new ArrayList <> ( ) ; for ( int k = 0 ; k < ge . length ; k ++ ) { if ( ge [ k ] . getType ( ) . equals ( typeName ) ) { result . add ( ge [ k ] ) ; } } return result ; }
It obtains the entities in the graph g whose type is the same as typeName .