public Boolean isAccessible(AbstractMetadataRecord record) { if (this.globalState.accessible == null) { return null; } return this.globalState.accessible.get(record); }
public Boolean isAccessible(AbstractMetadataRecord record) { if (this.globalState.accessible == null) { return null; } return this.globalState.accessible.get(record); }
public Boolean isAccessible(AbstractMetadataRecord record) { if (this.globalState.accessible == null) { return null; } return this.globalState.accessible.get(record); }
public static Pattern getPattern(String newPattern, String originalPattern, int flags) throws ExpressionEvaluationException { List<?> key = Arrays.asList(newPattern, flags); Pattern p = patternCache.get(key); if (p == null) { try { p = Pattern.compile(newPattern, Pattern.DOTALL); patternCache.put(key, p); } catch(PatternSyntaxException e) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID30448, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30448, new Object[]{originalPattern, e.getMessage()})); } } return p; }
public static Pattern getPattern(String newPattern, String originalPattern, int flags) throws ExpressionEvaluationException { List<?> key = Arrays.asList(newPattern, flags); Pattern p = patternCache.get(key); if (p == null) { try { p = Pattern.compile(newPattern, Pattern.DOTALL); patternCache.put(key, p); } catch(PatternSyntaxException e) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID30448, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30448, new Object[]{originalPattern, e.getMessage()})); } } return p; }
public static Pattern getPattern(String newPattern, String originalPattern, int flags) throws ExpressionEvaluationException { List<?> key = Arrays.asList(newPattern, flags); Pattern p = patternCache.get(key); if (p == null) { try { p = Pattern.compile(newPattern, Pattern.DOTALL); patternCache.put(key, p); } catch(PatternSyntaxException e) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID30448, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30448, new Object[]{originalPattern, e.getMessage()})); } } return p; }
public static SimpleDateFormat getDateFormat(CommandContext context, String format) { SimpleDateFormat result = null; if (context != null) { if (context.globalState.dateFormatCache == null) { context.globalState.dateFormatCache = new LRUCache<String, SimpleDateFormat>(32); } else { result = context.globalState.dateFormatCache.get(format); } } if (result == null) { result = new SimpleDateFormat(format); //TODO: could be locale sensitive if (context != null) { context.globalState.dateFormatCache.put(format, result); } } return result; }
public static SimpleDateFormat getDateFormat(CommandContext context, String format) { SimpleDateFormat result = null; if (context != null) { if (context.globalState.dateFormatCache == null) { context.globalState.dateFormatCache = new LRUCache<String, SimpleDateFormat>(32); } else { result = context.globalState.dateFormatCache.get(format); } } if (result == null) { result = new SimpleDateFormat(format); //TODO: could be locale sensitive if (context != null) { context.globalState.dateFormatCache.put(format, result); } } return result; }
public static SimpleDateFormat getDateFormat(CommandContext context, String format) { SimpleDateFormat result = null; if (context != null) { if (context.globalState.dateFormatCache == null) { context.globalState.dateFormatCache = new LRUCache<String, SimpleDateFormat>(32); } else { result = context.globalState.dateFormatCache.get(format); } } if (result == null) { result = new SimpleDateFormat(format); //TODO: could be locale sensitive if (context != null) { context.globalState.dateFormatCache.put(format, result); } } return result; }
/** * Compile a regular expression into a {@link java.util.regex.Pattern} and cache it in * the {@link CommandContext} for future use. * * @param context * @param regex Regular expression. * @param flags Bitmask flags like {@link java.util.regex.Pattern#CASE_INSENSITIVE}. * @return Compiled regex. */ public static Pattern getPattern(CommandContext context, String regex, int flags) { Pattern result = null; if (context != null) { if (context.globalState.patternCache == null) { context.globalState.patternCache = new LRUCache<Entry<String,Integer>,Pattern>(32); } else { result = context.globalState.patternCache.get(new SimpleEntry(result, flags)); } } if (result == null) { result = Pattern.compile(regex, flags); if (context != null) { context.globalState.patternCache.put(new SimpleEntry(result, flags), result); } } return result; }
/** * Returns the IndexBlock (containing words) with the given number. */ protected IndexBlock getIndexBlock(int blockNum) throws IOException { Integer key= new Integer(blockNum); Block block= (Block) blockCache.get(key); if (block != null && block instanceof IndexBlock) return (IndexBlock) block; IndexBlock indexBlock= new GammaCompressedIndexBlock(IIndexConstants.BLOCK_SIZE); indexBlock.read(raf, blockNum); blockCache.put(key, indexBlock); return indexBlock; }
/** * Returns the FileListBlock with the given number. */ protected FileListBlock getFileListBlock(int blockNum) throws IOException { Integer key= new Integer(blockNum); Block block= (Block) blockCache.get(key); if (block != null && block instanceof FileListBlock) return (FileListBlock) block; FileListBlock fileListBlock= new FileListBlock(IIndexConstants.BLOCK_SIZE); fileListBlock.read(raf, blockNum); blockCache.put(key, fileListBlock); return fileListBlock; }
/** * Returns the FileListBlock with the given number. */ protected FileListBlock getFileListBlock(int blockNum) throws IOException { Integer key= new Integer(blockNum); Block block= (Block) blockCache.get(key); if (block != null && block instanceof FileListBlock) return (FileListBlock) block; FileListBlock fileListBlock= new FileListBlock(IIndexConstants.BLOCK_SIZE); fileListBlock.read(raf, blockNum); blockCache.put(key, fileListBlock); return fileListBlock; }
/** * Returns the IndexBlock (containing words) with the given number. */ protected IndexBlock getIndexBlock(int blockNum) throws IOException { Integer key= new Integer(blockNum); Block block= (Block) blockCache.get(key); if (block != null && block instanceof IndexBlock) return (IndexBlock) block; IndexBlock indexBlock= new GammaCompressedIndexBlock(IIndexConstants.BLOCK_SIZE); indexBlock.read(raf, blockNum); blockCache.put(key, indexBlock); return indexBlock; }
public Pattern translate(String pattern, char escape) throws ExpressionEvaluationException { List<?> key = Arrays.asList(pattern, escape); Pattern result = null; synchronized (cache) { result = cache.get(key); } if (result == null) { String newPattern = getPatternString(pattern, escape); result = getPattern(newPattern, pattern, flags); synchronized (cache) { cache.put(key, result); } } return result; }
public Pattern translate(String pattern, char escape) throws ExpressionEvaluationException { List<?> key = Arrays.asList(pattern, escape); Pattern result = null; synchronized (cache) { result = cache.get(key); } if (result == null) { String newPattern = getPatternString(pattern, escape); result = getPattern(newPattern, pattern, flags); synchronized (cache) { cache.put(key, result); } } return result; }
public Pattern translate(String pattern, char escape) throws ExpressionEvaluationException { List<?> key = Arrays.asList(pattern, escape); Pattern result = null; synchronized (cache) { result = cache.get(key); } if (result == null) { String newPattern = getPatternString(pattern, escape); result = getPattern(newPattern, pattern, flags); synchronized (cache) { cache.put(key, result); } } return result; }
public static DecimalFormat getDecimalFormat(CommandContext context, String format) { DecimalFormat result = null; if (context != null) { if (context.globalState.decimalFormatCache == null) { context.globalState.decimalFormatCache = new LRUCache<String, DecimalFormat>(32); } else { result = context.globalState.decimalFormatCache.get(format); } } if (result == null) { result = new DecimalFormat(format); //TODO: could be locale sensitive result.setParseBigDecimal(true); if (context != null) { context.globalState.decimalFormatCache.put(format, result); } } return result; }
public static DecimalFormat getDecimalFormat(CommandContext context, String format) { DecimalFormat result = null; if (context != null) { if (context.globalState.decimalFormatCache == null) { context.globalState.decimalFormatCache = new LRUCache<String, DecimalFormat>(32); } else { result = context.globalState.decimalFormatCache.get(format); } } if (result == null) { result = new DecimalFormat(format); //TODO: could be locale sensitive result.setParseBigDecimal(true); if (context != null) { context.globalState.decimalFormatCache.put(format, result); } } return result; }
public static DecimalFormat getDecimalFormat(CommandContext context, String format) { DecimalFormat result = null; if (context != null) { if (context.globalState.decimalFormatCache == null) { context.globalState.decimalFormatCache = new LRUCache<String, DecimalFormat>(32); } else { result = context.globalState.decimalFormatCache.get(format); } } if (result == null) { result = new DecimalFormat(format); //TODO: could be locale sensitive result.setParseBigDecimal(true); if (context != null) { context.globalState.decimalFormatCache.put(format, result); } } return result; }