예제 #1
2
  @Override
  protected Transferable createTransferable(JComponent c) {
    JTextPane aTextPane = (JTextPane) c;

    HTMLEditorKit kit = ((HTMLEditorKit) aTextPane.getEditorKit());
    StyledDocument sdoc = aTextPane.getStyledDocument();
    int sel_start = aTextPane.getSelectionStart();
    int sel_end = aTextPane.getSelectionEnd();

    int i = sel_start;
    StringBuilder output = new StringBuilder();
    while (i < sel_end) {
      Element e = sdoc.getCharacterElement(i);
      Object nameAttr = e.getAttributes().getAttribute(StyleConstants.NameAttribute);
      int start = e.getStartOffset(), end = e.getEndOffset();
      if (nameAttr == HTML.Tag.BR) {
        output.append("\n");
      } else if (nameAttr == HTML.Tag.CONTENT) {
        if (start < sel_start) {
          start = sel_start;
        }
        if (end > sel_end) {
          end = sel_end;
        }
        try {
          String str = sdoc.getText(start, end - start);
          output.append(str);
        } catch (BadLocationException ble) {
          Debug.error(me + "Copy-paste problem!\n%s", ble.getMessage());
        }
      }
      i = end;
    }
    return new StringSelection(output.toString());
  }
예제 #2
1
    // create from a dataset
    public VariableBean(Variable vs) {
      this.vs = vs;
      // vs = (v instanceof VariableEnhanced) ? (VariableEnhanced) v : new VariableStandardized( v);

      setName(vs.getShortName());
      setDescription(vs.getDescription());
      setUnits(vs.getUnitsString());
      setDataType(vs.getDataType().toString());

      // Attribute csAtt = vs.findAttribute("_coordSystems");
      // if (csAtt != null)
      //  setCoordSys( csAtt.getStringValue());

      // collect dimensions
      StringBuilder lens = new StringBuilder();
      StringBuilder names = new StringBuilder();
      java.util.List dims = vs.getDimensions();
      for (int j = 0; j < dims.size(); j++) {
        ucar.nc2.Dimension dim = (ucar.nc2.Dimension) dims.get(j);
        if (j > 0) {
          lens.append(",");
          names.append(",");
        }
        String name = dim.isShared() ? dim.getName() : "anon";
        names.append(name);
        lens.append(dim.getLength());
      }
      setDimensions(names.toString());
      setShape(lens.toString());
    }
예제 #3
1
  /** 選択されている行をコピーする。 */
  public void copyRow() {

    StringBuilder sb = new StringBuilder();
    int numRows = view.getTable().getSelectedRowCount();
    int[] rowsSelected = view.getTable().getSelectedRows();
    int numColumns = view.getTable().getColumnCount();

    for (int i = 0; i < numRows; i++) {
      if (tableModel.getObject(rowsSelected[i]) != null) {
        StringBuilder s = new StringBuilder();
        for (int col = 0; col < numColumns; col++) {
          Object o = view.getTable().getValueAt(rowsSelected[i], col);
          if (o != null) {
            s.append(o.toString());
          }
          s.append(",");
        }
        if (s.length() > 0) {
          s.setLength(s.length() - 1);
        }
        sb.append(s.toString()).append("\n");
      }
    }
    if (sb.length() > 0) {
      StringSelection stsel = new StringSelection(sb.toString());
      Toolkit.getDefaultToolkit().getSystemClipboard().setContents(stsel, stsel);
    }
  }
  /**
   * Returns date in the format: neededDatePattern, in case if year or month isn't entered, current
   * year/month is put.
   *
   * @return correct date.
   */
  private Date getCorrectedDate(String enteredDate) {
    Queue<String> dateParts = new ArrayDeque<>(3);
    StringBuilder number = new StringBuilder();
    for (char symbol : enteredDate.toCharArray()) {
      if (Character.isDigit(symbol)) {
        number.append(symbol);
      } else if (number.length() > 0) {
        dateParts.add(number.toString());
        number = new StringBuilder();
      }
    }
    if (number.length() > 0) {
      dateParts.add(number.toString());
    }

    Calendar currentDate = Calendar.getInstance();
    switch (dateParts.size()) {
      case 1:
        dateParts.add(Integer.toString(currentDate.get(Calendar.MONTH) + 1));
      case 2:
        dateParts.add(Integer.toString(currentDate.get(Calendar.YEAR)));
    }

    try {
      return new SimpleDateFormat("dd.MM.yyyy")
          .parse(dateParts.remove() + '.' + dateParts.remove() + '.' + dateParts.remove());

    } catch (ParseException e) {
      throw new RuntimeException(e); // todo change exception
    }
  }
    // Called on a separate worker thread, not the event thread, and
    // hence cannot write to textArea.
    public String doInBackground() {
      StringBuilder sb = new StringBuilder();
      // int count = 0;
      // for (String url : urls) {
      // System.out.println("Fetching " + url);
      String page = getPage(url, 200), result = String.format("%-40s%7d%n", url, page.length());
      // sb.append(result); // (1)
      if (isCancelled()) // (3)
      return sb.toString();

      setProgress((100 * c.incrementAndGet()) / urls.length); // (2)
      publish(result); // (4)
      // }
      return sb.toString();
    }
예제 #6
1
  // tokenizes a string for PBM and PGM headers and plain PBM and PGM data.  If oneChar is true,
  // then
  // rather than parsing a whole string, a single character is read (not including whitespace or
  // comments)
  static String tokenizeString(InputStream stream, boolean oneChar) throws IOException {
    final int EOF = -1;

    StringBuilder b = new StringBuilder();
    int c;
    boolean inComment = false;

    while (true) {
      c = stream.read();
      if (c == EOF)
        throw new IOException(
            "Stream ended prematurely, before table reading was completed."); // no more tokens
      else if (inComment) {
        if (c == '\r' || c == '\n') // escape the comment
        inComment = false;
        else {
        } // do nothing
      } else if (Character.isWhitespace((char) c)) {
      } // do nothing
      else if (c == '#') // start of a comment
      {
        inComment = true;
      } else // start of a string
      {
        b.append((char) c);
        break;
      }
    }

    if (oneChar) return b.toString();

    // at this point we have a valid string.  We read until whitespace or a #
    while (true) {
      c = stream.read();
      if (c == EOF) break;
      else if (c == '#') // start of comment, read until a '\n'
      {
        while (true) {
          c = stream.read(); // could hit EOF, which is fine
          if (c == EOF) break;
          else if (c == '\r' || c == '\n') break;
        }
        // break;   // comments are not delimiters
      } else if (Character.isWhitespace((char) c)) break;
      else b.append((char) c);
    }
    return b.toString();
  }
  private boolean getNextEntryURL(String allText, int entryNumber, Map<String, JLabel> entries) {
    String toFind = "<div class=\"numbering\">";
    int index = allText.indexOf(toFind, piv);
    int endIndex = allText.indexOf("<br clear=\"all\" />", index);
    piv = endIndex;

    if (index >= 0) {
      String text = allText.substring(index, endIndex);
      // Always try RIS import first
      Matcher fullCitation = ACMPortalFetcher.FULL_CITATION_PATTERN.matcher(text);
      String item;
      if (fullCitation.find()) {
        String link = getEntryBibTeXURL(fullCitation.group(1));
        if (endIndex > 0) {
          StringBuilder sb = new StringBuilder();

          // Find authors:
          String authMarker = "<div class=\"authors\">";
          int authStart = text.indexOf(authMarker);
          if (authStart >= 0) {
            int authEnd = text.indexOf("</div>", authStart + authMarker.length());
            if (authEnd >= 0) {
              sb.append("<p>").append(text.substring(authStart, authEnd)).append("</p>");
            }
          }
          // Find title:
          Matcher titM = ACMPortalFetcher.TITLE_PATTERN.matcher(text);
          if (titM.find()) {
            sb.append("<p>").append(titM.group(1)).append("</p>");
          }

          String sourceMarker = "<div class=\"source\">";
          int sourceStart = text.indexOf(sourceMarker);
          if (sourceStart >= 0) {
            int sourceEnd = text.indexOf("</div>", sourceStart + sourceMarker.length());
            if (sourceEnd >= 0) {
              String sourceText = text.substring(sourceStart, sourceEnd);
              // Find source:
              Matcher source = ACMPortalFetcher.SOURCE_PATTERN.matcher(sourceText);
              if (source.find()) {
                sb.append("<p>").append(source.group(1)).append("</p>");
              }
            }
          }

          item = sb.toString();
        } else {
          item = link;
        }

        JLabel preview = new JLabel("<html>" + item + "</html>");
        preview.setPreferredSize(new Dimension(750, 100));
        entries.put(link, preview);
        return true;
      }
      LOGGER.warn("Citation unmatched " + Integer.toString(entryNumber));
      return false;
    }
    return false;
  }
  @NotNull
  protected JLabel formatToLabel(@NotNull JLabel label) {
    label.setIcon(myIcon);

    if (!myFragments.isEmpty()) {
      final StringBuilder text = new StringBuilder();
      text.append("<html><body style=\"white-space:nowrap\">");

      for (int i = 0; i < myFragments.size(); i++) {
        final String fragment = myFragments.get(i);
        final SimpleTextAttributes attributes = myAttributes.get(i);
        final Object tag = getFragmentTag(i);
        if (tag instanceof BrowserLauncherTag) {
          formatLink(text, fragment, attributes, ((BrowserLauncherTag) tag).myUrl);
        } else {
          formatText(text, fragment, attributes);
        }
      }

      text.append("</body></html>");
      label.setText(text.toString());
    }

    return label;
  }
  @Nullable
  private LookupFile getClosestParent(final String typed) {
    if (typed == null) return null;
    LookupFile lastFound = myFinder.find(typed);
    if (lastFound == null) return null;
    if (lastFound.exists()) {
      if (typed.charAt(typed.length() - 1) != File.separatorChar) return lastFound.getParent();
      return lastFound;
    }

    final String[] splits = myFinder.normalize(typed).split(myFileSpitRegExp);
    StringBuilder fullPath = new StringBuilder();
    for (int i = 0; i < splits.length; i++) {
      String each = splits[i];
      fullPath.append(each);
      if (i < splits.length - 1) {
        fullPath.append(myFinder.getSeparator());
      }
      final LookupFile file = myFinder.find(fullPath.toString());
      if (file == null || !file.exists()) return lastFound;
      lastFound = file;
    }

    return lastFound;
  }
예제 #10
1
  /**
   * Escapes all '<', '>' and '&' characters in a string.
   *
   * @param str A String.
   * @return HTMlEncoded String.
   */
  private static String htmlencode(String str) {
    if (str == null) {
      return "";
    } else {
      StringBuilder buf = new StringBuilder();
      for (char ch : str.toCharArray()) {
        switch (ch) {
          case '<':
            buf.append("&lt;");
            break;

          case '>':
            buf.append("&gt;");
            break;

          case '&':
            buf.append("&amp;");
            break;

          default:
            buf.append(ch);
            break;
        }
      }
      return buf.toString();
    }
  }
예제 #11
1
 @NotNull
 public static String rightJustify(@NotNull String text, int width, char fillChar) {
   final StringBuilder builder = new StringBuilder(text);
   for (int i = text.length(); i < width; i++) {
     builder.insert(0, fillChar);
   }
   return builder.toString();
 }
예제 #12
0
  /**
   * InputMethod implementation For details read
   * http://docs.oracle.com/javase/7/docs/technotes/guides/imf/api-tutorial.html
   */
  @Override
  protected void processInputMethodEvent(InputMethodEvent e) {
    int commitCount = e.getCommittedCharacterCount();

    if (commitCount > 0) {
      myInputMethodUncommitedChars = null;
      AttributedCharacterIterator text = e.getText();
      if (text != null) {
        StringBuilder sb = new StringBuilder();

        //noinspection ForLoopThatDoesntUseLoopVariable
        for (char c = text.first(); commitCount > 0; c = text.next(), commitCount--) {
          if (c >= 0x20
              && c
                  != 0x7F) { // Hack just like in
                             // javax.swing.text.DefaultEditorKit.DefaultKeyTypedAction
            sb.append(c);
          }
        }

        myTerminalStarter.sendString(sb.toString());
      }
    } else {
      myInputMethodUncommitedChars = uncommitedChars(e.getText());
    }
  }
예제 #13
0
  public int searchWord(@NotNull Editor editor, int count, boolean whole, int dir) {
    TextRange range = SearchHelper.findWordUnderCursor(editor);
    if (range == null) {
      return -1;
    }

    StringBuilder pattern = new StringBuilder();
    if (whole) {
      pattern.append("\\<");
    }
    pattern.append(EditorHelper.getText(editor, range.getStartOffset(), range.getEndOffset()));
    if (whole) {
      pattern.append("\\>");
    }

    MotionGroup.moveCaret(editor, range.getStartOffset());

    lastSearch = pattern.toString();
    setLastPattern(editor, lastSearch);
    lastOffset = "";
    lastDir = dir;

    searchHighlight(true);

    return findItOffset(editor, editor.getCaretModel().getOffset(), count, lastDir, true);
  }
예제 #14
0
  public static String ObtenerHash(String stringToHash) {
    if (stringToHash.length() > 5) {
      try {
        MessageDigest md5 = MessageDigest.getInstance("MD5");
        byte[] bytes = md5.digest(stringToHash.getBytes());
        StringBuilder sb = new StringBuilder(2 * bytes.length);

        for (int i = 0; i < bytes.length; i++) {
          int low = bytes[i] & 0x0f;
          int high = (bytes[i] & 0xf0) >> 4;
          sb.append(HEXADECIMAL[high]);
          sb.append(HEXADECIMAL[low]);
        }

        return sb.toString();

      } catch (NoSuchAlgorithmException e) {
        // Manejo de Excepcion
        System.out.println("Excepción: No se pudo obtener la suma de verificación");
        return null;
      }
    } else {
      System.out.println("Se necesitan 5 caracteres como minimo para crear la suma");
      System.out.println("LA cedena devuelsa sera nula");
    }
    return null;
  }
  private void setupPanels(@Nullable ProjectTemplate template) {

    restorePanel(myNamePathComponent, 4);
    restorePanel(myModulePanel, myWizardContext.isCreatingNewProject() ? 8 : 6);
    restorePanel(myExpertPanel, myWizardContext.isCreatingNewProject() ? 1 : 0);
    mySettingsStep = myModuleBuilder == null ? null : myModuleBuilder.modifySettingsStep(this);

    String description = null;
    if (template != null) {
      description = template.getDescription();
      if (StringUtil.isNotEmpty(description)) {
        StringBuilder sb = new StringBuilder("<html><body><font ");
        sb.append(SystemInfo.isMac ? "" : "face=\"Verdana\" size=\"-1\"").append('>');
        sb.append(description).append("</font></body></html>");
        description = sb.toString();
        myDescriptionPane.setText(description);
      }
    }

    myExpertPlaceholder.setVisible(
        !(myModuleBuilder instanceof TemplateModuleBuilder)
            && myExpertPanel.getComponentCount() > 0);
    for (int i = 0; i < 6; i++) {
      myModulePanel.getComponent(i).setVisible(!(myModuleBuilder instanceof EmptyModuleBuilder));
    }
    myDescriptionPanel.setVisible(StringUtil.isNotEmpty(description));

    mySettingsPanel.revalidate();
    mySettingsPanel.repaint();
  }
  @Override
  public void execute(ArrayList<ClassNode> classNodeList) {
    JOptionPane pane =
        new JOptionPane(
            "WARNING: This will load the classes into the JVM and execute allatori decrypter function"
                + BytecodeViewer.nl
                + "for each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE.");
    Object[] options = new String[] {"Continue", "Cancel"};
    pane.setOptions(options);
    JDialog dialog = pane.createDialog(BytecodeViewer.viewer, "Bytecode Viewer - WARNING");
    dialog.setVisible(true);
    Object obj = pane.getValue();
    int result = -1;
    for (int k = 0; k < options.length; k++) if (options[k].equals(obj)) result = k;

    if (result == 0) {
      try {

        if (!className.equals("*")) {
          for (ClassNode classNode : classNodeList) {
            if (classNode.name.equals(className)) scanClassNode(classNode);
          }
        } else {
          for (ClassNode classNode : classNodeList) {
            scanClassNode(classNode);
          }
        }
      } catch (Exception e) {
        new ExceptionUI(e, "github.com/Szperak");
      } finally {
        frame.appendText(out.toString());
        frame.setVisible(true);
      }
    }
  }
예제 #17
0
 private String findLongestCommonSubstring(String[] strings) {
   final StringBuilder builder = new StringBuilder();
   int pos = 0;
   while (true) {
     if (pos == strings[0].length()) {
       return builder.toString();
     }
     char c = strings[0].charAt(pos);
     for (int i = 0, imax = strings.length; i < imax; ++i) {
       if (pos == strings[i].length() || c != strings[i].charAt(pos)) {
         return builder.toString();
       }
     }
     builder.append(c);
   }
 }
예제 #18
0
  @Override
  public void keyTyped(final KeyEvent e) {
    if (undo == null || control(e) || DELNEXT.is(e) || DELPREV.is(e) || ESCAPE.is(e)) return;

    text.pos(text.cursor());
    // string to be added
    String ch = String.valueOf(e.getKeyChar());

    // remember if marked text is to be deleted
    boolean del = true;
    final byte[] txt = text.text();
    if (TAB.is(e)) {
      if (text.marked()) {
        // check if lines are to be indented
        final int s = Math.min(text.pos(), text.start());
        final int l = Math.max(text.pos(), text.start()) - 1;
        for (int p = s; p <= l && p < txt.length; p++) del &= txt[p] != '\n';
        if (!del) {
          text.indent(s, l, e.isShiftDown());
          ch = null;
        }
      } else {
        boolean c = true;
        for (int p = text.pos() - 1; p >= 0 && c; p--) {
          final byte b = txt[p];
          c = ws(b);
          if (b == '\n') break;
        }
        if (c) ch = "  ";
      }
    }

    // delete marked text
    if (text.marked() && del) text.delete();

    if (ENTER.is(e)) {
      // adopt indentation from previous line
      final StringBuilder sb = new StringBuilder(1).append(e.getKeyChar());
      int s = 0;
      for (int p = text.pos() - 1; p >= 0; p--) {
        final byte b = txt[p];
        if (b == '\n') break;
        if (b == '\t') {
          s += 2;
        } else if (b == ' ') {
          s++;
        } else {
          s = 0;
        }
      }
      for (int p = 0; p < s; p++) sb.append(' ');
      ch = sb.toString();
    }

    if (ch != null) text.add(ch);
    text.setCaret();
    rend.calc();
    showCursor(2);
    e.consume();
  }
  @Override
  public String getEventMessage(LocatableEvent event) {
    final Location location = event.location();
    String sourceName;
    try {
      sourceName = location.sourceName();
    } catch (AbsentInformationException e) {
      sourceName = getFileName();
    }

    final boolean printFullTrace = Registry.is("debugger.breakpoint.message.full.trace");

    StringBuilder builder = new StringBuilder();
    if (printFullTrace) {
      builder.append(
          DebuggerBundle.message(
              "status.line.breakpoint.reached.full.trace",
              DebuggerUtilsEx.getLocationMethodQName(location)));
      try {
        final List<StackFrame> frames = event.thread().frames();
        renderTrace(frames, builder);
      } catch (IncompatibleThreadStateException e) {
        builder.append("Stacktrace not available: ").append(e.getMessage());
      }
    } else {
      builder.append(
          DebuggerBundle.message(
              "status.line.breakpoint.reached",
              DebuggerUtilsEx.getLocationMethodQName(location),
              sourceName,
              getLineIndex() + 1));
    }
    return builder.toString();
  }
 public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr)
     throws BadLocationException {
   StringBuilder builder = new StringBuilder(string);
   // 过滤用户输入的所有字符
   filterInt(builder);
   super.insertString(fb, offset, builder.toString(), attr);
 }
예제 #21
0
  /**
   * formatCardType.
   *
   * @param card a {@link forge.Card} object.
   * @return a {@link java.lang.String} object.
   */
  public static String formatCardType(Card card) {
    ArrayList<String> list = card.getType();
    StringBuilder sb = new StringBuilder();

    ArrayList<String> superTypes = new ArrayList<String>();
    ArrayList<String> cardTypes = new ArrayList<String>();
    ArrayList<String> subTypes = new ArrayList<String>();
    for (String t : list) {
      if (CardUtil.isASuperType(t)) superTypes.add(t);
      if (CardUtil.isACardType(t)) cardTypes.add(t);
      if (CardUtil.isASubType(t)) subTypes.add(t);
    }

    for (String type : superTypes) {
      sb.append(type).append(" ");
    }
    for (String type : cardTypes) {
      sb.append(type).append(" ");
    }
    if (!subTypes.isEmpty()) sb.append("- ");
    for (String type : subTypes) {
      sb.append(type).append(" ");
    }

    return sb.toString();
  }
예제 #22
0
  public static EventHandler<ActionEvent> getBrowseHandler(
      FXController controller, TextField filePath) {
    FileChooser fileChooser = new FileChooser();
    fileChooser.setTitle("Select a file to upload...");

    return e -> {
      if (AESCTR.secretKey == null) {
        new Alert(Alert.AlertType.INFORMATION, "Please generate or choose a key", ButtonType.OK)
            .showAndWait();
        return;
      }

      selectedFiles = fileChooser.showOpenMultipleDialog(null);
      if (selectedFiles != null) {
        controller.writeLog("Selected files: ");
        StringBuilder sb = new StringBuilder(1024);

        for (int i = 0; i < selectedFiles.size(); i++) {
          if (i == selectedFiles.size() - 1) {
            sb.append(selectedFiles.get(i).getAbsolutePath());
          } else {
            sb.append(selectedFiles.get(i).getAbsolutePath() + ", ");
          }
          controller.writeLog(selectedFiles.get(i).getName());
        }
        filePath.setText(sb.toString());
      }
    };
  }
예제 #23
0
 private String getFormattedStackTrace(StackTraceElement[] stacktrace) {
   StringBuilder sb = new StringBuilder();
   for (StackTraceElement element : stacktrace) {
     sb.append(element.toString()).append("\n");
   }
   return sb.toString();
 }
예제 #24
0
  /** Add import statements to the current tab for the specified library */
  public void importLibrary(UserLibrary lib) throws IOException {
    // make sure the user didn't hide the sketch folder
    ensureExistence();

    List<String> list = lib.getIncludes();
    if (list == null) {
      File srcFolder = lib.getSrcFolder();
      String[] headers = Base.headerListFromIncludePath(srcFolder);
      list = Arrays.asList(headers);
    }
    if (list.isEmpty()) {
      return;
    }

    // import statements into the main sketch file (code[0])
    // if the current code is a .java file, insert into current
    // if (current.flavor == PDE) {
    SketchFile file = editor.getCurrentTab().getSketchFile();
    if (file.isExtension(Sketch.SKETCH_EXTENSIONS)) editor.selectTab(0);

    // could also scan the text in the file to see if each import
    // statement is already in there, but if the user has the import
    // commented out, then this will be a problem.
    StringBuilder buffer = new StringBuilder();
    for (String aList : list) {
      buffer.append("#include <");
      buffer.append(aList);
      buffer.append(">\n");
    }
    buffer.append('\n');
    buffer.append(editor.getCurrentTab().getText());
    editor.getCurrentTab().setText(buffer.toString());
    editor.getCurrentTab().setSelection(0, 0); // scroll to start
  }
예제 #25
0
 @Override
 JComponent description() {
   StringBuilder sb =
       new StringBuilder(
           "<html>"
               + Localization.lang("Changes have been made to the following metadata elements")
               + ":<p>");
   for (MetaDataChangeUnit unit : changes) {
     sb.append("<br>&nbsp;&nbsp;");
     sb.append(unit.key);
     /*switch (unit.type) {
         case ADD:
             sb.append("<p>Added: "+unit.key);
             break;
         case REMOVE:
             sb.append("<p>Removed: "+unit.key);
             break;
         case MODIFY:
             sb.append("<p>Modified: "+unit.key);
             break;
     }*/
   }
   sb.append("</html>");
   tp.setText(sb.toString());
   return sp;
 }
예제 #26
0
 private static String generateKey(final int size) {
   StringBuilder sb = new StringBuilder();
   for (int i = 0; i < size; i++) {
     int idx = rand.nextInt(ALPHANUMERIC.length());
     sb.append(ALPHANUMERIC.substring(idx, idx + 1));
   }
   return (sb.toString());
 }
예제 #27
0
 private String convertTraceToSeq(XTrace trace) {
   StringBuilder sb = new StringBuilder();
   for (XEvent e : trace) {
     sb.append(e.getAttributes().get("concept:name"));
     sb.append(" ");
   }
   return sb.toString();
 }
예제 #28
0
 public String toString() {
   StringBuilder sb = new StringBuilder();
   for (Iterator<Integer> integerIterator = digits.iterator(); integerIterator.hasNext(); ) {
     sb.append(integerIterator.next());
     if (integerIterator.hasNext()) sb.append(".");
   }
   return sb.toString();
 }
 @Override
 @NonNls
 public String toString() {
   StringBuilder sb = new StringBuilder("Content name=").append(myDisplayName);
   if (myIsLocked) sb.append(", pinned");
   if (myExecutionId != 0) sb.append(", executionId=").append(myExecutionId);
   return sb.toString();
 }
예제 #30
0
  protected String consume(BufferedReader br) throws Exception {
    StringBuilder ret = new StringBuilder();

    int ch;
    while ((ch = br.read()) != -1) ret.appendCodePoint(ch);

    return ret.toString();
  }