Ignore:
Timestamp:
01/16/13 17:51:51 (11 years ago)
Author:
adeicke
Message:
  • Removed lombok related annotations and util class
  • Added comments and formating due to match project defaults
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filter/FilterStatisticCache.java

    r1030 r1040  
     1//   Copyright 2012 Georg-August-Universität Göttingen, Germany 
     2// 
     3//   Licensed under the Apache License, Version 2.0 (the "License"); 
     4//   you may not use this file except in compliance with the License. 
     5//   You may obtain a copy of the License at 
     6// 
     7//       http://www.apache.org/licenses/LICENSE-2.0 
     8// 
     9//   Unless required by applicable law or agreed to in writing, software 
     10//   distributed under the License is distributed on an "AS IS" BASIS, 
     11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
     12//   See the License for the specific language governing permissions and 
     13//   limitations under the License. 
     14 
    115package de.ugoe.cs.autoquest.usability.tasktree.filter; 
    216 
     
    721import com.google.common.cache.CacheBuilder; 
    822 
     23/** 
     24 * <p> 
     25 * TODO comment 
     26 * </p> 
     27 *  
     28 * @author Alexander Deicke 
     29 */ 
    930public class FilterStatisticCache { 
    1031 
    1132    private static final FilterStatisticCache instance = new FilterStatisticCache(); 
    12      
     33 
    1334    @SuppressWarnings("rawtypes") 
    1435    private Cache<TaskTreeNodeFilter, FilterStatistic> cache; 
    15      
     36 
    1637    private FilterStatisticCache() { 
    1738        this.cache = CacheBuilder.newBuilder().expireAfterWrite(10, TimeUnit.MINUTES).build(); 
    1839    } 
    19      
     40 
    2041    public static FilterStatisticCache instance() { 
    2142        return instance; 
    2243    } 
    23      
     44 
    2445    @SuppressWarnings("rawtypes") 
    2546    public void addFilterStatistic(TaskTreeNodeFilter nodeFilter, FilterStatistic filterStatistic) { 
    2647        this.cache.put(nodeFilter, filterStatistic); 
    2748    } 
    28      
     49 
    2950    @SuppressWarnings("rawtypes") 
    3051    public Optional<FilterStatistic> getFilterStatistic(TaskTreeNodeFilter nodeFilter) { 
    3152        return Optional.fromNullable(this.cache.getIfPresent(nodeFilter)); 
    3253    } 
    33      
     54 
    3455    public void clear() { 
    3556        this.cache.invalidateAll(); 
    3657    } 
    37      
     58 
    3859} 
Note: See TracChangeset for help on using the changeset viewer.