private static Map<String, Object> canonicalizeMap(final Map<String, Object> from) {
   final Map<String, Object> canonicalized = new LinkedHashMap<String, Object>(from.size());
   final TreeSet<String> keysInOrder = new TreeSet<String>(from.keySet());
   for (final String key : keysInOrder) {
     final Object val = from.get(key);
     canonicalized.put(key, canonicalize(val));
   }
   return canonicalized;
 }
  private void putMap(String name, Map m) {
    _put(OBJECT, name);
    final int sizePos = _buf.position();
    _buf.putInt(0);

    for (Object key : m.keySet()) _putObjectField(key.toString(), m.get(key));

    _buf.put(EOO);
    _buf.putInt(sizePos, _buf.position() - sizePos);
  }
Exemple #3
0
 private static void initializeMap() {
   columnToKey.put(10, "term");
   columnToKey.put(12, "chief");
   columnToKey.put(17, "petitioner");
   columnToKey.put(19, "respondent");
   columnToKey.put(41, "issueArea");
   columnToKey.put(42, "decisionDirection");
   columnToKey.put(46, "lawType");
 }
Exemple #4
0
  private static List<String> facetStringToListOfKeys(String facets) throws Exception {

    List<String> facetList = new ArrayList<String>();

    String array[] = facets.split(",");
    for (int i = 0; i < array.length; i++) {
      int temp = Integer.parseInt(array[i]);
      String key = columnToKey.get(temp);
      if (key != null) {
        facetList.add(key);
      }
    }

    return facetList;
  }
 public void putAll(final Map m) {
   for (final Map.Entry entry : m.entrySet()) {
     this.put(entry.getKey().toString(), entry.getValue());
   }
 }