Examples of IntArray


Examples of com.caucho.util.IntArray

    throws Exception
  {
    if (countPattern == null)
      countPattern = XPath.parseMatch(node.getNodeName()).getPattern();

    IntArray numbers = new IntArray();
    for (; node != null; node = node.getParentNode()) {
      if (countPattern.match(node, env))
        numbers.add(countPreviousSiblings(node, env, countPattern));

      if (fromPattern != null && fromPattern.match(node, env))
        break;
    }
    if (fromPattern != null && ! findFromAncestor(node, env, fromPattern)) 
      numbers.clear();

    format.format(out, numbers);
  }
View Full Code Here

Examples of com.caucho.util.IntArray

    throws Exception
  {
    if (countPattern == null)
      countPattern = XPath.parseMatch(node.getNodeName()).getPattern();

    IntArray numbers = new IntArray();
    int count = 0;
    for (; node != null; node = XmlUtil.getPrevious(node)) {
      if (countPattern.match(node, env))
        count++;

      if (fromPattern != null && fromPattern.match(node, env))
        break;
    }
    numbers.add(count);
    if (fromPattern != null && ! findFromAncestor(node, env, fromPattern))
      numbers.clear();

    format.format(out, numbers);
  }
View Full Code Here

Examples of com.caucho.util.IntArray

  public void exprNumber(XslWriter out, Node node, Env env, Expr expr,
                         XslNumberFormat format)
    throws Exception
  {
    IntArray numbers = new IntArray();
    numbers.add((int) expr.evalNumber(node, env));

    format.format(out, numbers);
  }
View Full Code Here

Examples of com.caucho.util.IntArray

      }

      if (hasHour) {
        if (_hourTimes == null)
          _hourTimes = new IntArray();
        _hourTimes.add(60 * hour + minute);
      }
      else {
        if (_minuteTimes == null)
          _minuteTimes = new IntArray();
        _minuteTimes.add(minute);
      }
    }
  }
View Full Code Here

Examples of com.caucho.util.IntArray

      format = "1";

    int headIndex = format.length();

    ArrayList separators = new ArrayList();
    IntArray zeroSizes = new IntArray();
    IntArray formats = new IntArray();

    CharBuffer cb = new CharBuffer();
    int i = 0;
    while (i < format.length()) {
      char ch;

      // scan the separator
      cb.clear();
      for (; i < format.length(); i++) {
        ch = format.charAt(i);
        if (Character.isLetterOrDigit(ch))
          break;
        cb.append(ch);
      }

      // head and tail separators are just sticked on the ends
      if (head == null)
        head = cb.toString();
      else if (i >= format.length())
        tail = cb.toString();
      else
        separators.add(cb.toString());

      if (i >= format.length())
        break;

      // scan the format code
      int zeroSize = 1;
      int code = '0';
      for (; i < format.length(); i++) {
        ch = format.charAt(i);
        if (! Character.isLetterOrDigit(ch))
          break;

        if (! Character.isDigit(ch)) {
          if (code != '0' || zeroSize != 1)
            code = 0;
          else
            code = ch;
        }
        else if (Character.digit(ch, 10) == 0 && zeroSize >= 0)
          zeroSize++;
        else if (Character.digit(ch, 10) == 1)
          code = ch - 1;
        else
          code = 0;
      }
      if (code == 0)
        code = '0';

      zeroSizes.add(zeroSize);
      formats.add(code);
    }

    // default format is '1'
    if (formats.size() == 0) {
      tail = head;
      head = "";
      formats.add('0');
      zeroSizes.add(0);
    }

    // default separator is '.'
    if (separators.size() == 0)
      separators.add(".");
    if (separators.size() < formats.size())
      separators.add(separators.get(separators.size() - 1));

    this.separators = (String []) separators.toArray(new String[separators.size()]);
    this.zeroSize = zeroSizes.toArray();
    this.formats = formats.toArray();

    if (head == null)
      head = "";
    if (tail == null)
      tail = "";
View Full Code Here

Examples of com.caucho.util.IntArray

    if (arg instanceof ESRegexp)
      regexp = (ESRegexp) arg;
    else
      regexp = new ESRegexp(arg.toStr(), ESString.NULL);

    IntArray results = new IntArray();
    String pattern = string.toString();

    ESBase replace = null;
    String stringPattern = null;
    if (length > 1)
View Full Code Here

Examples of com.esotericsoftware.kryo.util.IntArray

      nextClass = nextClass.getSuperclass();
    }

    ObjectMap context = kryo.getContext();

    IntArray useAsm = new IntArray();

    // Sort fields by their offsets
    if (useMemRegions && !useAsmEnabled && unsafeAvailable) {
      try {
        Field[] allFieldsArray = (Field[])sortFieldsByOffsetMethod.invoke(null, allFields);
        allFields = Arrays.asList(allFieldsArray);
      } catch (Exception e) {
        throw new RuntimeException("Cannot invoke UnsafeUtil.sortFieldsByOffset()", e);
      }
    }

    // TODO: useAsm is modified as a side effect, this should be pulled out of buildValidFields
    // Build a list of valid non-transient fields
    List<Field> validFields = buildValidFields(false, allFields, context, useAsm);
    // Build a list of valid transient fields
    List<Field> validTransientFields = buildValidFields(true, allFields, context, useAsm);

    // Use ReflectASM for any public fields.
    if (useAsmEnabled && !Util.isAndroid && Modifier.isPublic(type.getModifiers()) && useAsm.indexOf(1) != -1) {
      try {
        access = FieldAccess.get(type);
      } catch (RuntimeException ignored) {
      }
    }
View Full Code Here

Examples of com.esotericsoftware.kryo.util.IntArray

      nextClass = nextClass.getSuperclass();
    }

    ObjectMap context = kryo.getContext();

    IntArray useAsm = new IntArray();

    // Sort fields by their offsets
    if (useMemRegions && !useAsmEnabled && unsafe() != null) {
      Field[] allFieldsArray = UnsafeUtil.sortFieldsByOffset(allFields);
      allFields = Arrays.asList(allFieldsArray);
    }

    // TODO: useAsm is modified as a side effect, this should be pulled out of buildValidFields
    // Build a list of valid non-transient fields
    List<Field> validFields = buildValidFields(false, allFields, context, useAsm);
    // Build a list of valid transient fields
    List<Field> validTransientFields = buildValidFields(true, allFields, context, useAsm);

    // Use ReflectASM for any public fields.
    if (useAsmEnabled && !Util.isAndroid && Modifier.isPublic(type.getModifiers()) && useAsm.indexOf(1) != -1) {
      try {
        access = FieldAccess.get(type);
      } catch (RuntimeException ignored) {
      }
    }
View Full Code Here

Examples of com.esotericsoftware.kryo.util.IntArray

      nextClass = nextClass.getSuperclass();
    }

    ObjectMap context = kryo.getContext();

    IntArray useAsm = new IntArray();

    // Sort fields by their offsets
    if (useMemRegions && !useAsmEnabled && unsafeAvailable) {
      try {
        Field[] allFieldsArray = (Field[])sortFieldsByOffsetMethod.invoke(null, allFields);
        allFields = Arrays.asList(allFieldsArray);
      } catch (Exception e) {
        throw new RuntimeException("Cannot invoke UnsafeUtil.sortFieldsByOffset()", e);
      }
    }

    // TODO: useAsm is modified as a side effect, this should be pulled out of buildValidFields
    // Build a list of valid non-transient fields
    List<Field> validFields = buildValidFields(false, allFields, context, useAsm);
    // Build a list of valid transient fields
    List<Field> validTransientFields = buildValidFields(true, allFields, context, useAsm);

    // Use ReflectASM for any public fields.
    if (useAsmEnabled && !Util.isAndroid && Modifier.isPublic(type.getModifiers()) && useAsm.indexOf(1) != -1) {
      try {
        access = FieldAccess.get(type);
      } catch (RuntimeException ignored) {
      }
    }
View Full Code Here

Examples of com.exigen.ie.constrainer.IntArray

 
  public Element(int[] array, Var indexVar, String oper, int value) {
    super(indexVar.getProblem(),name);
    Problem problem = (Problem) indexVar.getProblem();
    Constrainer constrainer = problem.getConstrainer();
    IntArray intValues = new IntArray(constrainer, array.length);
    for (int i = 0; i < array.length; i++) {
      intValues.set(array[i], i);
    }
    try {
      IntExp element = intValues.elementAt((IntExp) indexVar.getImpl());
      problem.defineConstraintImpl(this, element, oper, value);
    }
    catch (Exception f) {
      throw new RuntimeException("Failure to create constraint "+name);
    }
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.