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
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: add
 
        GrammarNonterminalSymbol nonterminal = new GrammarNonterminalSymbol('S');
        GrammarSymbol symbol = new GrammarTerminalSymbol('a');
        GrammarRule rule = new GrammarRule(nonterminal, symbol, nonterminal);
        GrammarRule rule1 = new GrammarRule(nonterminal, symbol);
        List<GrammarRule> rules = new Vector<GrammarRule>();
        rules.add(rule);
        rules.add(rule1);
        Grammar gr = new Grammar(nonterminal);
        Grammar gr1 = new Grammar(rules, nonterminal);
        gr.addRule(rule);
        gr.addRule(rule1);
 
        assertFalse(gr1.allRules().isEmpty());
        assertTrue(gr.allRules().containsAll(rules));
        assertTrue(gr1.allRules().containsAll(gr.allRules()));
        assertEquals(2, gr.allRules().size());
        assertEquals(gr.getStartSymbol(), gr1.getStartSymbol());
        assertEquals(nonterminal, gr.getStartSymbol());
    } 
Full Snippet Info
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
  private final Lock _msgLock = new ReentrantLock();
  private final Condition _newMsgCondition = _msgLock.newCondition();
 
  public SimpleObjectCaptureHandler() 
  { 
    _messages = new Vector<Object>();
  } 
 
  public void clear() 
  { 
    _msgLock.lock();
    try 
    { 
      _messages.clear();
    } 
    finally 
    { 
      _messages.clear();
    } 
  } 
Full Snippet Info
9
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: size
    /** 
     * Returns an array containing all of the String descriptions 
     * available in this enum. 
     */ 
    public String[] descriptions() {
        String retval[] = new String[names.size()];
        names.copyInto(retval);
        return (retval);
    } 
} 
Full Snippet Info
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: size
    public static TagContext current() { 
        return currentStack.get().peek();
    } 
 
    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; 
    } 
 
Full Snippet Info
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: pop, add
public class StackNotEmptySpec extends StackSpec { 
  @Test 
  @Named("pop removes last element") 
  @Order(1) 
  public void _popRemovesLastElement() throws Exception { 
    Stack<String> _stack = new Stack<String>();
    final Stack<String> stack = _stack;
    stack.add("something");
    String _pop = stack.pop();
    boolean _doubleArrow = Should.<String>operator_doubleArrow(_pop, "something");
    Assert.assertTrue("\nExpected stack.pop => \"something\" but"
     + "\n     stack.pop is " + new org.hamcrest.StringDescription().appendValue(_pop).toString()
     + "\n     stack is " + new org.hamcrest.StringDescription().appendValue(stack).toString() + "\n", _doubleArrow);
     
  } 
} 
Full Snippet Info
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Java 8 Vector Questions & Answers:

See Code Examples for Java 8 Vector Methods: