Exemplo n.º 1
0
 @Override
 public String toString() {
   StringBuilder sb = new StringBuilder();
   for (TableEntry entry : entries) {
     sb.append(entry.toString()).append(separator);
   }
   return sb.toString();
 }
Exemplo n.º 2
0
 public final Table getTable(String tableName, boolean caseSensitive) {
   if (caseSensitive) {
     return compositeTableMap.get(tableName);
   } else {
     final TableEntry tableEntry = tableMapInsensitive.get(tableName);
     if (tableEntry != null) {
       return tableEntry.getTable();
     }
     final FunctionEntry entry = nullaryFunctionMapInsensitive.get(tableName);
     if (entry != null) {
       return ((TableMacro) entry.getFunction()).apply(ImmutableList.of());
     }
     for (String name : schema.getTableNames()) {
       if (name.equalsIgnoreCase(tableName)) {
         return schema.getTable(name);
       }
     }
     return null;
   }
 }
Exemplo n.º 3
0
 /**
  * Write the table as a byte stream
  *
  * @param out the stream to write to
  * @throws IOException
  */
 void write(ByteArrayOutputStream out) throws IOException {
   Nat.write(entries.size(), out);
   for (TableEntry e : entries) {
     e.write(out);
   }
 }