java.util.Stack.setElementAt()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(210)

本文整理了Java中java.util.Stack.setElementAt()方法的一些代码示例,展示了Stack.setElementAt()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stack.setElementAt()方法的具体详情如下:
包路径:java.util.Stack
类名称:Stack
方法名:setElementAt

Stack.setElementAt介绍

暂无

代码示例

代码示例来源:origin: org.apache.pdfbox/pdfbox

  1. private void setNonStrokingColorSpaceStack(PDColorSpace colorSpace)
  2. {
  3. if (nonStrokingColorSpaceStack.isEmpty())
  4. {
  5. nonStrokingColorSpaceStack.add(colorSpace);
  6. }
  7. else
  8. {
  9. nonStrokingColorSpaceStack.setElementAt(colorSpace, nonStrokingColorSpaceStack.size() - 1);
  10. }
  11. }

代码示例来源:origin: org.apache.pdfbox/pdfbox

  1. private void setStrokingColorSpaceStack(PDColorSpace colorSpace)
  2. {
  3. if (strokingColorSpaceStack.isEmpty())
  4. {
  5. strokingColorSpaceStack.add(colorSpace);
  6. }
  7. else
  8. {
  9. strokingColorSpaceStack.setElementAt(colorSpace, strokingColorSpaceStack.size() - 1);
  10. }
  11. }

代码示例来源:origin: com.github.lafa.pdfbox/pdfbox

  1. protected void setStrokingColorSpaceStack(PDColorSpace colorSpace)
  2. {
  3. if (strokingColorSpaceStack.isEmpty())
  4. {
  5. strokingColorSpaceStack.add(colorSpace);
  6. }
  7. else
  8. {
  9. strokingColorSpaceStack.setElementAt(colorSpace, strokingColorSpaceStack.size() - 1);
  10. }
  11. }

代码示例来源:origin: com.github.lafa.pdfbox/pdfbox

  1. protected void setNonStrokingColorSpaceStack(PDColorSpace colorSpace)
  2. {
  3. if (nonStrokingColorSpaceStack.isEmpty())
  4. {
  5. nonStrokingColorSpaceStack.add(colorSpace);
  6. }
  7. else
  8. {
  9. nonStrokingColorSpaceStack.setElementAt(colorSpace, nonStrokingColorSpaceStack.size() - 1);
  10. }
  11. }

代码示例来源:origin: org.wikimodel/org.wikimodel.wem

  1. public void setStackParameter(String name, Object data) {
  2. Stack<Object> set = (Stack<Object>) getStackParameters().get(name);
  3. if (set == null || set.isEmpty()) {
  4. pushStackParameter(name, data);
  5. } else {
  6. set.setElementAt(data, set.size() - 1);
  7. }
  8. }

代码示例来源:origin: apache/fop

  1. /**
  2. * In some cases an RtfContainer must be replaced by another one on the
  3. * stack. This happens when handling nested fo:blocks for example: after
  4. * handling a nested block the enclosing block must switch to a new
  5. * paragraph container to handle what follows the nested block.
  6. * TODO: what happens to elements that are "more on top" than oldC on the
  7. * stack? shouldn't they be closed or something?
  8. * @param oldC old container
  9. * @param newC new container
  10. * @throws Exception if not caught
  11. */
  12. public void replaceContainer(RtfContainer oldC, RtfContainer newC)
  13. throws Exception {
  14. // treating the Stack as a Vector allows such manipulations (yes, I hear you screaming ;-)
  15. final int index = containers.indexOf(oldC);
  16. if (index < 0) {
  17. throw new Exception("container to replace not found:" + oldC);
  18. }
  19. containers.setElementAt(newC, index);
  20. }

代码示例来源:origin: org.apache.uima/jVinci

  1. public void add(Service S) {
  2. makeConsistent(S);
  3. // Get the actual vector index
  4. int mylevel = S.actualLevel;
  5. // Grow the stack if need be
  6. expand(mylevel);
  7. ArrayList v;
  8. if (stack.get(mylevel) == null) {
  9. v = new ArrayList();
  10. v.add(S);
  11. stack.setElementAt(v, mylevel);
  12. } else {
  13. v = (ArrayList) stack.get(mylevel);
  14. v.add(S);
  15. }
  16. pr("Added " + S.toString());
  17. }

代码示例来源:origin: TomRoush/PdfBox-Android

  1. /**
  2. * Set the stroking color space. This will add the colorspace to the PDResources
  3. * if necessary.
  4. *
  5. * @param colorSpace The colorspace to write.
  6. * @throws IOException If there is an error writing the colorspace.
  7. * @deprecated Use {@link #setNonStrokingColor} instead.
  8. */
  9. @Deprecated
  10. public void setNonStrokingColorSpace(PDColorSpace colorSpace) throws IOException
  11. {
  12. if (nonStrokingColorSpaceStack.isEmpty())
  13. {
  14. nonStrokingColorSpaceStack.add(colorSpace);
  15. }
  16. else
  17. {
  18. nonStrokingColorSpaceStack.setElementAt(colorSpace, nonStrokingColorSpaceStack.size() - 1);
  19. }
  20. writeOperand(getName(colorSpace));
  21. writeOperator("cs");
  22. }

代码示例来源:origin: apache/uima-uimaj

  1. public void add(Service S) {
  2. makeConsistent(S);
  3. // Get the actual vector index
  4. int mylevel = S.actualLevel;
  5. // Grow the stack if need be
  6. expand(mylevel);
  7. ArrayList v;
  8. if (stack.get(mylevel) == null) {
  9. v = new ArrayList();
  10. v.add(S);
  11. stack.setElementAt(v, mylevel);
  12. } else {
  13. v = (ArrayList) stack.get(mylevel);
  14. v.add(S);
  15. }
  16. pr("Added " + S.toString());
  17. }

代码示例来源:origin: TomRoush/PdfBox-Android

  1. /**
  2. * Set the stroking color space. This will add the colorspace to the PDResources
  3. * if necessary.
  4. *
  5. * @param colorSpace The colorspace to write.
  6. * @throws IOException If there is an error writing the colorspace.
  7. * @deprecated Use {@link #setStrokingColor} instead.
  8. */
  9. @Deprecated
  10. public void setStrokingColorSpace(PDColorSpace colorSpace) throws IOException
  11. {
  12. if (strokingColorSpaceStack.isEmpty())
  13. {
  14. strokingColorSpaceStack.add(colorSpace);
  15. }
  16. else
  17. {
  18. strokingColorSpaceStack.setElementAt(colorSpace, nonStrokingColorSpaceStack.size() - 1);
  19. }
  20. writeOperand(getName(colorSpace));
  21. writeOperator("CS");
  22. }

代码示例来源:origin: com.github.lafa.pdfbox/pdfbox

  1. /**
  2. * Set the font and font size to draw text with.
  3. *
  4. * @param font The font to use.
  5. * @param fontSize The font size to draw the text.
  6. * @throws IOException If there is an error writing the font information.
  7. */
  8. public void setFont(PDFont font, float fontSize) throws IOException
  9. {
  10. if (fontStack.isEmpty())
  11. {
  12. fontStack.add(font);
  13. }
  14. else
  15. {
  16. fontStack.setElementAt(font, fontStack.size() - 1);
  17. }
  18. writeOperand(resources.add(font));
  19. writeOperand(fontSize);
  20. writeOperator("Tf");
  21. }

代码示例来源:origin: org.apache.pdfbox/pdfbox

  1. /**
  2. * Set the font and font size to draw text with.
  3. *
  4. * @param font The font to use.
  5. * @param fontSize The font size to draw the text.
  6. * @throws IOException If there is an error writing the font information.
  7. */
  8. public void setFont(PDFont font, float fontSize) throws IOException
  9. {
  10. if (fontStack.isEmpty())
  11. {
  12. fontStack.add(font);
  13. }
  14. else
  15. {
  16. fontStack.setElementAt(font, fontStack.size() - 1);
  17. }
  18. if (font.willBeSubset())
  19. {
  20. document.getFontsToSubset().add(font);
  21. }
  22. writeOperand(resources.add(font));
  23. writeOperand(fontSize);
  24. writeOperator("Tf");
  25. }

代码示例来源:origin: org.apache.uima/jVinci

  1. toplevel--;
  2. } else {
  3. stack.setElementAt(newlist, mylevel);

代码示例来源:origin: TomRoush/PdfBox-Android

  1. /**
  2. * Set the font to draw text with.
  3. *
  4. * @param font The font to use.
  5. * @param fontSize The font size to draw the text.
  6. * @throws IOException If there is an error writing the font information.
  7. */
  8. public void setFont(PDFont font, float fontSize) throws IOException
  9. {
  10. if (fontStack.isEmpty())
  11. {
  12. fontStack.add(font);
  13. }
  14. else
  15. {
  16. fontStack.setElementAt(font, fontStack.size() - 1);
  17. }
  18. if (font.willBeSubset() && !document.getFontsToSubset().contains(font))
  19. {
  20. document.getFontsToSubset().add(font);
  21. }
  22. writeOperand(resources.add(font));
  23. writeOperand(fontSize);
  24. writeOperator("Tf");
  25. }

代码示例来源:origin: apache/uima-uimaj

  1. toplevel--;
  2. } else {
  3. stack.setElementAt(newlist, mylevel);

代码示例来源:origin: com.github.lafa.pdfbox/pdfbox

  1. /**
  2. * Set the font and font size to draw text with.
  3. *
  4. * @param font The font to use.
  5. * @param fontSize The font size to draw the text.
  6. * @throws IOException If there is an error writing the font information.
  7. */
  8. @Override
  9. public void setFont(PDFont font, float fontSize) throws IOException
  10. {
  11. if (fontStack.isEmpty())
  12. {
  13. fontStack.add(font);
  14. }
  15. else
  16. {
  17. fontStack.setElementAt(font, fontStack.size() - 1);
  18. }
  19. if (font.willBeSubset())
  20. {
  21. document.getFontsToSubset().add(font);
  22. }
  23. writeOperand(getResources().add(font));
  24. writeOperand(fontSize);
  25. writeOperator("Tf");
  26. }

代码示例来源:origin: TomRoush/PdfBox-Android

  1. strokingColorSpaceStack.setElementAt(color.getColorSpace(),
  2. nonStrokingColorSpaceStack.size() - 1);

代码示例来源:origin: TomRoush/PdfBox-Android

  1. nonStrokingColorSpaceStack.setElementAt(color.getColorSpace(),
  2. nonStrokingColorSpaceStack.size() - 1);

代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps

  1. fix_itm.propagate_items().setElementAt(existing ,l);

代码示例来源:origin: com.ximpleware/vtd-xml

  1. fix_itm.propagate_items().setElementAt(existing ,l);

相关文章