Tabnine Logo
ATypeTag.ordinal
Code IndexAdd Tabnine to your IDE (free)

How to use
ordinal
method
in
org.apache.asterix.om.types.ATypeTag

Best Java code snippets using org.apache.asterix.om.types.ATypeTag.ordinal (Showing top 14 results out of 315)

origin: apache/asterixdb

@Override
protected ATypeTag getNumericResultType(ATypeTag argTypeMax) {
  return argTypeMax.ordinal() < ATypeTag.FLOAT.ordinal() ? ATypeTag.DOUBLE : argTypeMax;
}
origin: apache/asterixdb

public static boolean canPromote(ATypeTag type1, ATypeTag type2) {
  return typePromotionHierachyMap.get(type1.ordinal() * ATypeTag.TYPE_COUNT + type2.ordinal());
}
origin: apache/asterixdb

private static void addPromotionRule(ATypeTag type1, ATypeTag type2, ITypeConvertComputer promoteComputer) {
  int index = type1.ordinal() * ATypeTag.TYPE_COUNT + type2.ordinal();
  typePromotionHierachyMap.set(index);
  promoteComputerMap.put(index, promoteComputer);
}
origin: apache/asterixdb

public static boolean canDemote(ATypeTag type1, ATypeTag type2) {
  return typeDemotionHierachyMap.get(type1.ordinal() * ATypeTag.TYPE_COUNT + type2.ordinal());
}
origin: apache/asterixdb

private static void addDemotionRule(ATypeTag type1, ATypeTag type2, ITypeConvertComputer demoteStrictComputer,
    ITypeConvertComputer demoteLenientComputer) {
  int index = type1.ordinal() * ATypeTag.TYPE_COUNT + type2.ordinal();
  typeDemotionHierachyMap.set(index);
  demoteComputerMap.put(index, Pair.of(demoteStrictComputer, demoteLenientComputer));
}
origin: apache/asterixdb

public static ITypeConvertComputer getTypePromoteComputer(ATypeTag type1, ATypeTag type2) {
  if (canPromote(type1, type2)) {
    return promoteComputerMap.get(type1.ordinal() * ATypeTag.TYPE_COUNT + type2.ordinal());
  }
  return null;
}
origin: apache/asterixdb

public static ITypeConvertComputer getTypeDemoteComputer(ATypeTag type1, ATypeTag type2, boolean strict) {
  if (canDemote(type1, type2)) {
    Pair<ITypeConvertComputer, ITypeConvertComputer> pair =
        demoteComputerMap.get(type1.ordinal() * ATypeTag.TYPE_COUNT + type2.ordinal());
    return strict ? pair.getLeft() : pair.getRight();
  }
  return null;
}
origin: apache/asterixdb

@Override
public void writeToFuncArgs(List<Mutable<ILogicalExpression>> funcArgs) {
  super.writeToFuncArgs(funcArgs);
  // Write search modifier type.
  funcArgs.add(new MutableObject<ILogicalExpression>(
      AccessMethodUtils.createInt32Constant(searchModifierType.ordinal())));
  // Write similarity threshold.
  funcArgs.add(new MutableObject<ILogicalExpression>(new ConstantExpression(similarityThreshold)));
  // Write search key type.
  funcArgs.add(
      new MutableObject<ILogicalExpression>(AccessMethodUtils.createInt32Constant(searchKeyType.ordinal())));
  // Write full-text search information.
  funcArgs.add(
      new MutableObject<ILogicalExpression>(AccessMethodUtils.createBooleanConstant(isFullTextSearchQuery)));
  // Write key var list.
  writeVarList(keyVarList, funcArgs);
  // Write non-key var list.
  if (nonKeyVarList != null) {
    writeVarList(nonKeyVarList, funcArgs);
  }
}
origin: apache/asterixdb

  aggType = typeTag;
} else if (typeTag != ATypeTag.SYSTEM_NULL && !ATypeHierarchy.isCompatible(typeTag, aggType)) {
  if (typeTag.ordinal() > aggType.ordinal()) {
    throw new IncompatibleTypeException(sourceLoc, BuiltinFunctions.AVG, data[offset], aggType.serialize());
  } else {
origin: apache/asterixdb

  aggType = typeTag;
} else if (typeTag != ATypeTag.SYSTEM_NULL && !ATypeHierarchy.isCompatible(typeTag, aggType)) {
  if (typeTag.ordinal() > aggType.ordinal()) {
    throw new IncompatibleTypeException(sourceLoc, getFunctionIdentifier(), data[offset],
        aggType.serialize());
origin: apache/asterixdb

  aggType = typeTag;
} else if (typeTag != ATypeTag.SYSTEM_NULL && !ATypeHierarchy.isCompatible(typeTag, aggType)) {
  if (typeTag.ordinal() > aggType.ordinal()) {
    throw new IncompatibleTypeException(sourceLoc, BuiltinFunctions.AVG, bytes[offset],
        aggType.serialize());
origin: apache/asterixdb

  aggType = typeTag;
} else if (typeTag != ATypeTag.SYSTEM_NULL && !ATypeHierarchy.isCompatible(typeTag, aggType)) {
  if (typeTag.ordinal() > aggType.ordinal()) {
    throw new IncompatibleTypeException(sourceLoc, getFunctionIdentifier(), bytes[offset],
        aggType.serialize());
origin: apache/asterixdb

if (typeTag.ordinal() > aggType.ordinal()) {
  throw new IncompatibleTypeException(sourceLoc, "min/max", typeTag.serialize(), aggType.serialize());
} else {
origin: apache/asterixdb

private static void generateTests(List<Object[]> outTests, IAType inType, IAType targetType) {
  int value = inType.getTypeTag().ordinal();
  addTest(outTests, inType, createValue(inType, value), targetType, createValue(targetType, value));
  if (ATypeHierarchy.canDemote(inType.getTypeTag(), targetType.getTypeTag())) {
    IAObject inMax = createValue(inType, getMax(inType));
    IAObject inMin = createValue(inType, getMin(inType));
    IAObject targetMax = createValue(targetType, getMax(targetType));
    IAObject targetMin = createValue(targetType, getMin(targetType));
    addTest(outTests, inType, inMax, targetType, targetMax);
    addTest(outTests, inType, inMin, targetType, targetMin);
    if (!isInteger(inType) && isInteger(targetType)) {
      addTest(outTests, inType, createValue(inType, getPositiveInfinity(inType)), targetType, targetMax);
      addTest(outTests, inType, createValue(inType, getNegativeInfinity(inType)), targetType, targetMin);
      addTest(outTests, inType, createValue(inType, getNaN(inType)), targetType, createValue(targetType, 0));
    }
  }
}
org.apache.asterix.om.typesATypeTagordinal

Popular methods of ATypeTag

  • serialize
  • isDerivedType
  • equals
  • isListType
  • toString
  • hashCode
  • name
  • values

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSharedPreferences (Context)
  • getResourceAsStream (ClassLoader)
  • Permission (java.security)
    Legacy security code; do not use.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • JFrame (javax.swing)
  • JTextField (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now