use of jetbrains.exodus.bindings.ComparableSetBinding in project xodus by JetBrains.
the class PropertyTypes method clear.
public void clear() {
typesById.clear();
typesByClass.clear();
for (final ComparableValueType predefinedType : ComparableValueType.PREDEFINED_COMPARABLE_VALUE_TYPES) {
typesById.put(predefinedType.getTypeId(), predefinedType);
typesByClass.put(predefinedType.getClazz(), predefinedType);
}
final ComparableValueType comparableSetType = typesByClass.get(ComparableSet.class);
final ComparableSetBinding newBinding = new ComparableSetBinding() {
@Override
protected ComparableValueType getType(@NotNull Class<? extends Comparable> itemClass) {
final ComparableValueType result = super.getType(itemClass);
return result == null ? typesByClass.get(itemClass) : result;
}
@Override
protected ComparableBinding getBinding(int valueTypeId) {
final ComparableBinding result = super.getBinding(valueTypeId);
return result == null ? typesById.get(valueTypeId).getBinding() : result;
}
};
final int typeId = comparableSetType.getTypeId();
final ComparableValueType newComparableSetType = new ComparableValueType(typeId, newBinding, comparableSetType.getClazz());
typesByClass.put(ComparableSet.class, newComparableSetType);
typesById.put(typeId, newComparableSetType);
}
Aggregations