@Override public MapWriter.EntryWriter put(CharSequence k, float v) throws IOException { writeExternString(k); JavaBinCodec.this.writeFloat(v); return this; }
@Override public MapWriter.EntryWriter put(CharSequence k, int v) throws IOException { writeExternString(k); JavaBinCodec.this.writeInt(v); return this; }
@Override public MapWriter.EntryWriter put(CharSequence k, boolean v) throws IOException { writeExternString(k); writeBoolean(v); return this; } };
@Override public MapWriter.EntryWriter put(CharSequence k, Object v) throws IOException { writeExternString(k); JavaBinCodec.this.writeVal(v); return this; }
@Override public MapWriter.EntryWriter put(CharSequence k, long v) throws IOException { writeExternString(k); JavaBinCodec.this.writeLong(v); return this; }
@Override public MapWriter.EntryWriter put(CharSequence k, double v) throws IOException { writeExternString(k); JavaBinCodec.this.writeDouble(v); return this; }
public void writeMap(Map<?,?> val) throws IOException { writeTag(MAP, val.size()); for (Map.Entry<?,?> entry : val.entrySet()) { Object key = entry.getKey(); if (key instanceof String) { writeExternString((String) key); } else { writeVal(key); } writeVal(entry.getValue()); } }
public void writeMap(Map<?,?> val) throws IOException { writeTag(MAP, val.size()); for (Map.Entry<?,?> entry : val.entrySet()) { Object key = entry.getKey(); if (key instanceof String) { writeExternString((String) key); } else { writeVal(key); } writeVal(entry.getValue()); } }
String name = entry.getKey(); if(toWrite(name)) { writeExternString(name); Object val = entry.getValue(); writeVal(val);
public void writeNamedList(NamedList<?> nl) throws IOException { writeTag(nl instanceof SimpleOrderedMap ? ORDERED_MAP : NAMED_LST, nl.size()); for (int i = 0; i < nl.size(); i++) { String name = nl.getName(i); writeExternString(name); Object val = nl.getVal(i); writeVal(val); } }
String name = entry.getKey(); if(toWrite(name)) { writeExternString(name); Object val = entry.getValue(); writeVal(val);
public void writeNamedList(NamedList<?> nl) throws IOException { writeTag(nl instanceof SimpleOrderedMap ? ORDERED_MAP : NAMED_LST, nl.size()); for (int i = 0; i < nl.size(); i++) { String name = nl.getName(i); writeExternString(name); Object val = nl.getVal(i); writeVal(val); } }
public void writeSolrInputDocument(SolrInputDocument sdoc) throws IOException { List<SolrInputDocument> children = sdoc.getChildDocuments(); int sz = sdoc.size() + (children==null ? 0 : children.size()); writeTag(SOLRINPUTDOC, sz); writeFloat(1f); // document boost for (SolrInputField inputField : sdoc.values()) { writeExternString(inputField.getName()); writeVal(inputField.getValue()); } if (children != null) { for (SolrInputDocument child : children) { writeSolrInputDocument(child); } } }
public void writeSolrInputDocument(SolrInputDocument sdoc) throws IOException { List<SolrInputDocument> children = sdoc.getChildDocuments(); int sz = sdoc.size() + (children==null ? 0 : children.size()); writeTag(SOLRINPUTDOC, sz); writeFloat(sdoc.getDocumentBoost()); for (SolrInputField inputField : sdoc.values()) { if (inputField.getBoost() != 1.0f) { writeFloat(inputField.getBoost()); } writeExternString(inputField.getName()); writeVal(inputField.getValue()); } if (children != null) { for (SolrInputDocument child : children) { writeSolrInputDocument(child); } } }