LinkedList getLast - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for LinkedList getLast method.

This code example shows how to use the following methods:isEmpty, getLast, removeLast
	 * @see org.springframework.batch.item.xml.stax.AbstractEventWriterWrapper#add(javax.xml.stream.events.XMLEvent) 
	 */ 
	@Override 
	public void add(XMLEvent event) throws XMLStreamException {
		if (isUnopenedElementCloseEvent(event)) {
			QName element = unopenedElements.removeLast();
			String nsPrefix = !StringUtils.hasText(element.getPrefix()) ? "" : element.getPrefix() + ":";
			try { 
				super.flush(); 
				ioWriter.write("</" + nsPrefix + element.getLocalPart() + ">");
				ioWriter.flush();
			} 
			catch (IOException ioe) {
				throw new DataAccessResourceFailureException("Unable to close tag: " + element, ioe);
			} 
		} else { 
			super.add(event);
		} 
	} 
 

6
CodeRank
This code example shows how to use the following methods:isEmpty, getLast, removeLast, size
        return new JList(); 
    } 
     
    private Object objectDone2(){
        JSON o =_stack.removeLast();
        if ( _nameStack.size() > 0 )
            _nameStack.removeLast();
        else if ( _stack.size() > 0 ) {
	    throw new IllegalStateException( "something is wrong" );
	} 
        return (JSON)o;
    } 
 
    public Object objectDone(){
        String name = curName();
        Object o = objectDone2();
        JSON b = (JSON)o;
 
        // override the object if it's a special type 
	if ( ! _lastArray ) {

6
CodeRank
This code example shows how to use the following methods:getLast, pop
        threadLocalTopPages.set(newPage);
    } 
 
    public static void popPage(){ 
        LinkedList<Page> stack = getStack();
        stack.pop();
        //should check whether getLast return null if there is no element left 
        threadLocalTopPages.set(stack.getLast());
    } 
 
    //push values in page 
    public static void pushValue(boolean b){
        getTopPage().pushValue(b);
    } 
 
    public static void pushValue(byte b){
        getTopPage().pushValue(b);
    } 
 
    public static void pushValue(char c){
5
CodeRank
This code example shows how to use the following methods:isEmpty, getLast, size
        return new JList(); 
    } 
     
    private Object objectDone2(){
        JSON o =_stack.removeLast();
        if ( _nameStack.size() > 0 )
            _nameStack.removeLast();
        else if ( _stack.size() > 0 ) {
	    throw new IllegalStateException( "something is wrong" );
	} 
        return (JSON)o;
    } 
 
    public Object objectDone(){
        String name = curName();
        Object o = objectDone2();
        JSON b = (JSON)o;
 
        // override the object if it's a special type 
	if ( ! _lastArray ) {

5
CodeRank
This code example shows how to use the following methods:getLast, removeLast, size
    JButton back = new JButton(backIcon);
    back.addActionListener(new ActionListener()
    { 
      public void actionPerformed(ActionEvent ev)
      { 
        if (history.size() > 1)
          { 
            URL last = (URL) history.removeLast();
            last = (URL) history.getLast();
            url.setText(last.toString());
            try 
              { 
                html.setPage(last);
              } 
            catch (IOException ex)
              { 
                // Do something more useful. 
                ex.printStackTrace();
              } 
          } 
5
CodeRank
This code example shows how to use the following methods:getLast, removeLast, size
   public Object pop()
   { 
      //For this we need $old functionality 
      //* @@org.jboss.aspects.dbc.PostCond ({"$tgt.top() == $rtn"}) 
      final Object popped = top();
      elements.removeLast();
      return popped;
   } 
 
   public Object top()
   { 
      if (elements.size() == 0)
      { 
         return null; 
      } 
      return elements.getLast();
   } 
 
   public boolean isEmpty() 
   { 
      return elements.size() == 0;
5
CodeRank
This code example shows how to use the following methods:getLast
 
        return element;
    } 
 
    public Object getParent() {
        return this.parents.getLast();
    } 
 
    public Object getParent(int index) {
        ListIterator it = this.parents.listIterator( this.parents.size() );
        int x = 0;
        Object parent = null;
        while ( x++ <= index ) {
            parent = it.previous();
        } 
        return parent;
    } 
 
    public Object removeParent() {
        Object parent = this.parents.removeLast();
5
CodeRank
This code example shows how to use the following methods:getLast
 
    /** 
     * Returns the last error reported 
     */ 
    public Message getLastError() {
        return (Message) this.errors.getLast();
    } 
     
    /** 
     * Convenience routine to return the specified error's 
     * underlying SyntaxException, or null if it isn't one. 
     */ 
    public SyntaxException getSyntaxError(int index) {
        SyntaxException exception = null;
 
        Message message = getError(index);
        if (message != null && message instanceof SyntaxErrorMessage) {
            exception = ((SyntaxErrorMessage) message).getCause();
        } 
        return exception;
5
CodeRank
This code example shows how to use the following methods:getLast
		return ffworld.getFirst(); 
 
	} 
 
	public ForceFieldBlock ffworld_getLast() { 
		return ffworld.getLast(); 
 
	} 
 
	public void ffworld_removefirst() { 
		ffworld.removeFirst(); 
	} 
 
	public void ffworld_remove(int Projektor_ID) { 
 
		for (int i = 0; i < ffworld.size(); i++) { 
			ForceFieldBlock ffb = ffworld.get(i); 
			if (ffb.getProjektor_ID() == Projektor_ID) { 
				ffworld.remove(i); 
			} 
5
CodeRank
This code example shows how to use the following methods:isEmpty, add, getLast
      return; 
 
    validateParameters(tElement, parameters);
 
    // If the stack is empty, start from HTML 
    if (stack.isEmpty() && tElement.getHTMLTag() != HTML.Tag.HTML)
      { 
        Element html = dtd.getElement(HTML.Tag.HTML.toString());
        openFictionalTag(html); 
      } 
 
    Object v = tagIsValidForContext(tElement);
    if (v != Boolean.TRUE)
      { 
        // The tag is not valid for context, the content 
        // model suggest to open another tag. 
        if (v instanceof Element)
          { 
            int n = 0;
            while (v instanceof Element && (n++ < 100))

5
CodeRank
getLast Method Overview
Returns the last element in this list.
See Code Examples for other Java 8 LinkedList Methods: