com.twitter.algebird.javaapi.Monoids Maven / Gradle / Ivy
/*
Copyright 2014 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.twitter.algebird.javaapi;
import com.twitter.algebird.Monoid;
import com.twitter.algebird.Monoid$;
import com.twitter.algebird.Semigroup;
/**
*
* help use the Monoids from Java
*
* @author Julien Le Dem
*
*/
public class Monoids {
private Monoids() {}
private static final Monoid$ MODULE = Monoid$.MODULE$;
private static final MethodRegistry registry = new MethodRegistry(MODULE, Monoid.class);
/**
* @param c the type of the elements
* @return a monoid of c
*/
public static Monoid monoid(Class c) {
@SuppressWarnings("unchecked")
Monoid m = (Monoid)registry.resolveAndInvoke(c);
return m;
}
public static Monoid boolMonoid() { return MODULE.jboolMonoid(); }
public static Monoid intMonoid() { return MODULE.jintMonoid(); }
public static Monoid shortMonoid() { return MODULE.jshortMonoid(); }
public static Monoid bigIntMonoid() { return MODULE.bigIntMonoid(); }
public static Monoid longMonoid() { return MODULE.jlongMonoid(); }
public static Monoid floatMonoid() { return MODULE.jfloatMonoid(); }
public static Monoid doubleMonoid() { return MODULE.jdoubleMonoid(); }
public static Monoid stringMonoid() { return MODULE.stringMonoid(); }
public static Monoid> optionMonoid(Semigroup componentSemigroup) { return MODULE.optionMonoid(componentSemigroup); }
public static Monoid> listMonoid() { return MODULE.listMonoid(); }
public static Monoid> seqMonoid() { return MODULE.seqMonoid(); }
public static Monoid> indexedSeqMonoid(Monoid componentMonoid) { return MODULE.indexedSeqMonoid(componentMonoid); }
public static Monoid> jlistMonoid() { return MODULE.jlistMonoid(); }
public static Monoid> setMonoid() { return MODULE.setMonoid(); }
public static Monoid> mapMonoid(Semigroup componentSemigroup) { return MODULE.mapMonoid(componentSemigroup); }
public static Monoid> scMapMonoid(Semigroup componentSemigroup) { return MODULE.scMapMonoid(componentSemigroup); }
public static Monoid> jmapMonoid(Semigroup componentSemigroup) { return MODULE.jmapMonoid(componentSemigroup); }
public static Monoid> function1Monoid() { return MODULE.function1Monoid(); }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy