From 72d36243a9ff94a72a49f988c22f12edc50a3b8f Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Mon, 3 Jun 2013 14:23:55 +0000 Subject: [PATCH] improve javadocs git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1489004 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/util/fst/ListOfOutputs.java | 9 +++++++++ .../lucene/util/fst/UpToTwoPositiveIntOutputs.java | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lucene/misc/src/java/org/apache/lucene/util/fst/ListOfOutputs.java b/lucene/misc/src/java/org/apache/lucene/util/fst/ListOfOutputs.java index 8db654a025d..99b2f3f2a98 100644 --- a/lucene/misc/src/java/org/apache/lucene/util/fst/ListOfOutputs.java +++ b/lucene/misc/src/java/org/apache/lucene/util/fst/ListOfOutputs.java @@ -38,6 +38,15 @@ import org.apache.lucene.util.IntsRef; // javadocs * more than one output, as this requires pushing all * multi-output values to a final state. * + *

NOTE: the only way to create multiple outputs is to + * add the same input to the FST multiple times in a row. This is + * how the FST maps a single input to multiple outputs (e.g. you + * cannot pass a List<Object> to {@link Builder#add}). If + * your outputs are longs, and you need at most 2, then use + * {@link UpToTwoPositiveIntOutputs} instead since it stores + * the outputs more compactly (by stealing a bit from each + * long value). + * *

NOTE: this cannot wrap itself (ie you cannot make an * FST with List<List<Object>> outputs using this). * diff --git a/lucene/misc/src/java/org/apache/lucene/util/fst/UpToTwoPositiveIntOutputs.java b/lucene/misc/src/java/org/apache/lucene/util/fst/UpToTwoPositiveIntOutputs.java index 04cbbf16ad6..2b992a06bf0 100644 --- a/lucene/misc/src/java/org/apache/lucene/util/fst/UpToTwoPositiveIntOutputs.java +++ b/lucene/misc/src/java/org/apache/lucene/util/fst/UpToTwoPositiveIntOutputs.java @@ -26,7 +26,16 @@ package org.apache.lucene.util.fst; * second. You cannot store 0 output with this (that's * reserved to mean "no output")! * - * NOTE: the resulting FST is not guaranteed to be minimal! + *

NOTE: the only way to create a TwoLongs output is to + * add the same input to the FST twice in a row. This is + * how the FST maps a single input to two outputs (e.g. you + * cannot pass a TwoLongs to {@link Builder#add}. If you + * need more than two then use {@link ListOfOutputs}, but if + * you only have at most 2 then this implementation will + * require fewer bytes as it steals one bit from each long + * value. + * + *

NOTE: the resulting FST is not guaranteed to be minimal! * See {@link Builder}. * * @lucene.experimental