public ShortStringTranslator(String[] strings){
  if (strings.length > Short.MAX_VALUE)   throw new IllegalArgumentException("Too many strings for a short-string translator");
  list=new ArrayList<String>(Arrays.asList(strings));
  map=new HashMap<String,Short>();
  for (int i=0; i < strings.length; i++) {
    map.put(strings[i],(short)i);
  }
}

public ShortStringTranslator ( String [ ] strings ) { if ( strings . length > Short . MAX_VALUE ) throw new IllegalArgumentException ( "Too many strings for a short-string translator" ) ; list = new ArrayList < String > ( Arrays . asList ( strings ) ) ; map = new HashMap < String , Short > ( ) ; for ( int i = 0 ; i < strings . length ; i ++ ) { map . put ( strings [ i ] , ( short ) i ) ; } }
initialize a short - string two - way translator , setting short values according to the position of strings in the array .
