Java Queue Usage isListBased(Class type)

Here you can find the source of isListBased(Class type)

Description

Return whether the supplied type (collection) is list based.

License

Open Source License

Parameter

Parameter Description
type Type to check

Return

Whether it needs list ordering

Declaration

public static boolean isListBased(Class type) 

Method Source Code

//package com.java2s;
/**********************************************************************
 Copyright (c) 2004 Andy Jefferson and others. All rights reserved.
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.//from ww  w.j a  va 2 s .  co  m
    

 Contributors:
 2007 Xuan Baldauf - Make error message "023011" a little bit more verbose
 ...
 **********************************************************************/

public class Main {
    /**
     * Return whether the supplied type (collection) is list based.
     * @param type Type to check
     * @return Whether it needs list ordering
     */
    public static boolean isListBased(Class type) {
        if (type == null) {
            return false;
        } else if (java.util.List.class.isAssignableFrom(type)) {
            return true;
        } else if (java.util.Queue.class.isAssignableFrom(type)) {
            // Queue needs ordering
            return true;
        }
        return false;
    }
}

Related

  1. bQToString(Queue bQ)
  2. convertQueueToArray(Queue q)
  3. elementFail(Queue q)
  4. get(Queue queue, int index)
  5. getAllElementsFromQueueAsList(Queue queue)
  6. isQueue(final Object value, final boolean acceptNull)
  7. loadBalancingLeftHeavy(List tasks, int size)
  8. offerUntilSuccess(T entry, Queue queue)
  9. parsePathToStack(String path)

  10. HOME | Copyright © www.java2s.com 2016