Example usage for java.util Map containsValue

List of usage examples for java.util Map containsValue

Introduction

In this page you can find the example usage for java.util Map containsValue.

Prototype

boolean containsValue(Object value);

Source Link

Document

Returns true if this map maps one or more keys to the specified value.

Usage

From source file:org.esco.portlet.changeetab.service.impl.CachingEtablissementServiceTest.java

@Test
public void loadTestRetrieveSeveralExistingEtabs() throws Exception {
    this.service.setCachingDuration(100);

    long startTime = System.currentTimeMillis();

    int nbIterations = 10000;
    LoadRunner<CachingEtablissementServiceTest, Void> runner = new LoadRunner<CachingEtablissementServiceTest, Void>(
            nbIterations, 50, this) {

        @Override//ww w  .  jav a2s . c  o  m
        protected Void loadTest(CachingEtablissementServiceTest unitTest) throws Exception {

            final Collection<String> uais = new ArrayList<String>();
            uais.add(CachingEtablissementServiceTest.UAI_3);
            uais.add(CachingEtablissementServiceTest.UAI_1);

            final Map<String, Etablissement> etabs = CachingEtablissementServiceTest.this.service
                    .retrieveEtablissementsByCodes(uais);

            Assert.assertNotNull("Should return an empty collection !", etabs);
            Assert.assertEquals("Should return only one etab !", 2, etabs.size());
            Assert.assertTrue("Bad etab in returned list !",
                    etabs.containsValue(CachingEtablissementServiceTest.ETAB_1));
            Assert.assertTrue("Bad etab in returned list !",
                    etabs.containsValue(CachingEtablissementServiceTest.ETAB_3));

            return null;
        }
    };

    Assert.assertTrue("LoadRunner run failed !", runner.getFinishedTestWithoutErrorCount() == nbIterations);

    long endTime = System.currentTimeMillis();

    System.out.println("Test take " + (endTime - startTime) + " ms.");
}

From source file:output.TikzTex.java

/**
 * Which Algorithms are used in the Test?
 * @param dataFile/*  www .j a va2 s . c  om*/
 * @return
 * @throws IOException
 */
public Map<String, String> getAlgorithms(File dataFile) throws IOException {
    Map<String, String> valuesMap = new HashMap<>();
    BufferedReader br = new BufferedReader(new FileReader(dataFile));
    String line = br.readLine(); // reject first line
    line = br.readLine();
    int i = 1;

    // Read every data file, new Algorithm found? Put it into the Map!
    while (line != null) {
        String[] values = line.split("\t");
        if (!valuesMap.containsValue(values[values.length - 1])) {
            valuesMap.put("Algo" + i, values[values.length - 1]);
            i++;
        }
        line = br.readLine();
    }
    br.close();

    return valuesMap;
}

From source file:org.webguitoolkit.ui.controls.util.TextService.java

public void loadLocalesInt(ISelect lcSelect) {
    Locale[] locs = Locale.getAvailableLocales();
    Map<String, String> loclist = new TreeMap<String, String>();

    for (int i = 0; i < locs.length; i++) {
        Locale l = locs[i];/*from w w w.  jav a 2  s.com*/
        String displayName = l.getDisplayName(getLocale());
        if (StringUtils.isNotBlank(displayName) && !loclist.containsValue(displayName)) {
            loclist.put(l.toString(), displayName);
        }
    }
    lcSelect.setModel(new SelectKVModel().loadList(loclist));
    lcSelect.loadList();
    lcSelect.setValue(getLocale().toString());
}

From source file:org.egov.pgr.service.dashboard.DashboardService.java

public List<Map<String, Object>> getMonthlyAggregate() {
    final DateTime currentDate = new DateTime();
    final List<Map<String, Object>> dataHolder = constructMonthPlaceHolder(currentDate.minusMonths(6),
            currentDate, "MMM-yyyy");
    for (final Object[] compCnt : dashboardRepository.fetchMonthlyAggregateBetween(
            startOfGivenDate(currentDate.minusMonths(6).withDayOfMonth(1)).toDate(),
            endOfGivenDate(currentDate).toDate()))
        for (final Map<String, Object> mapdata : dataHolder)
            if (mapdata.containsValue(StringUtils.capitalize(String.valueOf(compCnt[0]).toLowerCase())))
                mapdata.put("y", Integer.valueOf(String.valueOf(compCnt[1])));
    return dataHolder;
}

From source file:com.symbian.driver.core.controller.Visitor.java

private void doEObject(final EObject aEObject) {
    fireTaskStartedEvent(new TaskStartedEvent(aEObject, this instanceof PCVisitor));
    if (aEObject instanceof Task) {
        LOGGER.info("Visiting Task: " + ((Task) aEObject).getAddress());
        sTask = (Task) aEObject;/*from ww w .  j av a 2 s  . c o m*/
        try {
            // reboot device is relevant to hardware only.
            boolean lEmulator = Epoc.isTargetEmulator(TDConfig.getInstance().getPreference(TDConfig.PLATFORM));
            if (!lEmulator && this instanceof SymbianVisitor && ((Task) aEObject).isPreRebootDevice() == true) {
                // first try soft reboot reboot
                boolean lSoftRebooted = false;
                if (DeviceUtils.restartBoard()) {
                    //wait for device communication service to run up
                    try {
                        Thread.sleep(10000); //10 seconds
                    } catch (InterruptedException e) {
                        //do nothing
                    }

                    if (DeviceUtils.poll(null)) {
                        lSoftRebooted = true;
                        LOGGER.log(Level.INFO, "JStat Reboot done on Device");
                    }
                }

                //soft reboot failed, try RebootProxy
                if (!lSoftRebooted) {
                    try {
                        if (RebootProxy.getInstance().Reboot()) {
                            LOGGER.log(Level.INFO, "Reboot done on Device via reboot plugin.");
                        } else {
                            LOGGER.log(Level.SEVERE, "Could not reboot Device using reboot plugin");
                            iNoErrors = false;
                        }
                    } catch (Exception lException) {
                        LOGGER.log(Level.SEVERE, "Could not reboot thru any plugins either", lException);
                        iNoErrors = false;
                    }
                }
            }
        } catch (ParseException lParseException) {
            LOGGER.log(Level.SEVERE, "Configuration error", lParseException);
            iNoErrors = false;
        }
    } else {
        EObject parent = aEObject.eContainer();
        if (parent instanceof Task) {
            sTask = (Task) parent;
        }
    }

    // Start EMF Node

    IVisitor lVisitor = (IVisitor) iDriverSwitch.doSwitch(aEObject);
    Map<? extends Exception, ESeverity> lResult = null;
    if (lVisitor != null) {
        lResult = lVisitor.execute(sTask, iSymbianDevice);
    }
    if (lResult != null && !lResult.isEmpty() && lResult.containsValue(ESeverity.ERROR)) {
        iNoErrors = false;
    }

    if (iResultListener) {
        if (iIsPCVisitor) {
            if (aEObject instanceof Build || aEObject instanceof TestExecuteScript
                    || aEObject instanceof Transfer || aEObject instanceof CmdPC) {
                fireTaskFinishedEvent(
                        new TaskFinishedEvent(aEObject, this instanceof PCVisitor, false, lResult));
            }
        } else if (aEObject instanceof CmdSymbian || aEObject instanceof Rtest
                || aEObject instanceof TestExecuteScript || aEObject instanceof Transfer) {
            fireTaskFinishedEvent(new TaskFinishedEvent(aEObject, this instanceof PCVisitor, false, lResult));
        }
    }
}

From source file:org.polymap.core.data.imex.shape.ShapeExportFeaturesOperation.java

public Status execute(final IProgressMonitor monitor) throws Exception {
    monitor.beginTask(context.adapt(FeatureOperationExtension.class).getLabel(), context.features().size());

    // complex type?
    FeatureCollection features = context.features();
    if (!(features.getSchema() instanceof SimpleFeatureType)) {
        throw new UnsupportedOperationException("Complex features are not supported yet.");
    }//from  www.  j a  v  a  2  s .co m

    SimpleFeatureType srcSchema = (SimpleFeatureType) features.getSchema();

    // shapeSchema
    ILayer layer = context.adapt(ILayer.class);
    final String basename = layer != null ? FilenameUtils.normalize(layer.getLabel())
            : FilenameUtils.normalize(srcSchema.getTypeName());

    SimpleFeatureTypeBuilder ftb = new SimpleFeatureTypeBuilder();
    ftb.setName(basename);
    ftb.setCRS(srcSchema.getCoordinateReferenceSystem());

    // attributes
    final Map<String, String> nameMap = new HashMap();
    for (AttributeDescriptor attr : srcSchema.getAttributeDescriptors()) {
        // attribute name (shapefile: 10 max)
        String targetName = StringUtils.left(attr.getLocalName(), 10);
        for (int i = 1; nameMap.containsValue(targetName); i++) {
            targetName = StringUtils.left(attr.getLocalName(), 10 - (i / 10 + 1)) + i;
            log.info("    Shapefile: " + attr.getLocalName() + " -> " + targetName);
        }
        nameMap.put(attr.getLocalName(), targetName);

        ftb.add(targetName, attr.getType().getBinding());
    }
    final SimpleFeatureType shapeSchema = ftb.buildFeatureType();

    // retyped collection
    final SimpleFeatureBuilder fb = new SimpleFeatureBuilder(shapeSchema);
    FeatureCollection<SimpleFeatureType, SimpleFeature> retyped = new RetypingFeatureCollection<SimpleFeatureType, SimpleFeature>(
            features, shapeSchema) {
        private int count = 0;

        protected SimpleFeature retype(SimpleFeature feature) {
            if (monitor.isCanceled()) {
                throw new RuntimeException("Operation canceled.");
            }
            for (Property prop : feature.getProperties()) {
                Object value = prop.getValue();
                // Shapefile has length limit 254
                if (value instanceof String) {
                    value = StringUtils.abbreviate((String) value, 254);
                }
                fb.set(nameMap.get(prop.getName().getLocalPart()), value);
            }
            if (++count % 100 == 0) {
                monitor.worked(100);
                monitor.subTask("Objekte: " + count);
            }
            return fb.buildFeature(feature.getID());
        }
    };

    ShapefileDataStoreFactory shapeFactory = new ShapefileDataStoreFactory();

    Map<String, Serializable> params = new HashMap<String, Serializable>();
    final File shapefile = File.createTempFile(basename + "-", ".shp");
    shapefile.deleteOnExit();
    params.put(ShapefileDataStoreFactory.URLP.key, shapefile.toURI().toURL());
    params.put(ShapefileDataStoreFactory.CREATE_SPATIAL_INDEX.key, Boolean.FALSE);

    ShapefileDataStore shapeDs = (ShapefileDataStore) shapeFactory.createNewDataStore(params);
    shapeDs.createSchema(shapeSchema);

    //shapeDs.forceSchemaCRS(DefaultGeographicCRS.WGS84);
    //shapeDs.setStringCharset( )

    String typeName = shapeDs.getTypeNames()[0];
    FeatureStore<SimpleFeatureType, SimpleFeature> shapeFs = (FeatureStore<SimpleFeatureType, SimpleFeature>) shapeDs
            .getFeatureSource(typeName);

    // no tx needed; without tx saves alot of memory

    shapeFs.addFeatures(retyped);

    // test code; slow but reads just one feature at a time
    //        FeatureIterator<SimpleFeature> it = retyped.features();
    //        try {
    //            while (it.hasNext()) {
    //                try {
    //                    SimpleFeature feature = it.next();
    //                    DefaultFeatureCollection coll = new DefaultFeatureCollection( null, null );
    //                    coll.add( feature );
    //                    //shapeFs.addFeatures( coll );
    //                    log.info( "Added: " +  feature );
    //                }
    //                catch (Exception e ) {
    //                    log.warn( "", e );
    //                }
    //            }
    //        }
    //        finally {
    //            it.close();
    //        }

    // open download        
    Polymap.getSessionDisplay().asyncExec(new Runnable() {
        public void run() {
            String url = DownloadServiceHandler.registerContent(new ContentProvider() {

                public String getContentType() {
                    return "application/zip";
                }

                public String getFilename() {
                    return basename + ".shp.zip";
                }

                public InputStream getInputStream() throws Exception {
                    ByteArrayOutputStream bout = new ByteArrayOutputStream(1024 * 1024);
                    ZipOutputStream zipOut = new ZipOutputStream(bout);

                    for (String fileSuffix : FILE_SUFFIXES) {
                        zipOut.putNextEntry(new ZipEntry(basename + "." + fileSuffix));
                        File f = new File(shapefile.getParent(),
                                StringUtils.substringBefore(shapefile.getName(), ".") + "." + fileSuffix);
                        InputStream in = new BufferedInputStream(new FileInputStream(f));
                        IOUtils.copy(in, zipOut);
                        in.close();
                        f.delete();
                    }
                    zipOut.close();
                    return new ByteArrayInputStream(bout.toByteArray());
                }

                public boolean done(boolean success) {
                    // all files deleted in #getInputStream()
                    return true;
                }
            });

            log.info("Shapefile: download URL: " + url);
            ExternalBrowser.open("download_window", url,
                    ExternalBrowser.NAVIGATION_BAR | ExternalBrowser.STATUS);
        }
    });
    monitor.done();
    return Status.OK;
}

From source file:de.hybris.platform.b2bacceleratorfacades.order.impl.DefaultCartFacade.java

@Override
public <T extends AbstractOrderData> void groupMultiDimensionalProducts(final T orderData,
        final Comparator<VariantOptionData> variantSortStrategy) {
    final Map<Integer, String> baseProductsMap = new HashMap<Integer, String>();

    if (orderData.getEntries() == null) {
        return;//from  w  ww.  ja v  a2s  . c  om
    }

    for (final OrderEntryData entry : orderData.getEntries()) {
        final ProductData product = entry.getProduct();
        if (product.getBaseOptions().size() > 0
                && product.getBaseOptions().get(0).getVariantType().equalsIgnoreCase(VARIANT_TYPE)
                && !baseProductsMap.containsValue(product.getBaseProduct())) {
            baseProductsMap.put(orderData.getEntries().indexOf(entry), product.getBaseProduct());
        }
    }

    for (final Map.Entry<Integer, String> entry : baseProductsMap.entrySet()) {
        final ProductData productData = populateProduct(entry.getValue(), variantSortStrategy);
        final OrderEntryData orderEntry = groupOrderEntry(orderData, productData, entry.getValue());

        orderData.getEntries().add(orderEntry);
    }
}

From source file:org.grails.datastore.gorm.jpa.GormToJpaTransform.java

public static void transformEntity(SourceUnit source, ClassNode classNode) {

    // add the JPA @Entity annotation
    classNode.addAnnotation(ANNOTATION_ENTITY);
    final AnnotationNode entityListenersAnnotation = new AnnotationNode(new ClassNode(EntityListeners.class));
    entityListenersAnnotation.addMember("value",
            new ClassExpression(new ClassNode(EntityInterceptorInvokingEntityListener.class)));
    classNode.addAnnotation(entityListenersAnnotation);

    PropertyNode mappingNode = classNode.getProperty(GrailsDomainClassProperty.MAPPING);
    Map<String, Map<String, ?>> propertyMappings = new HashMap<String, Map<String, ?>>();
    if (mappingNode != null && mappingNode.isStatic()) {
        populateConfigurationMapFromClosureExpression(classNode, mappingNode, propertyMappings);
    }/*from w  w  w  . j av  a2  s.  c o  m*/

    // annotate the id property with @Id
    String idPropertyName = GrailsDomainClassProperty.IDENTITY;
    String generationType = GenerationType.AUTO.toString();

    final PropertyNode errorsProperty = classNode.getProperty("errors");
    if (errorsProperty == null) {
        if (ClassUtils.isPresent("org.codehaus.groovy.grails.compiler.injection.ASTValidationErrorsHelper",
                Thread.currentThread().getContextClassLoader())) {
            addErrorsProperty(classNode);
        }
    }

    if (propertyMappings.containsKey(GrailsDomainClassProperty.IDENTITY)) {
        final Map<String, ?> idConfig = propertyMappings.get(GrailsDomainClassProperty.IDENTITY);
        if (idConfig.containsKey("name")) {
            idPropertyName = idConfig.get("name").toString();
        }
        if (idConfig.containsKey("generator")) {
            String generatorName = idConfig.get("generator").toString();
            if ("assigned".equals(generatorName)) {
                generationType = null;
            } else if ("sequence".equals(generatorName)) {
                generationType = GenerationType.SEQUENCE.toString();
            } else if ("identity".equals(generatorName)) {
                generationType = GenerationType.IDENTITY.toString();
            }
        }
    }

    PropertyNode idProperty = classNode.getProperty(idPropertyName);
    if (idProperty == null) {
        new DefaultGrailsDomainClassInjector().performInjectionOnAnnotatedEntity(classNode);
        idProperty = classNode.getProperty(GrailsDomainClassProperty.IDENTITY);
    }

    if (!idPropertyName.equals(GrailsDomainClassProperty.IDENTITY)) {
        PropertyNode toDiscard = classNode.getProperty(GrailsDomainClassProperty.IDENTITY);
        if (toDiscard != null && toDiscard.getType().equals("java.lang.Long")) {
            classNode.getProperties().remove(toDiscard);
        }
    }

    if (idProperty != null) {
        final FieldNode idField = idProperty.getField();

        idField.addAnnotation(ANNOTATION_ID);
        if (generationType != null) {
            final AnnotationNode generatedValueAnnotation = new AnnotationNode(
                    new ClassNode(GeneratedValue.class));
            generatedValueAnnotation.addMember("strategy", new PropertyExpression(
                    new ClassExpression(new ClassNode(GenerationType.class)), generationType));
            idField.addAnnotation(generatedValueAnnotation);
        }
    }

    // annotate the version property with @Version
    PropertyNode versionProperty = classNode.getProperty(GrailsDomainClassProperty.VERSION);
    if (versionProperty != null) {
        if (propertyMappings.containsKey(GrailsDomainClassProperty.VERSION)) {
            final Map<String, ?> versionSettings = propertyMappings.get(GrailsDomainClassProperty.VERSION);
            final Object enabledObject = versionSettings.get("enabled");
            if (enabledObject instanceof Boolean) {
                if (((Boolean) enabledObject).booleanValue()) {
                    versionProperty.addAnnotation(ANNOTATION_VERSION);
                }
            }
        } else {
            versionProperty.addAnnotation(ANNOTATION_VERSION);
        }
    }

    final List<MethodNode> methods = classNode.getMethods();
    for (MethodNode methodNode : methods) {
        if (methodNode.isStatic() || !methodNode.isPublic() || methodNode.isAbstract()) {
            continue;
        }

        final AnnotationNode annotationNode = gormEventMethodToJpaAnnotation.get(methodNode.getName());
        if (annotationNode == null) {
            continue;
        }

        //methodNode.setReturnType(new ClassNode(void.class));
        methodNode.addAnnotation(annotationNode);
    }

    Map<String, ClassNode> hasManyMap = lookupStringToClassNodeMap(classNode,
            GrailsDomainClassProperty.HAS_MANY);
    Map<String, ClassNode> hasOneMap = lookupStringToClassNodeMap(classNode, GrailsDomainClassProperty.HAS_ONE);
    Map<String, ClassNode> belongsToMap = lookupStringToClassNodeMap(classNode,
            GrailsDomainClassProperty.BELONGS_TO);
    Map<String, String> mappedByMap = lookupStringToStringMap(classNode, GrailsDomainClassProperty.MAPPED_BY);

    final List<PropertyNode> properties = classNode.getProperties();
    for (PropertyNode propertyNode : properties) {
        if (!propertyNode.isPublic() || propertyNode.isStatic()) {
            continue;
        }

        if (propertyNode == idProperty || propertyNode == versionProperty) {
            continue;
        }

        final String typeName = propertyNode.getType().getName();

        if (typeName.equals("java.util.Date") || typeName.equals("java.util.Calendar")) {
            AnnotationNode temporalAnnotation = new AnnotationNode(new ClassNode(Temporal.class));
            temporalAnnotation.addMember("value",
                    new PropertyExpression(new ClassExpression(new ClassNode(TemporalType.class)), "DATE"));
            propertyNode.getField().addAnnotation(temporalAnnotation);
        } else if (MappingFactory.isSimpleType(typeName)) {
            propertyNode.getField().addAnnotation(ANNOTATION_BASIC);
        } else {
            final String propertyName = propertyNode.getName();
            if (!belongsToMap.containsKey(propertyName) && !hasOneMap.containsKey(propertyName)
                    && !hasManyMap.containsKey(propertyName)) {
                handleToOne(classNode, belongsToMap, propertyName);
            }
        }
    }

    final PropertyNode transientsProp = classNode.getProperty(GrailsDomainClassProperty.TRANSIENT);
    List<String> propertyNameList = new ArrayList<String>();
    populateConstantList(propertyNameList, transientsProp);
    annotateAllProperties(classNode, propertyNameList, Transient.class);

    propertyNameList.clear();
    final PropertyNode embeddedProp = classNode.getProperty(GrailsDomainClassProperty.EMBEDDED);
    populateConstantList(propertyNameList, embeddedProp);
    annotateAllProperties(classNode, propertyNameList, Embedded.class);

    if (embeddedProp != null) {
        for (String propertyName : propertyNameList) {
            final PropertyNode property = classNode.getProperty(propertyName);
            if (property == null) {
                continue;
            }

            ClassNode embeddedType = property.getField().getType();
            annotateIfNecessary(embeddedType, Embeddable.class);
        }
    }

    if (!belongsToMap.isEmpty()) {
        for (String propertyName : belongsToMap.keySet()) {
            handleToOne(classNode, belongsToMap, propertyName);
        }
    }

    if (!hasOneMap.isEmpty()) {
        for (String propertyName : hasOneMap.keySet()) {
            final AnnotationNode oneToOneAnnotation = new AnnotationNode(new ClassNode(OneToOne.class));
            oneToOneAnnotation.addMember("optional", ConstantExpression.FALSE);
            oneToOneAnnotation.addMember("cascade", EXPR_CASCADE_ALL);
            annotateProperty(classNode, propertyName, oneToOneAnnotation);
        }
    }

    if (!hasManyMap.isEmpty()) {
        for (String propertyName : hasManyMap.keySet()) {
            ClassNode associatedClass = hasManyMap.get(propertyName);
            final Map<String, ClassNode> inverseBelongsToMap = lookupStringToClassNodeMap(associatedClass,
                    GrailsDomainClassProperty.BELONGS_TO);
            final Map<String, ClassNode> inverseHasManyMap = lookupStringToClassNodeMap(associatedClass,
                    GrailsDomainClassProperty.HAS_MANY);

            final AnnotationNode oneToManyAnnotation = new AnnotationNode(new ClassNode(OneToMany.class));
            oneToManyAnnotation.addMember("targetEntity", new ClassExpression(associatedClass));

            if (mappedByMap.containsKey(propertyName)) {
                oneToManyAnnotation.addMember("mappedBy",
                        new ConstantExpression(mappedByMap.get(propertyName)));
                oneToManyAnnotation.addMember("cascade", EXPR_CASCADE_PERSIST);
                annotateProperty(classNode, propertyName, oneToManyAnnotation);
            } else {
                if (inverseHasManyMap.containsValue(classNode)) {
                    // many-to-many association
                    List<ClassNode> belongsToList = getBelongsToList(classNode);

                    final AnnotationNode manyToManyAnnotation = new AnnotationNode(
                            new ClassNode(ManyToMany.class));
                    manyToManyAnnotation.addMember("targetEntity", new ClassExpression(associatedClass));
                    if (belongsToList.contains(associatedClass)) {
                        for (String inversePropertyName : inverseHasManyMap.keySet()) {
                            if (classNode.equals(inverseHasManyMap.get(inversePropertyName))) {
                                manyToManyAnnotation.addMember("mappedBy",
                                        new ConstantExpression(inversePropertyName));
                            }
                        }
                    } else {
                        manyToManyAnnotation.addMember("cascade", EXPR_CASCADE_ALL);
                    }
                    annotateProperty(classNode, propertyName, manyToManyAnnotation);
                }
                // Try work out the other side of the association
                else if (inverseBelongsToMap.containsValue(classNode)) {
                    for (String inversePropertyName : inverseBelongsToMap.keySet()) {
                        if (classNode.equals(inverseBelongsToMap.get(inversePropertyName))) {
                            oneToManyAnnotation.addMember("mappedBy",
                                    new ConstantExpression(inversePropertyName));
                            oneToManyAnnotation.addMember("cascade", EXPR_CASCADE_ALL);
                        }
                    }
                    annotateProperty(classNode, propertyName, oneToManyAnnotation);
                } else {
                    PropertyNode inverseClosestMatch = findClosestInverstTypeMatch(classNode, associatedClass);
                    if (inverseClosestMatch != null) {
                        oneToManyAnnotation.addMember("mappedBy",
                                new ConstantExpression(inverseClosestMatch.getName()));
                    }
                    // unidrectional one-to-many
                    oneToManyAnnotation.addMember("cascade", EXPR_CASCADE_ALL);
                    annotateProperty(classNode, propertyName, oneToManyAnnotation);
                }
            }
        }
    }
}

From source file:com.linkedin.pinot.core.startree.StarTreeSegmentCreator.java

@Override
public void indexRow(GenericRow row) {
    // Find matching leaves in StarTree for row
    currentMatchingNodes.clear();/*from   www.  j  a  v a2  s  . c  o m*/
    StarTreeTableRow tableRow = extractValues(row);
    findMatchingLeaves(starTreeBuilder.getTree(), tableRow.getDimensions(), currentMatchingNodes);

    // Only write the raw value, maintaining sort order (we will write aggregates when sealing)
    for (StarTreeIndexNode node : currentMatchingNodes) {
        Map<Integer, Integer> pathValues = node.getPathValues();
        if (!pathValues.containsValue(StarTreeIndexNode.all())) {
            StarTreeTableRange range = starTreeBuilder.getDocumentIdRange(node.getNodeId());
            StarTreeTable subTable = starTreeBuilder.getTable().view(range.getStartDocumentId(),
                    range.getDocumentCount());
            StarTreeTableRange aggregateAdjustedRange = starTreeBuilder
                    .getAggregateAdjustedDocumentIdRange(node.getNodeId());

            // Get next matching document ID
            Integer nextMatchingDocumentId = nextDocumentIds.get(node.getNodeId());
            if (nextMatchingDocumentId == null) {
                nextMatchingDocumentId = aggregateAdjustedRange.getStartDocumentId();
            }
            nextDocumentIds.put(node.getNodeId(), nextMatchingDocumentId + 1);

            // Write using that document ID to all columns
            for (final String column : dictionaryCreatorMap.keySet()) {
                Object columnValueToIndex = row.getValue(column);
                if (schema.getFieldSpecFor(column).isSingleValueField()) {
                    int dictionaryIndex = dictionaryCreatorMap.get(column).indexOfSV(columnValueToIndex);
                    ((SingleValueForwardIndexCreator) forwardIndexCreatorMap.get(column))
                            .index(nextMatchingDocumentId, dictionaryIndex);
                    if (config.isCreateInvertedIndexEnabled()) {
                        invertedIndexCreatorMap.get(column).add(nextMatchingDocumentId,
                                (Object) dictionaryIndex);
                    }
                } else {
                    int[] dictionaryIndex = dictionaryCreatorMap.get(column).indexOfMV(columnValueToIndex);
                    ((MultiValueForwardIndexCreator) forwardIndexCreatorMap.get(column))
                            .index(nextMatchingDocumentId, dictionaryIndex);
                    if (config.isCreateInvertedIndexEnabled()) {
                        invertedIndexCreatorMap.get(column).add(nextMatchingDocumentId, dictionaryIndex);
                    }
                }
            }
        }
    }
}

From source file:com.googlecode.concurrentlinkedhashmap.ConcurrentMapTest.java

@Test(dataProvider = "guardedMap", expectedExceptions = NullPointerException.class)
public void containsValue_withNull(Map<Integer, Integer> map) {
    map.containsValue(null);
}