public final class ObjectProduct<T>
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
ObjectProduct<T> |
dividedBy(ObjectProduct<T> other)
Calculates the quotient of two products
|
static <T> ObjectProduct<T> |
empty()
Returns an empty ObjectProduct of a certain type
|
boolean |
equals(java.lang.Object obj) |
java.util.Map<T,java.lang.Integer> |
exponentMap() |
static <T> ObjectProduct<T> |
fromExponentMapping(java.util.Map<T,java.lang.Integer> map)
Gets an
ObjectProduct from an object-to-integer mapping |
java.util.Set<T> |
getBaseSet() |
int |
getExponent(T dimension)
Gets the exponent for a specific dimension.
|
int |
hashCode() |
boolean |
isSingleObject() |
static <T> ObjectProduct<T> |
oneOf(T object)
Gets an ObjectProduct that has one of the inputted argument, and nothing else.
|
ObjectProduct<T> |
times(ObjectProduct<T> other)
Multiplies this product by another
|
ObjectProduct<T> |
toExponent(int exponent)
Returns this product, but to an exponent
|
java.lang.String |
toString()
Converts this product to a string using the objects'
Object.toString() method. |
java.lang.String |
toString(java.util.function.Function<T,java.lang.String> objectToString)
Converts this product to a string.
|
public static final <T> ObjectProduct<T> empty()
T
- type of objects that can be multipliedpublic static final <T> ObjectProduct<T> fromExponentMapping(java.util.Map<T,java.lang.Integer> map)
ObjectProduct
from an object-to-integer mappingT
- type of object in productmap
- map mapping objects to exponentspublic static final <T> ObjectProduct<T> oneOf(T object)
object
- object that will be in the productjava.lang.NullPointerException
- if object is nullpublic ObjectProduct<T> dividedBy(ObjectProduct<T> other)
other
- other productjava.lang.NullPointerException
- if other is nullpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.util.Map<T,java.lang.Integer> exponentMap()
public final java.util.Set<T> getBaseSet()
public int getExponent(T dimension)
dimension
- dimension to checkpublic int hashCode()
hashCode
in class java.lang.Object
public boolean isSingleObject()
public ObjectProduct<T> times(ObjectProduct<T> other)
other
- other productjava.lang.NullPointerException
- if other is nullpublic ObjectProduct<T> toExponent(int exponent)
exponent
- exponentpublic java.lang.String toString()
Object.toString()
method. If objects have a long
toString representation, it is recommended to use toString(Function)
instead to shorten the returned
string.
toString
in class java.lang.Object
public java.lang.String toString(java.util.function.Function<T,java.lang.String> objectToString)
objectToString
objectToString
- function to convert objects to strings