Example usage for com.google.common.collect Multiset toString

List of usage examples for com.google.common.collect Multiset toString

Introduction

In this page you can find the example usage for com.google.common.collect Multiset toString.

Prototype

@Override
String toString();

Source Link

Document

It is recommended, though not mandatory, that this method return the result of invoking #toString on the #entrySet , yielding a result such as [a x 3, c, d x 2, e] .

Usage

From source file:Controller.BeanUCV.java

private void pushMostVotedCategoryToClient() {
    Multiset<String> setCategories = HashMultiset.create();
    setCategories.addAll(sharedBean.getOneMapIPToCategories(sessionCode).values());
    System.out.println("multiset to string: " + setCategories.toString());

    String stringToPush = elected + "^";
    System.out.println("most voted cat: " + elected);
    stringToPush = stringToPush + setCategories.toString();
    PushContext ctx = PushContextFactory.getDefault().getPushContext();
    if (ctx != null) {
        ctx.push("/pushIsFuckingGreatUC", stringToPush);
    }//from w ww  . java2s .co  m
}

From source file:com.cinchapi.concourse.util.ConcurrentSkipListMultiset.java

@Override
public boolean equals(Object obj) {
    if (obj instanceof Multiset) {
        Multiset<?> other = (Multiset<?>) obj;
        return toString().equals(other.toString());
    } else {/*from w w w.  ja v a 2  s. c  o  m*/
        return false;
    }
}

From source file:Controller.BeanUNV.java

private void pushAverageGradeToClient() {
    Multiset<Float> setGrades = HashMultiset.create();
    setGrades.addAll(sharedBean.getOneMapIPToGrade(sessionCode).values());

    System.out.println("multiset to string: " + setGrades.toString());

    String stringToPush = "[averageGrade = " + averageGrade + "]";
    stringToPush = stringToPush + setGrades.toString();
    PushContext ctx = PushContextFactory.getDefault().getPushContext();
    if (ctx != null) {
        ctx.push("/pushIsFuckingGreatUN", stringToPush);
    }// w w w.  ja va2  s .  co  m

}

From source file:Controller.BeanRNV.java

private void pushAverageGradeToClient() {
    Multiset<Float> setGrades = HashMultiset.create();
    for (Entry<String, Pair<Float>> entry : mapIPToRangeGrade.entrySet()) {
        Pair<Float> range = entry.getValue();
        for (int i = range.getLeft().intValue(); i <= range.getRight(); i++) {
            setGrades.add((float) i);
        }/*from  w  w w. j  a  v  a  2 s .c o m*/
    }

    //        System.out.println("multiset to string: " + setGrades.toString());

    String stringToPush = "[averageGrade = " + averageGrade + "]";
    stringToPush = stringToPush + setGrades.toString();
    PushContext ctx = PushContextFactory.getDefault().getPushContext();
    if (ctx != null) {
        ctx.push("/pushIsFuckingGreatRN", stringToPush);
    }
}