Example #1
0
 private Font abspathImpl(final String fname, final int family, final int style)
     throws IOException {
   final InputStream stream;
   if (useTempJARCache) {
     final Exception[] privErr = {null};
     stream =
         AccessController.doPrivileged(
             new PrivilegedAction<InputStream>() {
               @Override
               public InputStream run() {
                 try {
                   final Uri uri = TempJarCache.getResourceUri(fname);
                   return null != uri ? uri.toURL().openConnection().getInputStream() : null;
                 } catch (final Exception e) {
                   privErr[0] = e;
                   return null;
                 }
               }
             });
     if (null != privErr[0]) {
       throw new IOException(privErr[0]);
     }
   } else {
     final URLConnection urlConn = IOUtil.getResource(UbuntuFontLoader.class, fname);
     stream = null != urlConn ? urlConn.getInputStream() : null;
   }
   if (null != stream) {
     final Font f = FontFactory.get(stream, true);
     if (null != f) {
       fontMap.put((family << 8) | style, f);
       return f;
     }
   }
   return null;
 }
 @Override
 public MultiDouble getSplittedValue(IRow row) {
   if (cacheMulti.containsKey(row.getIndex())) return (MultiDouble) cacheMulti.get(row.getIndex());
   double[] s = new double[this.size()];
   for (int i = 0; i < s.length; ++i) {
     s[i] = ((IDoubleRankableColumnMixin) get(i)).applyPrimitive(row);
   }
   MultiDouble f = new MultiDouble(-1, s);
   cacheMulti.put(row.getIndex(), f);
   return f;
 }