Java 类org.apache.commons.collections4.KeyValue 实例源码

项目:sosiefier    文件:UnmodifiableMapEntryTest.java   
/** 
     * Subclasses should override this method.
     */
@Override
    @SuppressWarnings(value = "unchecked")
    public void testConstructors() {
        fr.inria.diversify.testamplification.logger.Logger.writeTestStart(Thread.currentThread(),this, "testConstructors");
        Map.Entry<K, V> entry = new UnmodifiableMapEntry<K, V>(((K)(key)) , ((V)(value)));
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2575,key);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2577,entry,2576,entry.getKey());
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2578,value);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2580,entry,2579,entry.getValue());
        final KeyValue<K, V> pair = new DefaultKeyValue<K, V>(((K)(key)) , ((V)(value)));
        entry = new UnmodifiableMapEntry<K, V>(pair);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2581,key);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2583,entry,2582,entry.getKey());
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2584,value);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2586,entry,2585,entry.getValue());
        final Map.Entry<K, V> entry2 = new UnmodifiableMapEntry<K, V>(entry);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2587,key);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2589,entry2,2588,entry2.getKey());
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2590,value);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2592,entry2,2591,entry2.getValue());
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2593,(entry instanceof org.apache.commons.collections4.Unmodifiable));
        fr.inria.diversify.testamplification.logger.Logger.writeTestFinish(Thread.currentThread());
    }
项目:sosiefier    文件:UnmodifiableMapEntryTest.java   
/** 
     * Subclasses should override this method.
     */
@SuppressWarnings(value = "unchecked")
    public void testConstructors_literalMutation928() {
        fr.inria.diversify.testamplification.logger.Logger.writeTestStart(Thread.currentThread(),this, "testConstructors_literalMutation928");
        Map.Entry<K, V> entry = new UnmodifiableMapEntry<K, V>(((K)(key)) , ((V)(value)));
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2575,key);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2577,entry,2576,entry.getKey());
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2578,value);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2580,entry,2579,entry.getValue());
        final KeyValue<K, V> pair = new DefaultKeyValue<K, V>(((K)(key)) , ((V)(value)));
        entry = new UnmodifiableMapEntry<K, V>(pair);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2581,key);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2583,entry,2582,entry.getKey());
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2584,value);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2586,entry,2585,entry.getValue());
        final Map.Entry<K, V> entry2 = new UnmodifiableMapEntry<K, V>(entry);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2587,key);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2589,entry2,2588,entry2.getKey());
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2590,value);
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2592,entry2,2591,entry2.getValue());
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(),2593,(entry instanceof org.apache.commons.collections4.Unmodifiable));
        fr.inria.diversify.testamplification.logger.Logger.writeTestFinish(Thread.currentThread());
    }
项目:syllogism    文件:Context.java   
/************************************************************************
 * Determines if a given syllogism for an equivalence type is valid.
 *
 * @param memeKey
 * @param equivalence
 * @param memeValue
 * @return result if known, otherwise optional.empty(). 
 ***********************************************************************/
public Optional<Boolean> interrogate(Term memeKey, Copula equivalence, Term memeValue)
{
    Collection<KeyValue<Copula, Term>> memeRelations = (Collection<KeyValue<Copula, Term>>) memeAssociations.get(memeKey);
    if (memeRelations == null || memeRelations.isEmpty())
    {
        return Optional.empty();
    }

    Optional<KeyValue<Copula, Term>> result = memeRelations
            .parallelStream()
            .findFirst()
            .filter((KeyValue<Copula, Term> kv) -> {
                if (kv.getKey().equals(equivalence)
                        && kv.getValue().equals(memeValue)) {
                    return true;
                } else {
                    Optional<Boolean> result1 = interrogate(kv.getValue(), equivalence, memeValue);
                    return result1.isPresent();
                }
        });

    if (result.isPresent())
    {
        return Optional.of(equivalence.getTruthEquivalency());
    }
    return Optional.empty();
}
项目:HCFCore    文件:SingletonMap.java   
/**
 * Constructor specifying the key and value as a <code>KeyValue</code>.
 *
 * @param keyValue  the key value pair to use
 */
public SingletonMap(final KeyValue<K, V> keyValue) {
    super();
    this.key = keyValue.getKey();
    this.value = keyValue.getValue();
}
项目:HCFCore    文件:SingletonMap.java   
/**
 * Constructor specifying the key and value as a <code>KeyValue</code>.
 *
 * @param keyValue  the key value pair to use
 */
public SingletonMap(final KeyValue<K, V> keyValue) {
    super();
    this.key = keyValue.getKey();
    this.value = keyValue.getValue();
}
项目:HCFCore    文件:DefaultMapEntry.java   
/**
 * Constructs a new entry from the specified <code>KeyValue</code>.
 *
 * @param pair  the pair to copy, must not be null
 * @throws NullPointerException if the entry is null
 */
public DefaultMapEntry(final KeyValue<? extends K, ? extends V> pair) {
    super(pair.getKey(), pair.getValue());
}
项目:HCFCore    文件:UnmodifiableMapEntry.java   
/**
 * Constructs a new entry from the specified <code>KeyValue</code>.
 *
 * @param pair  the pair to copy, must not be null
 * @throws NullPointerException if the entry is null
 */
public UnmodifiableMapEntry(final KeyValue<? extends K, ? extends V> pair) {
    super(pair.getKey(), pair.getValue());
}
项目:HCFCore    文件:DefaultKeyValue.java   
/**
 * Constructs a new pair from the specified <code>KeyValue</code>.
 *
 * @param pair  the pair to copy, must not be null
 * @throws NullPointerException if the entry is null
 */
public DefaultKeyValue(final KeyValue<? extends K, ? extends V> pair) {
    super(pair.getKey(), pair.getValue());
}
项目:HCFCore    文件:DefaultMapEntry.java   
/**
 * Constructs a new entry from the specified <code>KeyValue</code>.
 *
 * @param pair  the pair to copy, must not be null
 * @throws NullPointerException if the entry is null
 */
public DefaultMapEntry(final KeyValue<? extends K, ? extends V> pair) {
    super(pair.getKey(), pair.getValue());
}
项目:HCFCore    文件:UnmodifiableMapEntry.java   
/**
 * Constructs a new entry from the specified <code>KeyValue</code>.
 *
 * @param pair  the pair to copy, must not be null
 * @throws NullPointerException if the entry is null
 */
public UnmodifiableMapEntry(final KeyValue<? extends K, ? extends V> pair) {
    super(pair.getKey(), pair.getValue());
}
项目:HCFCore    文件:DefaultKeyValue.java   
/**
 * Constructs a new pair from the specified <code>KeyValue</code>.
 *
 * @param pair  the pair to copy, must not be null
 * @throws NullPointerException if the entry is null
 */
public DefaultKeyValue(final KeyValue<? extends K, ? extends V> pair) {
    super(pair.getKey(), pair.getValue());
}