/** applies all changes caused by committing a merge to this SegmentInfos */
  void applyMergeChanges(MergePolicy.OneMerge merge, boolean dropSegment) {
    final Set<SegmentCommitInfo> mergedAway = new HashSet<>(merge.segments);
    boolean inserted = false;
    int newSegIdx = 0;
    for (int segIdx = 0, cnt = segments.size(); segIdx < cnt; segIdx++) {
      assert segIdx >= newSegIdx;
      final SegmentCommitInfo info = segments.get(segIdx);
      if (mergedAway.contains(info)) {
        if (!inserted && !dropSegment) {
          segments.set(segIdx, merge.info);
          inserted = true;
          newSegIdx++;
        }
      } else {
        segments.set(newSegIdx, info);
        newSegIdx++;
      }
    }

    // the rest of the segments in list are duplicates, so don't remove from map, only list!
    segments.subList(newSegIdx, segments.size()).clear();

    // Either we found place to insert segment, or, we did
    // not, but only because all segments we merged becamee
    // deleted while we are merging, in which case it should
    // be the case that the new segment is also all deleted,
    // we insert it at the beginning if it should not be dropped:
    if (!inserted && !dropSegment) {
      segments.add(0, merge.info);
    }
  }
 @Override
 public void handleMessage(Message msg) {
   try {
     int countDown = mDataArrays.get(msg.what).getCountDown();
     mDataArrays.get(msg.what).setCountDown(countDown - 1);
     countDowmList.set(msg.what, countDown);
     if (countDown == 1) {
       Timer tempTimer = timers.get(msg.what);
       if (tempTimer != null) {
         tempTimer.cancel();
         tempTimer = null;
       }
       ChatMsgEntity entity = (ChatMsgEntity) msg.obj;
       ChatMsgEntity afterReadEntity =
           UserUtils.deleteMsgAfterRead(
               getResources().getString(R.string.del_after_read), friendName, entity);
       mDataArrays.set(msg.what, afterReadEntity);
       mAdapter.notifyDataSetChanged();
     }
     Timber.d("countDown:" + countDown);
     mAdapter.notifyDataSetChanged();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
Beispiel #3
0
  @Override
  public List<Object> apply(List<Object> arguments) {
    Preconditions.checkArguments("string.match", arguments, expectedTypes);

    if (LuaType.getTypeOf(arguments.get(0)) == LuaType.NUMBER) {
      arguments.set(0, ToString.toString(arguments.get(0)));
      return apply(arguments);
    }

    if (LuaType.getTypeOf(arguments.get(1)) == LuaType.NUMBER) {
      arguments.set(1, ToString.toString(arguments.get(1)));
      return apply(arguments);
    }

    if (((String) arguments.get(1)).isEmpty()) {
      return Collections.singletonList(arguments.get(0));
    }

    Object[] index = new Find().apply(arguments).toArray();

    if (index[0] == null) {
      return Collections.singletonList((Object) null);
    }

    return Collections.singletonList(
        (Object)
            ((String) arguments.get(0))
                .substring(((Double) index[0]).intValue() - 1, ((Double) index[1]).intValue()));
  }
Beispiel #4
0
 private void getCSVstructure() throws IOException {
   setReaderName(csvFile);
   List<String> fileList = fileToList(false);
   String head = fileList.get(0);
   String[] split = head.split(DELIMITER);
   boolean dateTimeDetected = false;
   for (String s : split) {
     fileColumns.add(s);
     if (s.equalsIgnoreCase("skip")
         || s.trim().toLowerCase().endsWith("name")
         || s.toLowerCase().contains("description")
         || s.toLowerCase().contains("text")
         || s.toLowerCase().endsWith("_old")) {
       fileColumnType.add("nvarchar");
     } else if (s.equalsIgnoreCase("period_start_time")) {
       fileColumnType.add("datetime");
       dateTimeDetected = true;
     } else {
       fileColumnType.add("float");
       fileColumnSize.add("53");
     }
   }
   if (!dateTimeDetected) {
     fileColumnType.set(0, "datetime");
   }
   fileColumnType.set(1, "nvarchar");
 }
Beispiel #5
0
  @Override
  public List<String> getTooltip(PC_Vec2I position) {

    Slot slot = getSlotAtPosition(position);
    if (slot != null) {
      ItemStack itemstack = null;

      if (slot.getHasStack()) itemstack = slot.getStack();

      // if (slot instanceof PC_Slot && ((PC_Slot) slot).getBackgroundStack() != null && ((PC_Slot)
      // slot).renderTooltipWhenEmpty())
      // itemstack = ((PC_Slot) slot).getBackgroundStack();

      if (itemstack != null) {
        @SuppressWarnings("unchecked")
        List<String> l =
            itemstack.getTooltip(
                PC_ClientUtils.mc().thePlayer,
                PC_ClientUtils.mc().gameSettings.advancedItemTooltips);

        for (int k = 0; k < l.size(); ++k) {
          if (k == 0) {
            l.set(k, itemstack.getRarity().rarityColor + l.get(k));
          } else {
            l.set(k, EnumChatFormatting.GRAY + l.get(k));
          }
        }
        return l;
      }
    }
    return super.getTooltip(position);
  }
Beispiel #6
0
 public int removeXPathWithAttr(String name, String[] value, boolean descendant) {
   int removeCount = 0;
   int i = 0;
   while (i < xpaths.size()) {
     XPath xpath = xpaths.get(i);
     if (xpath.hasAttr(name, value)) {
       // remove this xpath and it sub xpaths;
       xpaths.set(i++, null);
       removeCount++;
       String xpathAncestor = xpath.getXPathWithIndex();
       while (i < xpaths.size()) {
         XPath sel = xpaths.get(i);
         if (sel.getXPathWithIndex().startsWith(xpathAncestor)) {
           xpaths.set(i++, null);
           removeCount++;
         } else {
           break;
         }
       }
     } else {
       i++;
     }
   }
   List<XPath> newList = new ArrayList<>();
   for (int k = 0; k < xpaths.size(); k++) {
     XPath sel = xpaths.get(k);
     if (sel != null) newList.add(sel);
   }
   xpaths = newList;
   reindex();
   return removeCount;
 }
 public boolean valideOrderSequenceForSource(Integer idSource) {
   boolean isValide = true;
   List<Message> list = getMessArrivedBySource(idSource);
   Message temp = null;
   for (int i = 0; i < list.size(); i++) {
     for (int j = i; j < list.size(); j++) {
       if (list.get(i).getDateMessDelivre() >= list.get(j).getMessDelivre()) {
         temp = list.get(i);
         list.set(i, list.get(j));
         list.set(j, temp);
       }
     }
   }
   if (list.size() >= 1) {
     for (int i = 0; i < list.size() - 1; i++) {
       if (list.get(i).getNumeroSequencer() > list.get(i + 1).getNumeroSequencer()) {
         isValide = false;
         System.out.println(
             "Source machine:"
                 + list.get(i).getSource().getId()
                 + "\n Total order is not correct for this 2 messages:\n"
                 + list.get(i).toString()
                 + "\n"
                 + list.get(i + 1).toString());
       }
     }
   }
   return isValide;
 }
Beispiel #8
0
 public void replaceTypeParameter(int i, ParameterType p, ParameterType.Variance v) {
   assert (typeParameters.size() == variances.size());
   typeParameters = new ArrayList<ParameterType>(typeParameters);
   typeParameters.set(i, p);
   variances = new ArrayList<ParameterType.Variance>(variances);
   variances.set(i, v);
 }
  /**
   * リスト初期化
   *
   * @return List<ListItem>
   */
  private List<ListItem> initList() {

    List<ListItem> items = new ArrayList<ListItem>();

    for (int i = 0; i < 11; i++) {
      items.add(new ListItem());

      if (i == 0) {
        ListItem header = new ListItem();

        header.setRank("順位");
        header.setCount("手数");
        header.setStage("ステージ");
        header.setDate("プレイ時刻");

        items.set(0, header);
      } else {
        ListItem item = new ListItem();

        item.setRank(String.valueOf(i));
        item.setCount("");
        item.setStage("");
        item.setDate("");

        items.set(i, item);
      }
    }

    return items;
  }
  @Override
  public Object deserialize(final Writable blob) throws SerDeException {
    Text rowText = (Text) blob;

    CSVReader csv = null;
    try {
      csv =
          newReader(
              new CharArrayReader(rowText.toString().toCharArray()),
              separatorChar,
              quoteChar,
              escapeChar);
      final String[] read = csv.readNext();

      for (int i = 0; i < numCols; i++) {
        if (read != null && i < read.length) {
          row.set(i, read[i]);
        } else {
          row.set(i, null);
        }
      }

      return row;
    } catch (final Exception e) {
      throw new SerDeException(e);
    } finally {
      if (csv != null) {
        try {
          csv.close();
        } catch (final Exception e) {
          // ignore
        }
      }
    }
  }
Beispiel #11
0
 private void move(int index, int upOrDown) {
   List<P> positions = getPositions();
   P move = positions.get(index);
   P replace = positions.get(index + upOrDown);
   positions.set(index + upOrDown, move);
   positions.set(index, replace);
 }
  public void process(Document document) throws IOException {
    List<String> words = document.terms;

    for (int i = 0; i < words.size(); i++) {
      String word = words.get(i);

      if (word != null) {
        if (cache.containsKey(word)) {
          words.set(i, cache.get(word));
        } else {
          stemmer.setCurrent(word);
          if (stemmer.stem()) {
            String stem = stemmer.getCurrent();
            words.set(i, stem);
            cache.put(word, stem);
          } else {
            cache.put(word, word);
          }
        }

        if (cache.size() > 50000) {
          cache.clear();
        }
      }
    }

    processor.process(document);
  }
  /**
   * check that the cache is immutable by changing the data passed in the constructor and returned
   * from methods.
   *
   * @throws TimeStampedCacheException
   */
  @Test
  public void testImmutable() throws TimeStampedCacheException {
    // setup
    List<AbsoluteDate> actuals;
    List<AbsoluteDate> expecteds = new ArrayList<AbsoluteDate>(data);
    AbsoluteDate different = date.shiftedBy(-50);

    // actions + verify

    // check constructor
    data.set(0, different);
    Assert.assertArrayEquals(cache.getAll().toArray(), expecteds.toArray());

    // check getAll
    actuals = cache.getAll();
    try {
      actuals.set(0, different);
    } catch (UnsupportedOperationException e) {
      // exception ok
    }
    Assert.assertArrayEquals(cache.getAll().toArray(), expecteds.toArray());

    // check getNeighbors
    actuals = cache.getNeighbors(date);
    try {
      actuals.set(0, different);
    } catch (UnsupportedOperationException e) {
      // exception ok
    }
    Assert.assertArrayEquals(cache.getAll().toArray(), expecteds.toArray());
  }
Beispiel #14
0
  @SuppressWarnings({"unchecked", "rawtypes"})
  public boolean setArrayItem(JSONPath path, Object currentObject, int index, Object value) {
    if (currentObject instanceof List) {
      List list = (List) currentObject;
      if (index >= 0) {
        list.set(index, value);
      } else {
        list.set(list.size() + index, value);
      }
      return true;
    }

    if (currentObject.getClass().isArray()) {
      int arrayLenth = Array.getLength(currentObject);

      if (index >= 0) {
        if (index < arrayLenth) {
          Array.set(currentObject, index, value);
        }
      } else {
        if (Math.abs(index) <= arrayLenth) {
          Array.set(currentObject, arrayLenth + index, value);
        }
      }

      return true;
    }

    throw new UnsupportedOperationException();
  }
  @Override
  /**
   * Function used to get the path from our start id to the given end id
   *
   * @param endId the id of the vertex we want a path to
   * @return a list of integers that represents the path to take
   */
  public List<Integer> getPath(int endId) throws IllegalArgumentException, IllegalStateException {
    if (isComputed == false) {
      initializeGraph(this.startGraph);
      this.computeShortestPath();
    }

    List<Integer> path = new ArrayList<Integer>();
    // We simply loop through to find the endId and then follow its previous vertices to the start
    // vertex
    for (Vertex vertex : vertices) {
      if (vertex.getId() == endId) {
        while (vertex != null && vertex.getId() != startId) {
          path.add(vertex.getId());
          vertex = vertex.getPrevious();
        }
        path.add(vertex.getId());
        break;
      }
    }

    // Since the path was traversed backwards we must reverse it before returning it
    for (int i = 0; i < path.size() / 2; i++) {
      int temp = path.get(i);
      path.set(i, path.get(path.size() - i - 1));
      path.set(path.size() - i - 1, temp);
    }
    return path;
  }
Beispiel #16
0
 private static void renameInCommands(
     String oldname, String newname, List<LuciferEventCommand> commands)
     throws UnsupportedEncodingException, IllegalArgumentException {
   for (int k = 0; k < commands.size(); k++) {
     LuciferEventCommand command = commands.get(k);
     if (command.type == LuciferEventCommand.CHANGE_HERO_GRAPHIC
         || command.type == LuciferEventCommand.CHANGE_VEHICLE_GRAPHIC) {
       if (command.string.equalsIgnoreCase(oldname)) {
         command.string = newname;
       }
     } else if (command.type == LuciferEventCommand.MOVE_EVENT) {
       List<LuciferMoveCommand> list = LuciferMoveCommand.assembleMoveCommands(command);
       for (int i = 0; i < list.size(); i++) {
         LuciferMoveCommand move = list.get(i);
         if (move.type == 0x22 && move.filename.equalsIgnoreCase(oldname)) {
           move = new LuciferMoveCommand(move.type, move.data, newname);
           list.set(i, move);
         }
       }
       command =
           LuciferMoveCommand.disassembleMoveCommands(
               list,
               command.data[0],
               command.data[1],
               command.data[2],
               command.data[3],
               command.depth);
       commands.set(k, command);
     }
   }
 }
  /**
   * Store an argument (bind variable) into the argTrace list (above) for later dumping.
   *
   * @param i index of argument being set.
   * @param typeHelper optional additional info about the type that is being set in the arg
   * @param arg argument being bound.
   */
  protected void argTraceSet(int i, String typeHelper, Object arg) {
    String tracedArg;
    try {
      tracedArg = rdbmsSpecifics.formatParameterObject(arg);
    } catch (Throwable t) {
      // rdbmsSpecifics should NEVER EVER throw an exception!!
      // but just in case it does, we trap it.
      log.debug(
          "rdbmsSpecifics threw an exception while trying to format a "
              + "parameter object ["
              + arg
              + "] this is very bad!!! ("
              + t.getMessage()
              + ")");

      // backup - so that at least we won't harm the application using us
      tracedArg = arg == null ? "null" : arg.toString();
    }

    i--; // make the index 0 based
    synchronized (argTrace) {
      // if an object is being inserted out of sequence, fill up missing values with null...
      while (i >= argTrace.size()) {
        argTrace.add(argTrace.size(), null);
      }
      if (!showTypeHelp || typeHelper == null) {
        argTrace.set(i, tracedArg);
      } else {
        argTrace.set(i, typeHelper + tracedArg);
      }
    }
  }
Beispiel #18
0
  private void sort(int first, int last) {

    if (first < last) {
      int x = list.get((first + last) / 2);
      int i = first;
      int j = last;

      do {
        while (list.get(i) < x) {
          i++;
        }
        while (x < list.get(j)) {
          j--;
        }
        if (i <= j) {
          int temp = list.get(i);
          list.set(i, list.get(j));
          list.set(j, temp);
          i++;
          j--;
        }
      } while (i <= j);

      sort(first, j);
      sort(i, last);
    }
  }
Beispiel #19
0
 @Override
 public void visitMethodInsn(
     final int opcode, final String owner, final String name, final String desc) {
   if (mv != null) {
     mv.visitMethodInsn(opcode, owner, name, desc);
   }
   if (this.locals == null) {
     labels = null;
     return;
   }
   pop(desc);
   if (opcode != Opcodes.INVOKESTATIC) {
     Object t = pop();
     if (opcode == Opcodes.INVOKESPECIAL && name.charAt(0) == '<') {
       Object u;
       if (t == Opcodes.UNINITIALIZED_THIS) {
         u = this.owner;
       } else {
         u = uninitializedTypes.get(t);
       }
       for (int i = 0; i < locals.size(); ++i) {
         if (locals.get(i) == t) {
           locals.set(i, u);
         }
       }
       for (int i = 0; i < stack.size(); ++i) {
         if (stack.get(i) == t) {
           stack.set(i, u);
         }
       }
     }
   }
   pushDesc(desc);
   labels = null;
 }
Beispiel #20
0
  public static void exchangePlaceHolder(Field before, Field after) {
    String beforeValue = "";
    String afterValue = "";
    int beforeIndex = 0;
    int afterIndex = 0;
    Attr beforeAttr = null;
    Attr afterAttr = null;
    List<Attr> beforeAttrs, afterAttrs;
    beforeAttrs = before.getAttrs();
    for (int i = 0; i < beforeAttrs.size(); i++) {
      Attr attr = (Attr) beforeAttrs.get(i);
      if (!ConfigManager.PROPERTIES_LINEBR.equalsIgnoreCase(attr.getName())) {
        continue;
      }
      beforeValue = attr.getValue();
      beforeIndex = i;
      beforeAttr = attr;
    }

    afterAttrs = after.getAttrs();
    for (int i = 0; i < afterAttrs.size(); i++) {
      Attr attr = (Attr) afterAttrs.get(i);
      if (!ConfigManager.PROPERTIES_LINEBR.equalsIgnoreCase(attr.getName())) {
        continue;
      }
      afterValue = attr.getValue();
      afterIndex = i;
      afterAttr = attr;
    }
    beforeAttr.setValue(afterValue);
    beforeAttrs.set(beforeIndex, beforeAttr);
    afterAttr.setValue(beforeValue);
    afterAttrs.set(afterIndex, afterAttr);
  }
Beispiel #21
0
  public void loadScroll(long[] aScroll) {
    if (arrays.get(0) != null) {
      arrays.set(0, null);
    }

    arrays.set(0, (long[]) aScroll.clone());
  }
 private List<String> swap(List<String> lst, int pos) {
   String head = lst.get(0);
   String headSwapTo = lst.get(pos % lst.size());
   lst.set(0, headSwapTo);
   lst.set(pos, head);
   return lst;
 }
  public void autoComplete(String leftOfCursor, String full) {
    latestAutoComplete = null;

    if (leftOfCursor.charAt(0) == '/') {
      leftOfCursor = leftOfCursor.substring(1);

      Minecraft mc = FMLClientHandler.instance().getClient();
      if (mc.currentScreen instanceof GuiChat) {
        List<String> commands = getPossibleCommands(mc.thePlayer, leftOfCursor);
        if (commands != null && !commands.isEmpty()) {
          if (leftOfCursor.indexOf(' ') == -1) {
            for (int i = 0; i < commands.size(); i++) {
              commands.set(i, GRAY + "/" + commands.get(i) + RESET);
            }
          } else {
            for (int i = 0; i < commands.size(); i++) {
              commands.set(i, GRAY + commands.get(i) + RESET);
            }
          }

          latestAutoComplete = commands.toArray(new String[commands.size()]);
        }
      }
    }
  }
Beispiel #24
0
 @Override
 @SuppressWarnings({"unchecked"})
 public List<?> translate(Object result, NamespaceContext nsContext) {
   List nodeList = (List) result;
   int i = 0;
   for (Object item : nodeList) {
     if (item instanceof List) nodeList.set(i, translate(item, nsContext));
     else {
       NodeInfo node = (NodeInfo) item;
       int type = node.getNodeKind();
       String value = "";
       if (type != NodeType.DOCUMENT && type != NodeType.ELEMENT) value = node.getStringValue();
       String localName = node.getLocalPart();
       String namespaceURI = node.getURI();
       String qualifiedName = node.getDisplayName();
       String location = SaxonNavigator.INSTANCE.getXPath(node, nsContext);
       NodeItem nodeItem =
           new NodeItem(type, location, value, localName, namespaceURI, qualifiedName);
       nodeItem.xml = node;
       nodeList.set(i, nodeItem);
     }
     i++;
   }
   return nodeList;
 }
Beispiel #25
0
  public static List<BasicDBObject> terribleSort(
      List<BasicDBObject> indexArr, List<BasicDBObject> regArr, String calcType) {
    List<BasicDBObject> finalList = regArr;
    List<BasicDBObject> cloneIndex = indexArr;

    for (int i = 1; i < finalList.size(); i++) {
      BasicDBObject temp1 = finalList.get(i);
      BasicDBObject temp2 = cloneIndex.get(i);

      int j;
      for (j = i - 1;
          j >= 0
              && getCalc(temp1.getDouble("PageRank Value"), temp2.getDouble("tfidf"), calcType)
                  < getCalc(
                      finalList.get(j).getDouble("PageRank Value"),
                      cloneIndex.get(j).getDouble("tfidf"),
                      calcType);
          j--) {
        finalList.set(j + 1, finalList.get(j));
        cloneIndex.set(j + 1, cloneIndex.get(j));
      }
      finalList.set(j + 1, temp1);
      cloneIndex.set(j + 1, temp2);
    }

    return finalList;
  }
Beispiel #26
0
  @Override
  public Solution generate(Integer size, boolean verbose) {
    List<Integer> values = new ArrayList<Integer>();

    if (verbose == true) {
      System.out.print("Generation of an initial solution ... ");
    }

    for (Integer i = 0; i < size; ++i) {
      values.add(i);
    }

    Random rand = new Random();
    Integer aux = 0, index1 = 0, index2 = 0;

    for (Integer i = 0; i < 5 * size; ++i) {
      index1 = rand.nextInt(size);
      index2 = rand.nextInt(size);

      aux = values.get(index1);
      values.set(index1, values.get(index2));
      values.set(index2, aux);
    }

    if (verbose == true) {
      System.out.println("done");
    }

    return (this.preprocessor_ != null)
        ? this.preprocessor_.preprocess(new Solution(values), verbose)
        : new Solution(values);
  }
Beispiel #27
0
  public static List sortByName(List employees) {
    EDEmployee temp = null;
    EDEmployee tempA = null;
    EDEmployee tempB = null;

    Vector vctA = null;
    Vector vctB = null;

    for (int i = 0; i < employees.size() - 1; i++) {
      for (int j = i + 1; j < employees.size(); j++) {

        tempA = (EDEmployee) employees.get(i);
        tempB = (EDEmployee) employees.get(j);

        vctA = splitName(tempA.getName());
        vctB = splitName(tempB.getName());

        int compare = compareName(vctA, vctB);

        if (compare > 0) {
          temp = tempA;
          employees.set(i, tempB);
          employees.set(j, temp);
        }
      }
    }
    return employees;
  }
 public List<String> findCellValues(String string) {
   List<String> result = new ArrayList<String>();
   int tagStart = -1;
   int stringStart = -1;
   int column = -1;
   boolean sharedString = false;
   for (int i = 0; i < string.length(); i++) {
     char ch = string.charAt(i);
     if (ch == '<') tagStart = i + 1;
     else if (ch == '>') {
       if (tagStart != -1 && i > tagStart) {
         String tag = string.substring(tagStart, i);
         if (tag.charAt(0) == 'c') {
           sharedString = tag.contains("t=\"s\"");
           column = parseColumn(StringUtilities.findBetween(tag, "r=\"", "\""));
         } else if (tag.startsWith("v") || tag.startsWith("t")) stringStart = i + 1;
         else if (tag.equals("/v") || tag.equals("/t")) {
           if (stringStart != -1 && i > stringStart) {
             for (int j = result.size(); j <= column; j++) result.add("");
             if (sharedString) {
               int index = Integer.parseInt(string.substring(stringStart, tagStart - 1));
               result.set(column, sharedStrings.get(index));
             } else result.set(column, decode(string.substring(stringStart, tagStart - 1)));
           }
           stringStart = -1;
           column = -1;
         }
       }
     }
   }
   return result;
 }
 public List<Double> getImproperDihedralParams(List<String> atoms) {
   List<String> key = new ArrayList<String>(atoms);
   List<String> key2 = new ArrayList<String>(atoms);
   Collections.reverse(key2);
   List<Double> value = improperDihedralParams.get(key);
   if (value == null) {
     value = improperDihedralParams.get(key2);
   }
   if (value == null) {
     key.set(0, "X");
     value = improperDihedralParams.get(key);
   }
   if (value == null) {
     key2.set(0, "X");
     value = improperDihedralParams.get(key2);
   }
   if (value == null) {
     key.set(1, "X");
     value = improperDihedralParams.get(key);
   }
   if (value == null) {
     key2.set(1, "X");
     value = improperDihedralParams.get(key2);
   }
   return value;
 }
Beispiel #30
0
 private static List<StringBuilder> splitAndUnescape(String s) {
   List<StringBuilder> split = new ArrayList<StringBuilder>();
   StringBuilder sb = new StringBuilder();
   split.add(sb);
   for (int i = 0; i < s.length(); i++) {
     char ch = s.charAt(i);
     if (ch == ':') {
       sb = new StringBuilder();
       split.add(sb);
     } else {
       if (ch == '*' && sb.length() == 0) {
         split.set(split.size() - 1, null);
       } else {
         if (split.get(split.size() - 1) == null) {
           split.set(split.size() - 1, sb);
         }
         if (ch == '\\') {
           ch = s.charAt(++i);
         }
       }
       sb.append(ch);
     }
   }
   return split;
 }