Skip to content

One Tuple class to rule them all #3

@bmccutchon

Description

@bmccutchon

I'd like to be able to write methods like this:

public static <T> Tuple<T> average(Tuple<T>... tuples) {

...rather than writing multiple methods to handle the different types of Tuples.

This could be accomplished by declaring a new Tuple class that Tuple3d, Tuple2f, etc. will extend, like so:

public class Tuple<T extends Tuple<T>> {

And in the extending classes:

public class Tuple3f extends Tuple<Tuple3f> {

If you like the idea, I might fork the project and work on it myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions