Package com.flaptor.indextank.index.scorer.CategoryMaskManager

Examples of com.flaptor.indextank.index.scorer.CategoryMaskManager.CategoryValueInfo


  }
 
    public void setCategoryValues(String documentId, Map<String, String> categories) {
      DynamicData data = getOrCreateData(documentId);
        for (Map.Entry<String, String> entry : categories.entrySet()) {
            CategoryValueInfo catInfo = maskManager.getCategoryValueInfo(entry.getKey(), entry.getValue());
            if (catInfo != null) {
              data.setCategoryValue(catInfo.getBitmask(), catInfo.getValueCode());
            }
        }
    }
View Full Code Here


      String[] categories = new String[] {"type", "value", "type2", "type3", "value3", "type23", "type4", "value4", "type24", "type5", "value5", "type25", "type6", "value6", "type26"};
      String[] values = new String[] {"1", "ONE", "TwO", "12", "ONE2", "TwO2"};
      Set<Pair<String, CategoryValueInfo>> categoryValueInfos = new HashSet<Pair<String, CategoryValueInfo>>();
      for (int i = 0; i < categories.length; i++) {
      for (int j = 0; j < values.length; j++) {
        CategoryValueInfo categoryValueInfo = manager.getCategoryValueInfo(categories[i], values[j]);
        assertEquals(j + 1, categoryValueInfo.getValueCode());
        categoryValueInfos.add(new Pair(categories[i],categoryValueInfo));
      }
    }
     
      for (Pair<String, CategoryValueInfo> categoryValueInfo : categoryValueInfos) {
      for (Pair<String, CategoryValueInfo> categoryValueInfo2 : categoryValueInfos) {
        if (!categoryValueInfo.first().equals(categoryValueInfo2.first())) {
          int[] bitmask = categoryValueInfo.last().getBitmask();
          int[] bitmask2 = categoryValueInfo2.last().getBitmask();
         
          for (int i = 0; i < Math.min(bitmask.length, bitmask2.length); i++) {
            assertEquals(0, (int)(bitmask[i] & bitmask2[i]))
          }
View Full Code Here

TOP

Related Classes of com.flaptor.indextank.index.scorer.CategoryMaskManager.CategoryValueInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.