int pcode_10n9 ( int [ ] pos , int [ ] dlen , int hoff , int len , boolean isZ ) { ArrayList dims = new ArrayList ( ) ; Variable v ; int vlen = 0 ; for ( int i = 0 ; i < len ; i ++ ) { vlen = vlen + dlen [ i ] ; } Dimension sDim = new Dimension ( "unlinkedVectorSize" , vlen ) ; ncfile . addDimension ( null , sDim ) ; dims . add ( sDim ) ; Structure dist = new Structure ( ncfile , null , null , "unlinkedVectorStruct" ) ; dist . setDimensions ( dims ) ; ncfile . addVariable ( null , dist ) ; dist . addAttribute ( new Attribute ( CDM . LONG_NAME , "Unlinked Vector Packet" ) ) ; v = new Variable ( ncfile , null , null , "iValue" ) ; v . setDataType ( DataType . SHORT ) ; v . setDimensions ( ( String ) null ) ; dist . addMemberVariable ( v ) ; Variable ii0 = new Variable ( ncfile , null , dist , "x_start" ) ; ii0 . setDimensions ( ( String ) null ) ; ii0 . setDataType ( DataType . SHORT ) ; dist . addMemberVariable ( ii0 ) ; Variable ii1 = new Variable ( ncfile , null , dist , "y_start" ) ; ii1 . setDimensions ( ( String ) null ) ; ii1 . setDataType ( DataType . SHORT ) ; dist . addMemberVariable ( ii1 ) ; Variable jj0 = new Variable ( ncfile , null , dist , "x_end" ) ; jj0 . setDimensions ( ( String ) null ) ; jj0 . setDataType ( DataType . SHORT ) ; dist . addMemberVariable ( jj0 ) ; Variable jj1 = new Variable ( ncfile , null , dist , "y_end" ) ; jj1 . setDimensions ( ( String ) null ) ; jj1 . setDataType ( DataType . SHORT ) ; dist . addMemberVariable ( jj1 ) ; int [ ] pos1 = new int [ len ] ; int [ ] dlen1 = new int [ len ] ; System . arraycopy ( pos , 0 , pos1 , 0 , len ) ; System . arraycopy ( dlen , 0 , dlen1 , 0 , len ) ; dist . setSPobject ( new Vinfo ( 0 , 0 , 0 , 0 , hoff , 0 , isR , isZ , pos1 , dlen1 , 10 , 0 ) ) ; return 1 ; }
construct a dataset for linked vector packet and unlinked vector packet