Tabnine Logo
PairOfObjectInt
Code IndexAdd Tabnine to your IDE (free)

How to use
PairOfObjectInt
in
tl.lin.data.pair

Best Java code snippets using tl.lin.data.pair.PairOfObjectInt (Showing top 20 results out of 315)

origin: tl.lin/lintools-datatypes

 public int compare(PairOfObjectInt<K> e1, PairOfObjectInt<K> e2) {
  if (e1.getRightElement() > e2.getRightElement()) {
   return 1;
  }
  if (e1.getRightElement() < e2.getRightElement()) {
   return -1;
  }
  return e1.getLeftElement().compareTo(e2.getLeftElement());
 }
};
origin: tl.lin/lintools-datatypes

/**
 * Creates a shallow clone of this object; the left element itself is not cloned.
 */
public PairOfObjectInt<L> clone() {
 return new PairOfObjectInt<L>(left, right);
}
origin: tl.lin/lintools-datatypes-fastutil

 public int compare(PairOfObjectInt<K> e1, PairOfObjectInt<K> e2) {
  if (e1.getLeftElement().equals(e2.getLeftElement())) {
   throw new RuntimeException("Event observed twice!");
  }
  return e1.getLeftElement().compareTo(e2.getLeftElement());
 }
};
origin: tl.lin/lintools-datatypes-fastutil

@Override
public PairOfObjectInt<K> next() {
 if (!hasNext()) {
  return null;
 }
 Object2IntMap.Entry<K> entry = iter.next();
 pair.set(entry.getKey(), entry.getIntValue());
 return pair;
}
origin: tl.lin/lintools-datatypes

 public int compare(PairOfObjectInt<K> e1, PairOfObjectInt<K> e2) {
  if (e1.getLeftElement().equals(e2.getLeftElement())) {
   throw new RuntimeException("Event observed twice!");
  }
  return e1.getLeftElement().compareTo(e2.getLeftElement());
 }
};
origin: tl.lin/lintools-datatypes

@Override
public PairOfObjectInt<K> next() {
 if (!hasNext()) {
  return null;
 }
 MapKI.Entry<K> entry = iter.next();
 pair.set(entry.getKey(), entry.getValue());
 return pair;
}
origin: tl.lin/lintools-datatypes-fastutil

 public int compare(PairOfObjectInt<K> e1, PairOfObjectInt<K> e2) {
  if (e1.getRightElement() > e2.getRightElement()) {
   return -1;
  }
  if (e1.getRightElement() < e2.getRightElement()) {
   return 1;
  }
  return e1.getLeftElement().compareTo(e2.getLeftElement());
 }
};
origin: tl.lin/lintools-datatypes

 public int compare(PairOfObjectInt<K> e1, PairOfObjectInt<K> e2) {
  if (e1.getLeftElement().equals(e2.getLeftElement())) {
   throw new RuntimeException("Event observed twice!");
  }
  return e2.getLeftElement().compareTo(e1.getLeftElement());
 }
};
origin: tl.lin/lintools-datatypes

/**
 * Creates a shallow clone of this object; the left element itself is not cloned.
 */
public PairOfObjectInt<L> clone() {
 return new PairOfObjectInt<L>(left, right);
}
origin: tl.lin/lintools-datatypes-fastutil

 public int compare(PairOfObjectInt<K> e1, PairOfObjectInt<K> e2) {
  if (e1.getRightElement() > e2.getRightElement()) {
   return 1;
  }
  if (e1.getRightElement() < e2.getRightElement()) {
   return -1;
  }
  return e1.getLeftElement().compareTo(e2.getLeftElement());
 }
};
origin: tl.lin/lintools-datatypes-fastutil

 public int compare(PairOfObjectInt<K> e1, PairOfObjectInt<K> e2) {
  if (e1.getLeftElement().equals(e2.getLeftElement())) {
   throw new RuntimeException("Event observed twice!");
  }
  return e2.getLeftElement().compareTo(e1.getLeftElement());
 }
};
origin: tl.lin/lintools-datatypes

/**
 * Iterator returns the same object every time, just with a different payload.
 */
public Iterator<PairOfObjectInt<K>> iterator() {
 return new Iterator<PairOfObjectInt<K>>() {
  private Iterator<MapKI.Entry<K>> iter = Object2IntFrequencyDistributionEntry.this.counts
    .entrySet().iterator();
  private final PairOfObjectInt<K> pair = new PairOfObjectInt<K>();
  @Override
  public boolean hasNext() {
   return iter.hasNext();
  }
  @Override
  public PairOfObjectInt<K> next() {
   if (!hasNext()) {
    return null;
   }
   MapKI.Entry<K> entry = iter.next();
   pair.set(entry.getKey(), entry.getValue());
   return pair;
  }
  @Override
  public void remove() {
   throw new UnsupportedOperationException();
  }
 };
}
origin: tl.lin/lintools-datatypes

 public int compare(PairOfObjectInt<K> e1, PairOfObjectInt<K> e2) {
  if (e1.getRightElement() > e2.getRightElement()) {
   return -1;
  }
  if (e1.getRightElement() < e2.getRightElement()) {
   return 1;
  }
  return e1.getLeftElement().compareTo(e2.getLeftElement());
 }
};
origin: tl.lin/lintools-datatypes-fastutil

private List<PairOfObjectInt<K>> getEntriesSorted(Comparator<PairOfObjectInt<K>> comparator) {
 List<PairOfObjectInt<K>> list = Lists.newArrayList();
 for (Object2IntMap.Entry<K> e : counts.object2IntEntrySet()) {
  list.add(new PairOfObjectInt<K>(e.getKey(), e.getIntValue()));
 }
 Collections.sort(list, comparator);
 return list;
}
origin: lintool/bespin

 @Override
 public void map(LongWritable docno, Text doc, Context context)
   throws IOException, InterruptedException {
  List<String> tokens = Tokenizer.tokenize(doc.toString());
  // Build a histogram of the terms.
  COUNTS.clear();
  for (String token : tokens) {
   COUNTS.increment(token);
  }
  // Emit postings.
  for (PairOfObjectInt<String> e : COUNTS) {
   WORD.set(e.getLeftElement());
   context.write(WORD, new PairOfInts((int) docno.get(), e.getRightElement()));
  }
 }
}
origin: tl.lin/lintools-datatypes

private List<PairOfObjectInt<K>> getEntriesSorted(Comparator<PairOfObjectInt<K>> comparator) {
 List<PairOfObjectInt<K>> list = Lists.newArrayList();
 for (MapKI.Entry<K> e : counts.entrySet()) {
  list.add(new PairOfObjectInt<K>(e.getKey(), e.getValue()));
 }
 Collections.sort(list, comparator);
 return list;
}
origin: edu.umd/cloud9

 @Override
 public void map(LongWritable docno, Text doc, Context context)
   throws IOException, InterruptedException {
  String text = doc.toString();
  COUNTS.clear();
  String[] terms = text.split("\\s+");
  // First build a histogram of the terms.
  for (String term : terms) {
   if (term == null || term.length() == 0) {
    continue;
   }
   COUNTS.increment(term);
  }
  // Emit postings.
  for (PairOfObjectInt<String> e : COUNTS) {
   WORD.set(e.getLeftElement());
   context.write(WORD, new PairOfInts((int) docno.get(), e.getRightElement()));
  }
 }
}
origin: tl.lin/lintools-datatypes-fastutil

/**
 * Iterator returns the same object every time, just with a different payload.
 */
public Iterator<PairOfObjectInt<K>> iterator() {
 return new Iterator<PairOfObjectInt<K>>() {
  private Iterator<Object2IntMap.Entry<K>> iter = Object2IntFrequencyDistributionFastutil.this.counts
    .object2IntEntrySet().iterator();
  private final PairOfObjectInt<K> pair = new PairOfObjectInt<K>();
  @Override
  public boolean hasNext() {
   return iter.hasNext();
  }
  @Override
  public PairOfObjectInt<K> next() {
   if (!hasNext()) {
    return null;
   }
   Object2IntMap.Entry<K> entry = iter.next();
   pair.set(entry.getKey(), entry.getIntValue());
   return pair;
  }
  @Override
  public void remove() {
   throw new UnsupportedOperationException();
  }
 };
}
origin: tl.lin/lintools-datatypes

 conditionalSum += pair.getRightElement();
 m.increment(pair.getLeftElement(), pair.getRightElement());
if (e.getRightElement() != marginals.get(e.getLeftElement())) {
 throw new RuntimeException("Internal Error!");
if (e.getRightElement() != m.get(e.getLeftElement())) {
 throw new RuntimeException("Internal Error!");
origin: tl.lin/lintools-datatypes-fastutil

 conditionalSum += pair.getRightElement();
 m.increment(pair.getLeftElement(), pair.getRightElement());
if (e.getRightElement() != marginals.get(e.getLeftElement())) {
 throw new RuntimeException("Internal Error!");
if (e.getRightElement() != m.get(e.getLeftElement())) {
 throw new RuntimeException("Internal Error!");
tl.lin.data.pairPairOfObjectInt

Most used methods

  • getLeftElement
  • getRightElement
  • <init>
  • set

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • putExtra (Intent)
  • onRequestPermissionsResult (Fragment)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now