public boolean containsKeyT(T key) { return m_map.containsKey(key); }
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey(Object key) { return _map.containsKey(unwrapKey(key)); }
/** * @param key * @return The value stored for a particular key (if present), or 0 otherwise */ public double getT(T key) { if (m_map.containsKey(key)) return m_map.get(key); return DEFAULT_VALUE; }
/** Propagate a topic weight to a node and all its children. weight is assumed to be a log. */ public void propagateTopicWeight(TObjectDoubleHashMap<NCRPNode> nodeWeights, NCRPNode node, double weight) { if (! nodeWeights.containsKey(node)) { // calculating the NCRP prior proceeds from the // root down (ie following child links), // but adding the word-topic weights comes from // the bottom up, following parent links and then // child links. It's possible that the leaf node may have // been removed just prior to this round, so the current // node may not have an NCRP weight. If so, it's not // going to be sampled anyway, so ditch it. return; } for (NCRPNode child: node.children) { propagateTopicWeight(nodeWeights, child, weight); } nodeWeights.adjustValue(node, weight); }
/** Propagate a topic weight to a node and all its children. weight is assumed to be a log. */ public void propagateTopicWeight(TObjectDoubleHashMap<NCRPNode> nodeWeights, NCRPNode node, double weight) { if (! nodeWeights.containsKey(node)) { // calculating the NCRP prior proceeds from the // root down (ie following child links), // but adding the word-topic weights comes from // the bottom up, following parent links and then // child links. It's possible that the leaf node may have // been removed just prior to this round, so the current // node may not have an NCRP weight. If so, it's not // going to be sampled anyway, so ditch it. return; } for (NCRPNode child: node.children) { propagateTopicWeight(nodeWeights, child, weight); } nodeWeights.adjustValue(node, weight); }
/** Propagate a topic weight to a node and all its children. weight is assumed to be a log. */ public void propagateTopicWeight(TObjectDoubleHashMap<NCRPNode> nodeWeights, NCRPNode node, double weight) { if (! nodeWeights.containsKey(node)) { // calculating the NCRP prior proceeds from the // root down (ie following child links), // but adding the word-topic weights comes from // the bottom up, following parent links and then // child links. It's possible that the leaf node may have // been removed just prior to this round, so the current // node may not have an NCRP weight. If so, it's not // going to be sampled anyway, so ditch it. return; } for (NCRPNode child: node.children) { propagateTopicWeight(nodeWeights, child, weight); } nodeWeights.adjustValue(node, weight); }
Object k = unwrapKey(key); double v = unwrapValue(val); if (_map.containsKey(k) && v == _map.get(k)) {
/** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ public Object get(Object key) { Object k = unwrapKey(key); double v = _map.get(k); // 0 may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if (v == 0) { return _map.containsKey(k) ? wrapValue(v) : null; } else { return wrapValue(v); } }
if (m.savedValues.containsKey(m_name)) { double v = m.savedValues.get(m_name); m_value.reset(v);
if (m.savedValues.containsKey(m_name)) { double v = m.savedValues.get(m_name); m_value.reset(v);