本文整理汇总了Java中org.apache.flink.api.common.typeutils.base.StringComparator类的典型用法代码示例。如果您正苦于以下问题:Java StringComparator类的具体用法?Java StringComparator怎么用?Java StringComparator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StringComparator类属于org.apache.flink.api.common.typeutils.base包,在下文中一共展示了StringComparator类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createComparator
import org.apache.flink.api.common.typeutils.base.StringComparator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>> createComparator(
boolean ascending) {
return new TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>>(
new int[] { 0 },
new TypeComparator[] {
new TupleComparator<Tuple2<String, Double>>(
new int[] { 0, 1 },
new TypeComparator[] {
new StringComparator(ascending),
new DoubleComparator(ascending) },
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }) },
new TypeSerializer[] {
new TupleSerializer<Tuple2<String, Double>>(
(Class<Tuple2<String, Double>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Long, Long>>(
(Class<Tuple2<Long, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Integer, Long>>(
(Class<Tuple2<Integer, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) });
}
示例2: createComparator
import org.apache.flink.api.common.typeutils.base.StringComparator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>> createComparator(
boolean ascending) {
return new TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>>(
new int[] { 0, 2 },
new TypeComparator[] {
new TupleComparator<Tuple2<String, Double>>(
new int[] { 0, 1 },
new TypeComparator[] {
new StringComparator(ascending),
new DoubleComparator(ascending) },
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleComparator<Tuple2<Integer, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new IntComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) },
new TypeSerializer[] {
new TupleSerializer<Tuple2<String, Double>>(
(Class<Tuple2<String, Double>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Long, Long>>(
(Class<Tuple2<Long, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Integer, Long>>(
(Class<Tuple2<Integer, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) });
}
示例3: createComparator
import org.apache.flink.api.common.typeutils.base.StringComparator; //导入依赖的package包/类
@Override
protected TupleComparator<Tuple3<Integer, String, Double>> createComparator(boolean ascending) {
return new TupleComparator<Tuple3<Integer, String, Double>>(
new int[]{0, 1},
new TypeComparator[]{
new IntComparator(ascending),
new StringComparator(ascending)
},
new TypeSerializer[]{ IntSerializer.INSTANCE, StringSerializer.INSTANCE, DoubleSerializer.INSTANCE });
}
示例4: createComparator
import org.apache.flink.api.common.typeutils.base.StringComparator; //导入依赖的package包/类
@Override
protected TupleComparator<Tuple3<Integer, String, Double>> createComparator(boolean ascending) {
return new TupleComparator<Tuple3<Integer, String, Double>>(
new int[]{0, 1, 2},
new TypeComparator[]{
new IntComparator(ascending),
new StringComparator(ascending),
new DoubleComparator(ascending)
},
new TypeSerializer[]{ IntSerializer.INSTANCE, StringSerializer.INSTANCE, DoubleSerializer.INSTANCE });
}
示例5: createComparator
import org.apache.flink.api.common.typeutils.base.StringComparator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>> createComparator(
boolean ascending) {
return new TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>>(
new int[] { 0, 1, 2 },
new TypeComparator[] {
new TupleComparator<Tuple2<String, Double>>(
new int[] { 0, 1 },
new TypeComparator[] {
new StringComparator(ascending),
new DoubleComparator(ascending) },
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleComparator<Tuple2<Long, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new LongComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleComparator<Tuple2<Integer, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new IntComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) },
new TypeSerializer[] {
new TupleSerializer<Tuple2<String, Double>>(
(Class<Tuple2<String, Double>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Long, Long>>(
(Class<Tuple2<Long, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Integer, Long>>(
(Class<Tuple2<Integer, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) });
}
示例6: createComparator
import org.apache.flink.api.common.typeutils.base.StringComparator; //导入依赖的package包/类
@Override
protected TypeComparator<String> createComparator(boolean ascending) {
return new StringComparator(ascending);
}
示例7: createComparator
import org.apache.flink.api.common.typeutils.base.StringComparator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>> createComparator(
boolean ascending) {
return new TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>>(
new int[] { 0 },
new TypeComparator[] {
new TupleComparator<Tuple2<String, Double>>(
new int[] { 0, 1 },
new TypeComparator[] {
new StringComparator(ascending),
new DoubleComparator(ascending) },
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleComparator<Tuple2<Long, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new LongComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleComparator<Tuple2<Integer, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new IntComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) },
new TypeSerializer[] {
new TupleSerializer<Tuple2<String, Double>>(
(Class<Tuple2<String, Double>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Long, Long>>(
(Class<Tuple2<Long, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Integer, Long>>(
(Class<Tuple2<Integer, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) });
}
示例8: createComparator
import org.apache.flink.api.common.typeutils.base.StringComparator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>> createComparator(
boolean ascending) {
return new TupleComparator<Tuple3<Tuple2<String, Double>, Tuple2<Long, Long>, Tuple2<Integer, Long>>>(
new int[] { 0, 2 },
new TypeComparator[] {
new TupleComparator<Tuple2<String, Double>>(
new int[] { 0, 1 },
new TypeComparator[] {
new StringComparator(ascending),
new DoubleComparator(ascending) },
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleComparator<Tuple2<Long, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new LongComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleComparator<Tuple2<Integer, Long>>(
new int[] { 0, 1 },
new TypeComparator[] {
new IntComparator(ascending),
new LongComparator(ascending) },
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) },
new TypeSerializer[] {
new TupleSerializer<Tuple2<String, Double>>(
(Class<Tuple2<String, Double>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
StringSerializer.INSTANCE,
DoubleSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Long, Long>>(
(Class<Tuple2<Long, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
LongSerializer.INSTANCE,
LongSerializer.INSTANCE }),
new TupleSerializer<Tuple2<Integer, Long>>(
(Class<Tuple2<Integer, Long>>) (Class<?>) Tuple2.class,
new TypeSerializer[] {
IntSerializer.INSTANCE,
LongSerializer.INSTANCE }) });
}