You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Alex Herbert (Jira)" <ji...@apache.org> on 2021/06/07 11:06:00 UTC

[jira] [Created] (RNG-143) Instance create() method for RandomSource

Alex Herbert created RNG-143:
--------------------------------

             Summary: Instance create() method for RandomSource
                 Key: RNG-143
                 URL: https://issues.apache.org/jira/browse/RNG-143
             Project: Commons RNG
          Issue Type: New Feature
          Components: simple
    Affects Versions: 1.3
            Reporter: Alex Herbert


This is a wish for an instance {{create}} method for RandomSource:

{code:java}
public RestorableUniformRandomProvider create() {
    return create(this);
}

public RestorableUniformRandomProvider create(Object seed,
                                              Object... data) {
    return create(this, seed, data);
}
{code}

It is syntactic sugar to avoid typing the use of the static factory method and repeating {{RandomSource}} in close succession:

{code:java}
RandomSource.create(RandomSource.MT);
RandomSource.create(RandomSource.MT, 12345L);
{code}

Becomes:

{code:java}
RandomSource.MT.create();
RandomSource.MT.create(12345L);
{code}

It would make the use of the static factory method redundant, which could be deprecated.

Opinions on this?





--
This message was sent by Atlassian Jira
(v8.3.4#803005)