Examples of SymbolInfo


Examples of com.facebook.stats.cardinality.Model.SymbolInfo

    this.out = out;
  }

  public void encode(int symbol) throws IOException {
    // lookup symbol data
    SymbolInfo symbolInfo = model.getSymbolInfo(symbol);

    // adjust low and high counts
    long range = (high - low + 1) >> model.log2MaxCount();
    high = low + (range * symbolInfo.highCount()) - 1;
    low = low + range * symbolInfo.lowCount();

    // write high byte if they are equal
    while ((high & 0xFF0000000000L) == (low & 0xFF0000000000L)) {
      int value = (int) (high >>> 40);
      out.write(value);
View Full Code Here

Examples of com.facebook.stats.cardinality.Model.SymbolInfo

    // determine next symbol
    // calculate the % of the value within the range
    long range = (high - low + 1) >>> model.log2MaxCount();

    int currentSymbolCount = (int) ((value - low) / range);
    SymbolInfo symbolInfo = model.countToSymbol(currentSymbolCount);

    high = low + (range * symbolInfo.highCount()) - 1;
    low = low + range * symbolInfo.lowCount();

    // if high bytes are equal, remove high byte and add a new byte of input
    while ((high & 0xFF0000000000L) == (low & 0xFF0000000000L)) {
      bufferByte();
    }

    // handle possible underflow
    // if top two bytes differ by only one digit
    if ((high >> 32) - (low >> 32) == 1) {
      // if second highest bytes are 0x00 on the high and 0xFF
      // on the low, we need to deal with underflow
      while ((high & 0x00FF00000000L) == 0 && (low & 0x00FF00000000L) == 0x00FF00000000L) {
        // remove second chunk of low and high (shifting over lower bits)
        low = removeUnderflowByte(low);
        high = removeUnderflowByte(high);
        value = removeUnderflowByte(value);

        // add a new byte
        bufferByte();
      }
    }

    low &= 0xFFFFFFFFFFFFL;
    high &= 0xFFFFFFFFFFFFL;
    value &= 0xFFFFFFFFFFFFL;

    return symbolInfo.symbol();
  }
View Full Code Here

Examples of com.facebook.stats.cardinality.Model.SymbolInfo

    // determine next symbol
    // calculate the % of the value within the range
    long range = (high - low + 1) >>> model.log2MaxCount();

    int currentSymbolCount = (int) ((value - low) / range);
    SymbolInfo symbolInfo = model.countToSymbol(currentSymbolCount);

    high = low + (range * symbolInfo.highCount()) - 1;
    low = low + range * symbolInfo.lowCount();

    // if high bytes are equal, remove high byte and add a new byte of input
    while ((high & 0xFF0000000000L) == (low & 0xFF0000000000L)) {
      bufferByte();
    }

    // handle possible underflow
    // if top two bytes differ by only one digit
    if ((high >> 32) - (low >> 32) == 1) {
      // if second highest bytes are 0x00 on the high and 0xFF
      // on the low, we need to deal with underflow
      while ((high & 0x00FF00000000L) == 0 && (low & 0x00FF00000000L) == 0x00FF00000000L) {
        // remove second chunk of low and high (shifting over lower bits)
        low = removeUnderflowByte(low);
        high = removeUnderflowByte(high);
        value = removeUnderflowByte(value);

        // add a new byte
        bufferByte();
      }
    }

    low &= 0xFFFFFFFFFFFFL;
    high &= 0xFFFFFFFFFFFFL;
    value &= 0xFFFFFFFFFFFFL;

    return symbolInfo.symbol();
  }
View Full Code Here

Examples of com.google.caja.lang.css.CssSchema.SymbolInfo

   * <a href="http://www.w3.org/TR/CSS21/syndata.html#length-units">Lengths</a>
   * require units unless the value is zero.  All browsers assume px if the
   * suffix is missing.
   */
  private void fixTerms(AncestorChain<? extends CssTree> t) {
    SymbolInfo stdColors = cssSchema.getSymbol(Name.css("color-standard"));
    final Pattern stdColorMatcher;
    if (stdColors != null) {
      stdColorMatcher = new CssPropertyPatterns(cssSchema)
          .cssPropertyToJavaRegex(stdColors.sig);
    } else {
View Full Code Here

Examples of com.google.caja.lang.css.CssSchema.SymbolInfo

   * <a href="http://www.w3.org/TR/CSS21/syndata.html#length-units">Lengths</a>
   * require units unless the value is zero.  All browsers assume px if the
   * suffix is missing.
   */
  private void fixTerms(AncestorChain<? extends CssTree> t) {
    SymbolInfo stdColors = schema.getSymbol(Name.css("color-standard"));
    final Pattern stdColorMatcher;
    if (stdColors != null) {
      stdColorMatcher = new CssPropertyPatterns(schema)
          .cssPropertyToJavaRegex(stdColors.sig);
    } else {
View Full Code Here

Examples of com.google.javascript.jscomp.deps.JsFunctionParser.SymbolInfo

      + "//no new line at EOF";

    Collection<SymbolInfo> symbols = parser.parseFile(SRC_PATH, CONTENTS);

    Iterator<SymbolInfo> i = symbols.iterator();
    SymbolInfo symbolInfo = i.next();
    assertEquals(symbolInfo.symbol, "yes1");
    assertEquals(symbolInfo.functionName, "goog.provide");

    symbolInfo = i.next();
    assertEquals(symbolInfo.symbol, "yes2");
View Full Code Here

Examples of com.google.javascript.jscomp.deps.JsFunctionParser.SymbolInfo

        + "goog.provide('no1');*/goog.provide('yes3');//goog.provide('no2');";

    Collection<SymbolInfo> symbols = parser.parseFile(SRC_PATH, CONTENTS);

    Iterator<SymbolInfo> i = symbols.iterator();
    SymbolInfo symbolInfo = i.next();
    assertEquals(symbolInfo.symbol, "yes1");
    assertEquals(symbolInfo.functionName, "goog.provide");

    symbolInfo = i.next();
    assertEquals(symbolInfo.symbol, "yes2");
View Full Code Here

Examples of com.google.javascript.jscomp.deps.JsFunctionParser.SymbolInfo

        + "goog.provide('no1');";

    Collection<SymbolInfo> symbols = parser.parseFile(SRC_PATH, CONTENTS);

    Iterator<SymbolInfo> i = symbols.iterator();
    SymbolInfo symbolInfo = i.next();
    assertEquals(symbolInfo.symbol, "yes1");
    assertEquals(symbolInfo.functionName, "goog.provide");

    symbolInfo = i.next();
    assertEquals(symbolInfo.symbol, "yes2");
View Full Code Here

Examples of com.google.javascript.jscomp.deps.JsFunctionParser.SymbolInfo

        + "goog.provide('yes1');\n";

    Collection<SymbolInfo> symbols = parser.parseFile(SRC_PATH, CONTENTS);

    Iterator<SymbolInfo> i = symbols.iterator();
    SymbolInfo symbolInfo = i.next();
    assertEquals(symbolInfo.symbol, "yes1");
    assertEquals(symbolInfo.functionName, "goog.provide");

    assertEquals(symbols.size(), 1);
    assertEquals(0, errorManager.getErrorCount());
View Full Code Here

Examples of com.google.javascript.jscomp.deps.JsFunctionParser.SymbolInfo

        + "goog.provide('yes1');\n";

    Collection<SymbolInfo> symbols = parser.parseFile(SRC_PATH, CONTENTS);

    Iterator<SymbolInfo> i = symbols.iterator();
    SymbolInfo symbolInfo = i.next();
    assertEquals(symbolInfo.symbol, "yes1");
    assertEquals(symbolInfo.functionName, "goog.provide");
    assertEquals(0, errorManager.getErrorCount());
    assertEquals(0, errorManager.getWarningCount());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.