documentation inherited from interface KeyTranslator
499377
public String getPressCommand (int keyCode)
    {
        KeyRecord krec = _keys.get(keyCode);
        return (krec == null) ? null : krec.pressCommand;
    }
861746
static String mapEntryToString(Object key, Object val) {
        final String k, v;
        final int klen, vlen;
        final char[] chars =
            new char[(klen = (k = objectToString(key)).length()) +
                     (vlen = (v = objectToString(val)).length()) + 1];
        k.getChars(0, klen, chars, 0);
        chars[klen] = '=';
        v.getChars(0, vlen, chars, klen + 1);
        return new String(chars);
    }
891119
function keyTranslate( $key )
    {
        $num = $this->keyPick( $key );
        if ( $num >=0 and $num <= count( $this->Handlers ) )
        {
            $handler = $this->Handlers[$num];
            return $handler->keyTranslate( $key );
        }

        return null;
    }
439001
private static Class<?> translateFromPrimitive(Class<?> primitive) {
        if (!primitive.isPrimitive()) {
            return primitive;
        }

        if (Boolean.TYPE.equals(primitive)) {
            return Boolean.class;
        }
        if (Character.TYPE.equals(primitive)) {
            return Character.class;
        }
        if (Byte.TYPE.equals(primitive)) {
            return Byte.class;
        }
        if (Short.TYPE.equals(primitive)) {
            return Short.class;
        }
        if (Integer.TYPE.equals(primitive)) {
            return Integer.class;
        }
        if (Long.TYPE.equals(primitive)) {
            return Long.class;
        }
        if (Float.TYPE.equals(primitive)) {
            return Float.class;
        }
        if (Double.TYPE.equals(primitive)) {
            return Double.class;
        }

        throw new RuntimeException("Error translating type:" + primitive);
    }
719139
public final void key_sentence() throws RecognitionException {
		CommonTree vtl=null;

		try {
			// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:88:5: ( variable_definition |vtl= VT_LITERAL | VT_SPACE )
			int alt10=3;
			switch ( input.LA(1) ) {
			case VT_VAR_DEF:
				{
				alt10=1;
				}
				break;
			case VT_LITERAL:
				{
				alt10=2;
				}
				break;
			case VT_SPACE:
				{
				alt10=3;
				}
				break;
			default:
				NoViableAltException nvae =
					new NoViableAltException("", 10, 0, input);
				throw nvae;
			}
			switch (alt10) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:88:7: variable_definition
					{
					pushFollow(FOLLOW_variable_definition_in_key_sentence277);
					variable_definition();
					state._fsp--;

					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:89:7: vtl= VT_LITERAL
					{
					vtl=(CommonTree)match(input,VT_LITERAL,FOLLOW_VT_LITERAL_in_key_sentence287); 

					        entry_stack.peek().keybuffer.append((vtl!=null?vtl.getText():null));
					        entry_stack.peek().sentenceKeyBuffer.append((vtl!=null?vtl.getText():null));
					    
					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:94:7: VT_SPACE
					{
					match(input,VT_SPACE,FOLLOW_VT_SPACE_in_key_sentence301); 

					        entry_stack.peek().keybuffer.append("\\s+");
					        entry_stack.peek().sentenceKeyBuffer.append(" ");
					    
					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
	}
936490
function translate (key, locale) {
	if (locale) {
		let loc = i18n.getLocale();
		i18n.setLocale(locale);
		let res = i18n.__(key);
		i18n.setLocale(loc);
		return res;
	} else {
		return i18n.__(key);
	}
}
20304
public String keyToString(Object key) {
      // This string should be in the format of:
      // "<TYPE>:<KEY>" for internally supported types or "T:<KEY_CLASS>:<KEY>" for custom types
      // e.g.:
      //   "S:my string key"
      //   "I:75"
      //   "D:5.34"
      //   "B:f"
      //   "T:com.myorg.MyType:STRING_GENERATED_BY_TRANSFORMER_FOR_MY_TYPE"

      // First going to check if the key is a primitive or a String. Otherwise, check if it's a transformable.
      // If none of those conditions are satisfied, we'll throw a CacheException.

      // Using 'X' for Shorts and 'Y' for Bytes because 'S' is used for Strings and 'B' is being used for Booleans.
      if (key instanceof byte[])
         return "A:" + Base64.getEncoder().encodeToString((byte[]) key);  //todo [anistor] need to profile Base64 versus simple hex encoding of the raw bytes
      if (key instanceof String)
         return "S:" + key;
      else if (key instanceof Integer)
         return "I:" + key;
      else if (key instanceof Boolean)
         return "B:" + key;
      else if (key instanceof Long)
         return "L:" + key;
      else if (key instanceof Float)
         return "F:" + key;
      else if (key instanceof Double)
         return "D:" + key;
      else if (key instanceof Short)
         return "X:" + key;
      else if (key instanceof Byte)
         return "Y:" + key;
      else if (key instanceof Character)
         return "C:" + key;
      else if (key instanceof UUID)
         return "U:" + key;
      else {
         Transformer t = getTransformer(key.getClass());
         if (t != null) {
            return "T:" + key.getClass().getName() + ":" + t.toString(key);
         } else {
            throw log.noTransformerForKey(key.getClass().getName());
         }
      }
   }
465304
private Context translateNamedBlock(WyilFile.Stmt.NamedBlock stmt, Context context) {
		return translateStatementBlock(stmt.getBlock(), context);
	}
695530
function translateObject(language, key, destObj, keysArray, valuesArray) {
	return new Promise(function (resolve, reject) {
		translateService.translate(valuesArray, language, function (err, res) {
			if (err || !res) {
				reject(err);
			} else {
				// Google-translate doesn't return an array if we only send a single string to translate
				res = _.concat(res);
				for (var i = 0; i < keysArray.length; i++) {
					destObj[key][keysArray[i]] = res[i].translatedText;
				}

				resolve(destObj);
			}
		});
	});
}
314443
private synchronized boolean markIsTransaction(String channelId, String uuid, boolean isTransaction) {
        if (this.isTransaction == null) {
            return false;
        }

        String key = getTxKey(channelId, uuid);
        this.isTransaction.put(key, isTransaction);
        return true;
    }
1125380
static PrefsTransform getLanguageTransform(TypeName type) {
		String typeName = type.toString();

		if (Integer.class.getCanonicalName().equals(typeName)) {
			return new IntegerPrefsTransform(true);
		}
		if (Boolean.class.getCanonicalName().equals(typeName)) {
			return new BooleanPrefsTransform(true);
		}
		if (Long.class.getCanonicalName().equals(typeName)) {
			return new LongPrefsTransform(true);
		}
		if (Double.class.getCanonicalName().equals(typeName)) {
			return new DoublePrefsTransform(true);
		}
		if (Float.class.getCanonicalName().equals(typeName)) {
			return new FloatPrefsTransform(true);
		}
		if (Short.class.getCanonicalName().equals(typeName)) {
			return new ShortPrefsTransform(true);
		}
		if (Byte.class.getCanonicalName().equals(typeName)) {
			return new BytePrefsTransform(true);
		}
		if (Character.class.getCanonicalName().equals(typeName)) {
			return new CharacterPrefsTransform(true);
		}
		if (String.class.getCanonicalName().equals(typeName)) {
			return new StringPrefsTransform();
		}
		return null;
	}
835922
Object extractKey(DocumentExtractor extractor, int docIndex) {
      String strKey;
      try {
         strKey = (String) extractor.extract(docIndex).getId();
      } catch (IOException e) {
         throw new SearchException("Error while extracting key", e);
      }

      return keyTransformationHandler.stringToKey(strKey);
   }
824774
function Keyboard(keyMap) {
	/**
	 * The current key states.
	 * @member {object}
	 * @private
	 */
	this.keys = {};

	var self = this;
	for (var kc in keyMap) {
		if (keyMap.hasOwnProperty(kc)) {
			this.keys[keyMap[kc]] = 0;
		}
	}
	window.addEventListener("keydown", function(event) {
		if (keyMap.hasOwnProperty(event.keyCode)) {
			if (self.keys[keyMap[event.keyCode]] === 0) {
				self.keys[keyMap[event.keyCode]] = 2;
			}
			return false;
		}
	});
	window.addEventListener("keyup", function(event) {
		if (keyMap.hasOwnProperty(event.keyCode)) {
			self.keys[keyMap[event.keyCode]] = 0;
			return false;
		}
	});
}
876352
function parseImportSpecifier() {
        // import {<foo as bar>} ...;
        var local, imported, node = new Node();

        imported = parseNonComputedProperty();
        if (matchContextualKeyword('as')) {
            lex();
            local = parseVariableIdentifier();
        }

        return node.finishImportSpecifier(local, imported);
    }
1096058
private int keyColumnEnd()
  {
    int offset = 0;
    
    for (int i = 0; i < _columns.length; i++) {
      if (offset == _keyStart + _keyLength) {
        return i;
      }
      
      offset += _columns[i].length();
    }
    
    if (offset == _keyStart + _keyLength) {
      return _columns.length;
    }
    
    throw new IllegalStateException();
  }
616449
function translatedGetter(key, argsGetter, lang = getCurrentLanguage()) {
            const data = [key].concat(argsGetter(lang))
            let old = getCurrentLanguage()
            setLanguage(lang)
            const rlt = rStrip(
              pureI18n.apply(null, data),
              (s, a, b, c, count) => {
                const data = JSON.parse(s)
                return toWrappedString(translatedGetter(data[0], () => data.slice(1), lang), void 0, count)
              },
              level - 1
            )
            setLanguage(old)
            return rlt
          }
406212
protected String keyToString(Object rawKey)
    {
        if (rawKey instanceof String) {
            return (String) rawKey;
        }
        return String.valueOf(rawKey);
    }