public Vector slice ( int from , int until ) { if ( until - from < 0 ) { fail ( "Wrong slice range: [" + from + ".." + until + "]." ) ; } Vector result = blankOfLength ( until - from ) ; for ( int i = from ; i < until ; i ++ ) { result . set ( i - from , get ( i ) ) ; } return result ; }
Retrieves the specified sub - vector of this vector . The sub - vector is specified by interval of indices .