If not already created, a new <code>pre-destroy</code> element will be created and returned.
Otherwise, the first existing <code>pre-destroy</code> element will be returned.
@return the instance defined for the element <code>pre-destroy</code>
483123
public LifecycleCallbackType<WebAppDescriptor> getOrCreatePreDestroy()
   {
      List<Node> nodeList = model.get("pre-destroy");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new LifecycleCallbackTypeImpl<WebAppDescriptor>(this, "pre-destroy", model, nodeList.get(0));
      }
      return createPreDestroy();
   }
562479
public Node removeFirst()
    {
        Node node = header.getNextNode();
        firstByte += node.ba.last();
        return removeNode( node );
    }
1187612
public FacesConfigRendererType<FacesConfigRenderKitType<T>> getOrCreateRenderer()
   {
      List<Node> nodeList = childNode.get("renderer");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigRendererTypeImpl<FacesConfigRenderKitType<T>>(this, "renderer", childNode, nodeList.get(0));
      }
      return createRenderer();
   }
280406
public RemoveMethodType<SessionBeanType<T>> getOrCreateRemoveMethod()
   {
      List<Node> nodeList = childNode.get("remove-method");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new RemoveMethodTypeImpl<SessionBeanType<T>>(this, "remove-method", childNode, nodeList.get(0));
      }
      return createRemoveMethod();
   }
797744
public IntSet.IntIterator iterator()
  {
    if (isEmpty()) {
      return new IntSet.IntIterator()
      {
        @Override
        public void skipAllBefore(int element) {/*empty*/}

        @Override
        public boolean hasNext() {return false;}

        @Override
        public int next() {throw new NoSuchElementException();}

        @Override
        public void remove() {throw new UnsupportedOperationException();}

        @Override
        public IntSet.IntIterator clone() {throw new UnsupportedOperationException();}
      };
    }
    return new BitIterator();
  }
1365352
public LifecycleCallbackType<SessionBeanType<T>> getOrCreatePrePassivate()
   {
      List<Node> nodeList = childNode.get("pre-passivate");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new LifecycleCallbackTypeImpl<SessionBeanType<T>>(this, "pre-passivate", childNode, nodeList.get(0));
      }
      return createPrePassivate();
   }
283827
public Exclude<Scan<T>> getOrCreateExclude()
   {
      Node node = childNode.getOrCreate("exclude");
      Exclude<Scan<T>> exclude = new ExcludeImpl<Scan<T>>(this, "exclude", childNode, node);
      return exclude;
   }
149194
public Object previous() {
        Object element = null;
        if (previousElement != null) {
            element = previousElement;
            previousElement = null;
        } else {
            element = getPreviousElement();
            if (element == null) {
                throw new java.util.NoSuchElementException();
            }
        }
        return element;
    }
422901
public FacesConfigLifecycleType<FacesConfigType<T>> getOrCreateLifecycle()
   {
      List<Node> nodeList = childNode.get("lifecycle");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigLifecycleTypeImpl<FacesConfigType<T>>(this, "lifecycle", childNode, nodeList.get(0));
      }
      return createLifecycle();
   }
1335177
private T getOrCreate() throws E {
    try {
      T client = elements.poll();
      // a client was available, all good. otherwise, create one
      if (client != null) {
        return client;
      }
      return create();
    } catch (Exception e) {
      // if an exception is thrown after acquiring the semaphore, release the
      // semaphore before propagating the exception
      semaphore.release();
      throw e;
    }
  }
324534
protected T createInstance() {
		try {
			return targetClass.newInstance();
		} catch (InstantiationException e) {
			throw new RuntimeException(e);
		} catch (IllegalAccessException e) {
			throw new RuntimeException(e);
		}
	}
643230
public AnnotationType<ElementType<T>> getOrCreateAnnotation()
   {
      List<Node> nodeList = childNode.get("annotation");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new AnnotationTypeImpl<ElementType<T>>(this, "annotation", childNode, nodeList.get(0));
      }
      return createAnnotation();
   }
587258
@Override
    public RandomElementReader duplicate() {
        if (closed) {
            throw new IllegalStateException("Reader is closed.");
        }

        return new RandomElementReader() {

            private boolean closed = false;
            private int nextElement = 0;

            @Override
            public Element readElement(int index) throws IOException {
                if (closed) {
                    throw new IllegalStateException("Reader closed");
                }
                return BufferedElementReader.this.readElement(index);
            }

            @Override
            public ElementType getElementType() {
                return BufferedElementReader.this.getElementType();
            }

            @Override
            public int getCount() {
                return BufferedElementReader.this.getCount();
            }

            @Override
            public Element readElement() throws IOException {

                if (nextElement >= getCount()) {
                    return null;
                }
                if (closed) {
                    throw new IllegalStateException("Reader closed");
                }
                return BufferedElementReader.this.readElement(nextElement++);
            }

            @Override
            public void close() throws IOException {
                closed = true;
            }

            @Override
            public RandomElementReader duplicate() {
                return BufferedElementReader.this.duplicate();
            }

            @Override
            public boolean isClosed() {
                return closed;
            }
        };
    }
1109101
public Iterator<E> iterator() {
        final Iterator<? extends E> itr = core.iterator();
        return new Iterator<E>() {
            private E last;
            public boolean hasNext() {
                return itr.hasNext();
            }

            public E next() {
                return last=itr.next();
            }

            public void remove() {
                CopyOnWriteList.this.remove(last);
            }
        };
    }
51185
public T one() {
        this.beforeCheck();

        String sql = this.buildSelectSQL(true);

        T model = this.queryOne(modelClass, sql, paramValues);

        ifThen(null != model && null != joinParams,
                () -> this.setJoin(Collections.singletonList(model)));

        return model;
    }
1018783
public Object nextElement()
    {
        try
        {
            if (!hasCalledCheck)
            {    
                hasMoreElements();
            }    
            hasCalledCheck = false;
            if (hasNext)
            {
                Identity oid = getIdentityFromResultSet();
                Identity[] args = {oid};
                return this.constructor.newInstance(args);
            }
            else
                throw new NoSuchElementException();
        }
        catch (Exception ex)
        {
            LoggerFactory.getDefaultLogger().error(ex);
            throw new NoSuchElementException();
        }
    }
104480
@Override
    public Iterator<E> iterator() {
        return new Iterator<E>() {

            private int index = start;
            private int lastReturnedIndex = -1;
            private boolean isFirst = full;

            @Override
            public boolean hasNext() {
                return isFirst || index != end;
            }

            @Override
            public E next() {
                if (!hasNext()) {
                    throw new NoSuchElementException();
                }
                isFirst = false;
                lastReturnedIndex = index;
                index = increment(index);
                return elements[lastReturnedIndex];
            }

            @Override
            public void remove() {
                if (lastReturnedIndex == -1) {
                    throw new IllegalStateException();
                }

                // First element can be removed quickly
                if (lastReturnedIndex == start) {
                    CircularFifoQueue.this.remove();
                    lastReturnedIndex = -1;
                    return;
                }

                int pos = lastReturnedIndex + 1;
                if (start < lastReturnedIndex && pos < end) {
                    // shift in one part
                    System.arraycopy(elements, pos, elements, lastReturnedIndex, end - pos);
                } else {
                    // Other elements require us to shift the subsequent elements
                    while (pos != end) {
                        if (pos >= maxElements) {
                            elements[pos - 1] = elements[0];
                            pos = 0;
                        } else {
                            elements[decrement(pos)] = elements[pos];
                            pos = increment(pos);
                        }
                    }
                }

                lastReturnedIndex = -1;
                end = decrement(end);
                elements[end] = null;
                full = false;
                index = decrement(index);
            }

        };
    }