public Attribute cloneAttributes ( AgBuffer orig , Type type , Attribute seed ) { Map < Attribute , Attribute > map ; // old attributes to new attributes Attribute attr ; State newState ; map = new HashMap < Attribute , Attribute > ( ) ; for ( State state : orig . states ) { attr = state . getAttribute ( ) ; map . put ( attr , new Attribute ( attr . symbol , null , type ) ) ; } for ( State state : orig . states ) { newState = state . cloneAttributeTransport ( map ) ; states . add ( newState ) ; } attr = map . get ( seed ) ; if ( attr == null ) { throw new IllegalArgumentException ( ) ; } return attr ; }
Clones this buffer but replaces all transport attributes with new attributes of the specified type .