Package org.emftrace.metamodel.QUARCModel.Query

Examples of org.emftrace.metamodel.QUARCModel.Query.Rating


   *            the weight of the Rating relation
   * @return the created ApplicableElement
   */
  public Rating createRatingRelation(Element sourceElement,
      Element targetElement, float weight) {
    Rating result =  applicableElementCache.createRatingRelation(sourceElement,
        targetElement, weight);
    notifyCacheChangeListeners();
    return result;
  }
View Full Code Here


    applicableElementCache = new GSSQueryCache(queryResultSet, accessLayer);
    applicableElementCache.initCache();
 
   

    Rating rating = applicableElementCache.createRatingRelation(si1, g1, 100.0f);
   
   
    assertEquals(1, queryResultSet.getRatings().size());
    assertEquals(rating, queryResultSet.getRatings().get(0));
   
    assertEquals(si1,rating.getSource());
    assertEquals(g1,rating.getTarget());
    assertEquals("100.0",rating.getWeight());
 
  }
View Full Code Here

    applicableElementCache = new GSSQueryCache(queryResultSet, accessLayer);
    applicableElementCache.initCache();
 
   

    Rating r1 = applicableElementCache.createRatingRelation(si1, g1, 100.0f);
    Rating r2 =applicableElementCache.createRatingRelation(si2, g1, 50.0f);
   
   
    assertEquals(r1, applicableElementCache.getRatingRelation(si1, g1));
    assertEquals(r2, applicableElementCache.getRatingRelation(si2, g1));
View Full Code Here

    applicableElementCache = new GSSQueryCache(queryResultSet, accessLayer);
    applicableElementCache.initCache();
 
   

    Rating r1 = applicableElementCache.createRatingRelation(si1, g1, 100.0f);
    Rating r2 =applicableElementCache.createRatingRelation(si2, g1, 50.0f);
   
   
    assertEquals(2, applicableElementCache.getRatingRelationsTo(g1).size());
    assertTrue( applicableElementCache.getRatingRelationsTo(g1).contains(r1));
    assertTrue( applicableElementCache.getRatingRelationsTo(g1).contains(r2));
View Full Code Here

   *            the weight (float)
   * @return the created Rating relation
   */
  protected Rating createRating(QueryResultSet queryResultSet,
      Element source, Element target, float weight) {
    Rating rating = QueryFactory.eINSTANCE.createRating();
    rating.setSource(source);
    rating.setTarget(target);
    rating.setWeight(String.valueOf(weight));
    queryResultSet.getRatings().add(rating);
    return rating;
  }
View Full Code Here

   *            the weight of the Rating relation
   * @return the created ApplicableElement
   */
  public Rating createRatingRelation(Element sourceElement,
      Element targetElement, float weight) {
    Rating rating = QueryFactory.eINSTANCE.createRating();
    rating.setSource(sourceElement);
    rating.setTarget(targetElement);
    rating.setWeight(String.valueOf(weight));
    getQueryResultSet().getRatings().add(rating);
    addRatingToCache(rating, sourceElement, targetElement, weight);
    return rating;
  }
View Full Code Here

   *            the target Element of a Rating relation
   * @return the weight of the found Rating relation between the specified
   *         Elements
   */
  public float getRatingWeight(Element sourceElement, Element targetElement) {
    Rating rating = getRatingRelation(sourceElement, targetElement);
    if (rating != null)
      return ratingsWeightCache.get(rating);
    else
      return 0.0f;
  }
View Full Code Here

   * @return the weight of the found Rating relation between the specified
   *         Elements
   */
  public float getIndirectRatingWeight(Element sourceElement,
      Element targetElement) {
    Rating rating = getRatingRelation(sourceElement, targetElement);
    if (rating != null)
      return ratingsWeightCache.get(rating);
    float ratingSum = 0.0f;
    int count = 0;

View Full Code Here

TOP

Related Classes of org.emftrace.metamodel.QUARCModel.Query.Rating

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.