Java 8 Vector - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Vector class.

This code example shows how to use the following methods: size
     
    public static TagContext parent() { 
        if(currentStack.get().size() < 2) {
            return null; 
        } 
        return currentStack.get().get(currentStack.get().size()-2);
    } 
     
    public static boolean hasParentTag(String name) {
        for(int i=currentStack.get().size()-1; i>=0; i--) {
            if(name.equals(currentStack.get().get(i).tagName)) {
                return true; 
            } 
        } 
        return false; 
    } 
     
    public static TagContext parent(String name) {
        for(int i=currentStack.get().size()-2; i>=0; i--) {
            if(name.equals(currentStack.get().get(i).tagName)) {
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
 
    final String _name;
    final int _maxThreads;
 
    private final AtomicInteger _inProgress = new AtomicInteger(0);
    private final List<MyThread> _threads = new Vector<MyThread>();
    private final BlockingQueue<T> _queue;
    private final MyThreadGroup _myThreadGroup;
} 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
import java.util.List; 
import java.util.Vector; 
 
public class Scenario { 
 
  private List<ScenarioAction> actionList = new Vector<ScenarioAction>(); 
 
  public void add(ScenarioAction action) { 
    actionList.add(action); 
  } 
 
  public List<ScenarioAction> getActionList() { 
    return new ArrayList<ScenarioAction>(actionList); 
  } 
 
  public int size() { 
    return actionList.size(); 
  } 
 
  public ScenarioAction get(int i) { 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: peek, size
 * 
 * <p>NOTE: nodes are added to the JDOM via the method #basicAddChild such that 
 * the nodes in the newly created JDOM are not fragmented. 
 */ 
protected void addChild(IDOMNode child) {
	if (this.fStack.size() > 0) {
		DOMNode parent = (DOMNode) this.fStack.peek();
		if (this.fBuildingCU || this.fBuildingType) {
			parent.basicAddChild(child);
		} 
	} 
} 
/** 
 * @see IDOMFactory#createCompilationUnit(String, String) 
 */ 
public IDOMCompilationUnit createCompilationUnit(char[] contents, char[] name) {
	return createCompilationUnit(new CompilationUnit(contents, name));
} 
/** 
 * @see IDOMFactory#createCompilationUnit(String, String) 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: peek, pop, push, size
  } 
 
  /** Tests pop and peek. */ 
  public void testPopAndPeek() { 
    Stack<String> testStack = createStack();
    int x = testStack.size();
    Object item = testStack.peek();
    assertTrue(testStack.pop() == item);
    assertEquals(x - 1, testStack.size());
  } 
 
  /** Tests push and peek. */ 
  public void testPushAndPeek() { 
    Stack<String> testStack = createStack();
    int x = testStack.size();
    String item = "4";
    testStack.push(item);
    assertEquals(x + 1, testStack.size());
    assertTrue(testStack.peek() == item);
  } 

8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 Vector Questions & Answers:

See Code Examples for Java 8 Vector Methods: