@Override public boolean deepEqual(IAObject obj) { if (obj == this) { return true; } if (!(obj instanceof BuiltinType)) { return false; } return ((BuiltinType) obj).getTypeTag().equals(getTypeTag()); }
@Override public boolean equals(Object object) { return object instanceof IAObject && deepEqual((IAObject) object); }
private static IAType getTypeInfo(String paramType, MetadataTransactionContext txnCtx, Function function) throws AlgebricksException { if (paramType.equalsIgnoreCase(BuiltinType.AINT32.getDisplayName())) { return BuiltinType.AINT32; } else if (paramType.equalsIgnoreCase(BuiltinType.AFLOAT.getDisplayName())) { return BuiltinType.AFLOAT; } else if (paramType.equalsIgnoreCase(BuiltinType.ASTRING.getDisplayName())) { return BuiltinType.ASTRING; } else if (paramType.equalsIgnoreCase(BuiltinType.ADOUBLE.getDisplayName())) { return BuiltinType.ADOUBLE; } else if (paramType.equalsIgnoreCase(BuiltinType.ABOOLEAN.getDisplayName())) { return BuiltinType.ABOOLEAN; } else if (paramType.equalsIgnoreCase(BuiltinType.APOINT.getDisplayName())) { return BuiltinType.APOINT; } else if (paramType.equalsIgnoreCase(BuiltinType.ADATE.getDisplayName())) { return BuiltinType.ADATE; } else if (paramType.equalsIgnoreCase(BuiltinType.ADATETIME.getDisplayName())) { return BuiltinType.ADATETIME; } else if (paramType.equalsIgnoreCase(BuiltinType.APOINT3D.getDisplayName())) { return BuiltinType.APOINT3D; } else if (paramType.equalsIgnoreCase(BuiltinType.ALINE.getDisplayName())) { return BuiltinType.ALINE; } else if (paramType.equalsIgnoreCase(BuiltinType.ACIRCLE.getDisplayName())) { return BuiltinType.ACIRCLE; } else if (paramType.equalsIgnoreCase(BuiltinType.ARECTANGLE.getDisplayName())) { return BuiltinType.ARECTANGLE; } else {
private static String getConstructor(IAType t) throws Exception { if (t instanceof BuiltinType) { String s = ((BuiltinType) t).getConstructor(); if (s == null) { throw new Exception("Type " + t + " has no constructors."); } return s; } else { throw new Exception("No string constructor for type " + t); } }
@Override public int hash() { return getType().getTypeTag().serialize(); }
@Override public int hashCode() { return getTypeTag().hashCode(); }
@Override public void write(DataOutput dataOutput, long position) throws IOException { dataOutput.writeByte(BuiltinType.AINT64.getTypeTag().serialize()); dataOutput.writeLong(position); }
@Override public String toString() { return getTypeTag().toString(); }
switch (fieldType.getTypeTag()) { case STRING: out.write(BuiltinType.ASTRING.getTypeTag().serialize()); utf8Writer.writeUTF8(fieldObj.asText(), out); break; break; case INTEGER: out.write(BuiltinType.AINT32.getTypeTag().serialize()); out.writeInt(fieldObj.asInt()); break; case DOUBLE: out.write(BuiltinType.ADOUBLE.getTypeTag().serialize()); out.writeDouble(fieldObj.asDouble()); break; case BOOLEAN: out.write(BuiltinType.ABOOLEAN.getTypeTag().serialize()); out.writeBoolean(fieldObj.asBoolean()); break; nullSerde.serialize(ANull.NULL, out); } else if (fieldObj.isInt()) { out.write(BuiltinType.AINT32.getTypeTag().serialize()); out.writeInt(fieldObj.asInt()); } else if (fieldObj.isBoolean()) { out.write(BuiltinType.ABOOLEAN.getTypeTag().serialize()); out.writeBoolean(fieldObj.asBoolean()); } else if (fieldObj.isDouble()) { out.write(BuiltinType.ADOUBLE.getTypeTag().serialize());
if (keyPairType.first.getTypeTag() == BuiltinType.APOINT.getTypeTag() || keyPairType.first.getTypeTag() == BuiltinType.ARECTANGLE.getTypeTag()) { isIndexOnlyPlan = true;