项目:owsi-core-parent
文件:GroupBy2.java
/**
* @see #sortedTable(GroupExpression,GroupExpression,Comparator,Comparator)
*/
public static <R,C,V,R2> AbstractGroupExpression<Triplet<R,V>,RowSortedTable<R2,V>> sortedTable(
GroupExpression<R,R2> row,Expression<C> column,Expression<V> value,Comparator<? super R2> rowComparator,Comparator<? super C> columnComparator) {
return sortedTable(row,new GOne<C>(column),new GOne<V>(value),rowComparator,columnComparator);
}
项目:owsi-core-parent
文件:GroupBy2.java
/**
* @see #sortedTable(GroupExpression,C2> AbstractGroupExpression<Triplet<R,RowSortedTable<R,C2,V>> sortedTable(
Expression<R> row,GroupExpression<C,C2> column,Comparator<? super R> rowComparator,Comparator<? super C2> columnComparator) {
return sortedTable(new GOne<R>(row),column,R2,Comparator<? super C2> columnComparator) {
return sortedTable(row,V2> AbstractGroupExpression<Triplet<R,V2>> sortedTable(
Expression<R> row,GroupExpression<V,V2> value,Comparator<? super C> columnComparator) {
return sortedTable(new GOne<R>(row),value,V2>> sortedTable(
GroupExpression<R,columnComparator);
}
项目:owsi-core-parent
文件:GTable.java
@SuppressWarnings("rawtypes")
public static <R extends Comparable,C extends Comparable,V> GTable<R,V>>
createSorted(QTriplet<R,V> expr) {
return new GTable<R,V>>(expr) {
private static final long serialVersionUID = 1L;
@Override
protected RowSortedTable<R,V> createTable() {
return TreeBasedTable.<R,V>create();
}
};
}
项目:owsi-core-parent
文件:GTable.java
项目:pdptw-dataset-generator
文件:Dataset.java
@Override
public Iterator<T> iterator() {
final List<Iterator<T>> its = new ArrayList<>();
for (final Entry<Double,RowSortedTable<Long,Double,SortedSet<T>>> entry : data
.entrySet()) {
for (final SortedSet<T> set : entry.getValue().values()) {
its.add(set.iterator());
}
}
return Iterators.concat(its.iterator());
}
项目:guava-mock
文件:FreshValueGenerator.java
@SuppressWarnings("rawtypes") // TreeBasedTable.create() is defined as such
@Generates private static <R extends Comparable,V> RowSortedTable<R,V>
generateRowSortedTable(R row,C column,V value) {
return generateTreeBasedTable(row,value);
}
项目:guava-mock
文件:FreshValueGeneratorTest.java
public void testRowSortedTable() {
assertFreshInstance(new Typetoken<RowSortedTable<String,?,?>>() {});
}
项目:guava-mock
文件:ArbitraryInstancesTest.java
public void testGet_collections() {
assertEquals(ImmutableSet.of().iterator(),ArbitraryInstances.get(Iterator.class));
assertFalse(ArbitraryInstances.get(PeekingIterator.class).hasNext());
assertFalse(ArbitraryInstances.get(ListIterator.class).hasNext());
assertEquals(ImmutableSet.of(),ArbitraryInstances.get(Iterable.class));
assertEquals(ImmutableSet.of(),ArbitraryInstances.get(Set.class));
assertEquals(ImmutableSet.of(),ArbitraryInstances.get(ImmutableSet.class));
assertEquals(ImmutableSortedSet.of(),ArbitraryInstances.get(SortedSet.class));
assertEquals(ImmutableSortedSet.of(),ArbitraryInstances.get(ImmutableSortedSet.class));
assertEquals(ImmutableList.of(),ArbitraryInstances.get(Collection.class));
assertEquals(ImmutableList.of(),ArbitraryInstances.get(ImmutableCollection.class));
assertEquals(ImmutableList.of(),ArbitraryInstances.get(List.class));
assertEquals(ImmutableList.of(),ArbitraryInstances.get(ImmutableList.class));
assertEquals(ImmutableMap.of(),ArbitraryInstances.get(Map.class));
assertEquals(ImmutableMap.of(),ArbitraryInstances.get(ImmutableMap.class));
assertEquals(ImmutableSortedMap.of(),ArbitraryInstances.get(SortedMap.class));
assertEquals(ImmutableSortedMap.of(),ArbitraryInstances.get(ImmutableSortedMap.class));
assertEquals(ImmutableMultiset.of(),ArbitraryInstances.get(Multiset.class));
assertEquals(ImmutableMultiset.of(),ArbitraryInstances.get(ImmutableMultiset.class));
assertTrue(ArbitraryInstances.get(SortedMultiset.class).isEmpty());
assertEquals(ImmutableMultimap.of(),ArbitraryInstances.get(Multimap.class));
assertEquals(ImmutableMultimap.of(),ArbitraryInstances.get(ImmutableMultimap.class));
assertTrue(ArbitraryInstances.get(SortedSetMultimap.class).isEmpty());
assertEquals(ImmutableTable.of(),ArbitraryInstances.get(Table.class));
assertEquals(ImmutableTable.of(),ArbitraryInstances.get(ImmutableTable.class));
assertTrue(ArbitraryInstances.get(RowSortedTable.class).isEmpty());
assertEquals(ImmutableBiMap.of(),ArbitraryInstances.get(BiMap.class));
assertEquals(ImmutableBiMap.of(),ArbitraryInstances.get(ImmutableBiMap.class));
assertTrue(ArbitraryInstances.get(ImmutableClasstoInstanceMap.class).isEmpty());
assertTrue(ArbitraryInstances.get(ClasstoInstanceMap.class).isEmpty());
assertTrue(ArbitraryInstances.get(ListMultimap.class).isEmpty());
assertTrue(ArbitraryInstances.get(ImmutableListMultimap.class).isEmpty());
assertTrue(ArbitraryInstances.get(SetMultimap.class).isEmpty());
assertTrue(ArbitraryInstances.get(ImmutableSetMultimap.class).isEmpty());
assertTrue(ArbitraryInstances.get(MapDifference.class).areEqual());
assertTrue(ArbitraryInstances.get(SortedMapDifference.class).areEqual());
assertEquals(Range.all(),ArbitraryInstances.get(Range.class));
assertTrue(ArbitraryInstances.get(NavigableSet.class).isEmpty());
assertTrue(ArbitraryInstances.get(NavigableMap.class).isEmpty());
assertTrue(ArbitraryInstances.get(LinkedList.class).isEmpty());
assertTrue(ArbitraryInstances.get(Deque.class).isEmpty());
assertTrue(ArbitraryInstances.get(Queue.class).isEmpty());
assertTrue(ArbitraryInstances.get(PriorityQueue.class).isEmpty());
assertTrue(ArbitraryInstances.get(BitSet.class).isEmpty());
assertTrue(ArbitraryInstances.get(TreeSet.class).isEmpty());
assertTrue(ArbitraryInstances.get(TreeMap.class).isEmpty());
assertFreshInstanceReturned(
LinkedList.class,Deque.class,Queue.class,PriorityQueue.class,BitSet.class,TreeSet.class,TreeMap.class);
}
@SuppressWarnings("rawtypes") // TreeBasedTable.create() is defined as such
@Generates private static <R extends Comparable,value);
}
public void testRowSortedTable() {
assertFreshInstance(new Typetoken<RowSortedTable<String,?>>() {});
}
public void testGet_collections() {
assertEquals(ImmutableSet.of().iterator(),TreeMap.class);
}
项目:beam
文件:PipelineOptionsFactory.java
/**
* Outputs the set of options available to be set for the passed in {@link PipelineOptions}
* interface. The output is in a human readable format. The format is:
* <pre>
* OptionGroup:
* ... option group description ...
*
* --option1={@code <type>} or list of valid enum choices
* Default: value (if available,see {@link Default})
* ... option description ... (if available,see {@link Description})
* required groups (if available,see {@link required})
* --option2={@code <type>} or list of valid enum choices
* Default: value (if available,see {@link required})
* </pre>
* This method will attempt to format its output to be compatible with a terminal window.
*/
public static void printHelp(PrintStream out,Class<? extends PipelineOptions> iface) {
checkNotNull(out);
checkNotNull(iface);
validateWellFormed(iface,REGISTERED_OPTIONS);
Set<PipelineOptionSpec> properties =
PipelineOptionsReflector.getoptionSpecs(iface);
RowSortedTable<Class<?>,String,Method> ifacePropGetterTable = TreeBasedTable.create(
ClassNameComparator.INSTANCE,Ordering.natural());
for (PipelineOptionSpec prop : properties) {
ifacePropGetterTable.put(prop.getDefiningInterface(),prop.getName(),prop.getGetterMethod());
}
for (Map.Entry<Class<?>,Map<String,Method>> ifacetoPropertyMap :
ifacePropGetterTable.rowMap().entrySet()) {
Class<?> currentIface = ifacetoPropertyMap.getKey();
Map<String,Method> propertyNamesToGetters = ifacetoPropertyMap.getValue();
SortedSetMultimap<String,String> requiredGroupNametoProperties =
getrequiredGroupNamesToProperties(propertyNamesToGetters);
out.format("%s:%n",currentIface.getName());
prettyPrintDescription(out,currentIface.getAnnotation(Description.class));
out.println();
List<String> lists = Lists.newArrayList(propertyNamesToGetters.keySet());
Collections.sort(lists,String.CASE_INSENSITIVE_ORDER);
for (String propertyName : lists) {
Method method = propertyNamesToGetters.get(propertyName);
String printableType = method.getReturnType().getSimpleName();
if (method.getReturnType().isEnum()) {
printableType = Joiner.on(" | ").join(method.getReturnType().getEnumConstants());
}
out.format(" --%s=<%s>%n",propertyName,printableType);
Optional<String> defaultValue = getDefaultValueFromAnnotation(method);
if (defaultValue.isPresent()) {
out.format(" Default: %s%n",defaultValue.get());
}
prettyPrintDescription(out,method.getAnnotation(Description.class));
prettyPrintrequiredGroups(out,method.getAnnotation(Validation.required.class),requiredGroupNametoProperties);
}
out.println();
}
}
项目:owsi-core-parent
文件:GroupBy2.java
项目:owsi-core-parent
文件:GroupBy2.java
/**
* @see #sortedTable(GroupExpression,GroupExpression)
*/
public static <R,R2 extends Comparable<? super R2>>
AbstractGroupExpression<Triplet<R,Expression<V> value) {
return sortedTable(row,new GOne<V>(value));
}
项目:owsi-core-parent
文件:GroupBy2.java
项目:owsi-core-parent
文件:GroupBy2.java
项目:guava-libraries
文件:FreshValueGenerator.java
@SuppressWarnings("rawtypes") // TreeBasedTable.create() is defined as such
@Generates private static <R extends Comparable,value);
}
项目:guava-libraries
文件:FreshValueGeneratorTest.java
public void testRowSortedTable() {
assertFreshInstance(new Typetoken<RowSortedTable<String,?>>() {});
}
项目:guava-libraries
文件:ArbitraryInstancesTest.java
public void testGet_collections() {
assertEquals(ImmutableSet.of().iterator(),TreeMap.class);
}
项目:pdptw-dataset-generator
文件:Dataset.java
项目:guava
文件:FreshValueGenerator.java
@SuppressWarnings("rawtypes") // TreeBasedTable.create() is defined as such
@Generates
private static <R extends Comparable,V>
RowSortedTable<R,V> generateRowSortedTable(R row,value);
}
项目:guava
文件:FreshValueGeneratorTest.java
public void testRowSortedTable() {
assertFreshInstance(new Typetoken<RowSortedTable<String,?>>() {});
}
项目:guava
文件:ArbitraryInstancesTest.java
public void testGet_collections() {
assertEquals(ImmutableSet.of().iterator(),TreeMap.class);
}
项目:owsi-core-parent
文件:GroupBy2.java
/**
* Create a new aggregating table expression using a backing HashBasedRowSortedTable
*
* @param row
* row for the sortedTable entries
* @param column
* column for the sortedTable entries
* @param value
* value for the sortedTable entries
* @return wrapper expression
*/
public static <R,V2> value) {
return new GTable.Mixin<R,V2,V2>>(
row,GTable.createSorted(QTriplet.create(row,value))
);
}
项目:owsi-core-parent
文件:GroupBy2.java
/**
* Create a new aggregating table expression using a backing HashBasedRowSortedTable
*
* @param row
* row for the sortedTable entries
* @param column
* column for the sortedTable entries
* @param value
* value for the sortedTable entries
* @return wrapper expression
*/
public static <R,Comparator<? super C2> columnComparator) {
return new GTable.Mixin<R,columnComparator)
);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。