Package org.apache.calcite.util.mapping
Enum MappingType
- All Implemented Interfaces:
- Serializable,- Comparable<MappingType>,- Constable
Describes the type of a mapping, from the most general
 
MULTI_FUNCTION (every element in the source and target domain can
 participate in many mappings) to the most restricted BIJECTION (every
 element in the source and target domain must be paired with precisely one
 element in the other domain).
 Some common types:
- A surjection is a mapping if every target has at least one source; also known as an 'onto' mapping.
- A mapping is a partial function if every source has at most one target.
- A mapping is a function if every source has precisely one target.
- An injection is a mapping where a target has at most one source; also somewhat confusingly known as a 'one-to-one' mapping.
- A bijection is a mapping which is both an injection and a surjection. Every source has precisely one target, and vice versa.
Once you know what type of mapping you want, call
 Mappings.create(MappingType, int, int) to create an efficient
 implementation of that mapping.
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionAn inverse function has a source for every target, but a source might have 0, 1 or more targets.An inverse surjection has a source for every target, and no source has more than one target.A partial surjection has no more than one source for any target, and no more than one target for any source.
- 
Method SummaryModifier and TypeMethodDescriptioninverse()booleanisA(MappingType mappingType) Returns whether this mapping type is (possibly a weaker form of) a given mapping type.booleanA mapping is a bijection if it is a surjection and it is an injection.booleanA mapping is a total function if every source has precisely one target.booleanA mapping is an injection if it is a function and no target has more than one source.booleanConstraint that every target has at least one source.booleanConstraint that every source has at least one target.booleanA mapping is a partial function if every source has at most one target.booleanConstraint that every target has at most one source.booleanConstraint that every source has at most one target.booleanA mapping is a surjection if it is a function and every target has at least one source.static MappingTypeReturns the enum constant of this type with the specified name.static MappingType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
- 
Enum Constant Details- 
BIJECTION
- 
SURJECTION
- 
INJECTION
- 
FUNCTION
- 
INVERSE_SURJECTIONAn inverse surjection has a source for every target, and no source has more than one target.
- 
PARTIAL_SURJECTIONA partial surjection has no more than one source for any target, and no more than one target for any source.
- 
PARTIAL_INJECTION
- 
PARTIAL_FUNCTION
- 
INVERSE_INJECTION
- 
INVERSE_PARTIAL_INJECTION
- 
TEN
- 
ELEVEN
- 
INVERSE_FUNCTIONAn inverse function has a source for every target, but a source might have 0, 1 or more targets.Obeys the constraints isMandatorySource(),isSingleSource().Similar types: -  INVERSE_SURJECTIONis stronger (a source may not have multiple targets);
- INVERSE_PARTIAL_FUNCTIONis weaker (a target may have 0 or 1 sources).
 
-  
- 
INVERSE_PARTIAL_FUNCTION
- 
FOURTEEN
- 
MULTI_FUNCTION
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
 
- 
valueOfReturns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum type has no constant with the specified name
- NullPointerException- if the argument is null
 
- 
inverse
- 
isA
- 
isFunctionpublic boolean isFunction()A mapping is a total function if every source has precisely one target.
- 
isPartialFunctionpublic boolean isPartialFunction()A mapping is a partial function if every source has at most one target.
- 
isSurjectionpublic boolean isSurjection()A mapping is a surjection if it is a function and every target has at least one source.
- 
isInjectionpublic boolean isInjection()A mapping is an injection if it is a function and no target has more than one source. (In other words, every source has precisely one target.)
- 
isBijectionpublic boolean isBijection()A mapping is a bijection if it is a surjection and it is an injection. (In other words,
- 
isMandatoryTargetpublic boolean isMandatoryTarget()Constraint that every source has at least one target.
- 
isSingleTargetpublic boolean isSingleTarget()Constraint that every source has at most one target.
- 
isMandatorySourcepublic boolean isMandatorySource()Constraint that every target has at least one source.
- 
isSingleSourcepublic boolean isSingleSource()Constraint that every target has at most one source.
 
-