/** * Convenience method to create a new, empty {@code DefaultKeyValuePair}. * * @param <KeyType> * The type of the key. * @param <ValueType> * The type of the value. * @return * A new, empty key-value pair. */ public static <KeyType, ValueType> DefaultKeyValuePair<KeyType, ValueType> create() { return new DefaultKeyValuePair<KeyType, ValueType>(); }
@Override public ValueType getSecond() { return this.getValue(); }
@Override public KeyType getFirst() { return this.getKey(); }
@Override public ValueType getSecond() { return this.getValue(); }
@Override public KeyType getFirst() { return this.getKey(); }
/** * Convenience method to create a new, empty {@code DefaultKeyValuePair}. * * @param <KeyType> * The type of the key. * @param <ValueType> * The type of the value. * @return * A new, empty key-value pair. */ public static <KeyType, ValueType> DefaultKeyValuePair<KeyType, ValueType> create() { return new DefaultKeyValuePair<KeyType, ValueType>(); }
@Override public ValueType getSecond() { return this.getValue(); }
@Override public KeyType getFirst() { return this.getKey(); }
/** * Convenience method to create a new, empty {@code DefaultKeyValuePair}. * * @param <KeyType> * The type of the key. * @param <ValueType> * The type of the value. * @return * A new, empty key-value pair. */ public static <KeyType, ValueType> DefaultKeyValuePair<KeyType, ValueType> create() { return new DefaultKeyValuePair<KeyType, ValueType>(); }
/** * * Convenience method to create a new {@code DefaultKeyValuePair} from the * given key and value. * * @param <KeyType> * The type of the key. * @param <ValueType> * The type of the value. * @param key * The key. * @param value * The value. * @return * A new, empty key-value pair. */ public static <KeyType, ValueType> DefaultKeyValuePair<KeyType, ValueType> create( final KeyType key, final ValueType value) { return new DefaultKeyValuePair<KeyType, ValueType>(key, value); }
/** * * Convenience method to create a new {@code DefaultKeyValuePair} from the * given key and value. * * @param <KeyType> * The type of the key. * @param <ValueType> * The type of the value. * @param key * The key. * @param value * The value. * @return * A new, empty key-value pair. */ public static <KeyType, ValueType> DefaultKeyValuePair<KeyType, ValueType> create( final KeyType key, final ValueType value) { return new DefaultKeyValuePair<KeyType, ValueType>(key, value); }
/** * * Convenience method to create a new {@code DefaultKeyValuePair} from the * given key and value. * * @param <KeyType> * The type of the key. * @param <ValueType> * The type of the value. * @param key * The key. * @param value * The value. * @return * A new, empty key-value pair. */ public static <KeyType, ValueType> DefaultKeyValuePair<KeyType, ValueType> create( final KeyType key, final ValueType value) { return new DefaultKeyValuePair<KeyType, ValueType>(key, value); }
/** * Helper that returns the endpoint values for the input edge id. * * Execution: O(1) (one time O(m log m) cost after addEdges is called to get * the edges in the right order) * * @param i The edge id to search for * @return the endpoint values for the input edge id */ @Override public Pair<Integer, Integer> getEdgeEndpointIds(int i) { optimizeEdges(); return new DefaultKeyValuePair<>(edges.get(2 * i + 0), edges.get(2 * i + 1)); }
for (int i = 0; i < n; ++i) degreeList.add(new DefaultKeyValuePair<>(i, degree(i))); Pair<Integer, Integer> otherOrder = new DefaultKeyValuePair<>( edge.getSecond(), edge.getFirst()); if (!edgeMap.containsKey(otherOrder)) allNodeTriangles.get(i).add(new DefaultKeyValuePair<>( neighborj, neighbork)); allNodeTriangles.get(neighborj).add( new DefaultKeyValuePair<>(i, neighbork)); allNodeTriangles.get(neighbork).add( new DefaultKeyValuePair<>(i, neighborj)); Pair<Integer, Integer> edge = new DefaultKeyValuePair<>( i, neighborj); for (int edgeId : edgeMap.get(edge)) edge = new DefaultKeyValuePair<>(i, neighbork); for (int edgeId : edgeMap.get(edge)) edge = new DefaultKeyValuePair<>(neighborj, neighbork); for (int edgeId : edgeMap.get(edge))