public Tuple slice ( int start , int end ) { Preconditions . checkArgument ( start >= 0 , "Start index must be >= 0" ) ; Preconditions . checkArgument ( start < end , "Start index must be < end index" ) ; if ( start >= degree ( ) ) { return Tuple0 . INSTANCE ; } return new NTuple ( Arrays . copyOfRange ( array ( ) , start , Math . min ( end , degree ( ) ) ) ) ; }
Takes a slice of the tuple from an inclusive start to an exclusive end index .