当前位置: 首页>>代码示例>>Java>>正文


Java EmptyArray类代码示例

本文整理汇总了Java中libcore.util.EmptyArray的典型用法代码示例。如果您正苦于以下问题:Java EmptyArray类的具体用法?Java EmptyArray怎么用?Java EmptyArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EmptyArray类属于libcore.util包,在下文中一共展示了EmptyArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: receiveDirectImpl

import libcore.util.EmptyArray; //导入依赖的package包/类
private SocketAddress receiveDirectImpl(ByteBuffer target, boolean loop) throws IOException {
    SocketAddress retAddr = null;
    DatagramPacket receivePacket = new DatagramPacket(EmptyArray.BYTE, 0);
    int oldposition = target.position();
    int received;
    do {
        received = IoBridge.recvfrom(false, fd, target, 0, receivePacket, isConnected());
        if (receivePacket.getAddress() != null) {
            // copy the data of received packet
            if (received > 0) {
                target.position(oldposition + received);
            }
            retAddr = receivePacket.getSocketAddress();
            break;
        }
    } while (loop);
    return retAddr;
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:19,代码来源:DatagramChannelImpl.java

示例2: parseForClass

import libcore.util.EmptyArray; //导入依赖的package包/类
/**
 * Parses the generic signature of a class and creates the data structure
 * representing the signature.
 *
 * @param genericDecl the GenericDeclaration calling this method
 * @param signature the generic signature of the class
 */
public void parseForClass(GenericDeclaration genericDecl, String signature) {
    setInput(genericDecl, signature);
    if (!eof) {
        parseClassSignature();
    } else {
        if(genericDecl instanceof Class) {
            Class c = (Class) genericDecl;
            this.formalTypeParameters = EmptyArray.TYPE_VARIABLE;
            this.superclassType = c.getSuperclass();
            Class<?>[] interfaces = c.getInterfaces();
            if (interfaces.length == 0) {
                this.interfaceTypes = ListOfTypes.EMPTY;
            } else {
                this.interfaceTypes = new ListOfTypes(interfaces);
            }
        } else {
            this.formalTypeParameters = EmptyArray.TYPE_VARIABLE;
            this.superclassType = Object.class;
            this.interfaceTypes = ListOfTypes.EMPTY;
        }
    }
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:30,代码来源:GenericSignatureParser.java

示例3: parseForMethod

import libcore.util.EmptyArray; //导入依赖的package包/类
/**
 * Parses the generic signature of a method and creates the data structure
 * representing the signature.
 *
 * @param genericDecl the GenericDeclaration calling this method
 * @param signature the generic signature of the class
 */
public void parseForMethod(GenericDeclaration genericDecl,
        String signature, Class<?>[] rawExceptionTypes) {
    setInput(genericDecl, signature);
    if (!eof) {
        parseMethodTypeSignature(rawExceptionTypes);
    } else {
        Method m = (Method) genericDecl;
        this.formalTypeParameters = EmptyArray.TYPE_VARIABLE;
        Class<?>[] parameterTypes = m.getParameterTypes();
        if (parameterTypes.length == 0) {
            this.parameterTypes = ListOfTypes.EMPTY;
        } else {
            this.parameterTypes = new ListOfTypes(parameterTypes);
        }
        Class<?>[] exceptionTypes = m.getExceptionTypes();
        if (exceptionTypes.length == 0) {
            this.exceptionTypes = ListOfTypes.EMPTY;
        } else {
            this.exceptionTypes = new ListOfTypes(exceptionTypes);
        }
        this.returnType = m.getReturnType();
    }
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:31,代码来源:GenericSignatureParser.java

示例4: parseForConstructor

import libcore.util.EmptyArray; //导入依赖的package包/类
/**
 * Parses the generic signature of a constructor and creates the data
 * structure representing the signature.
 *
 * @param genericDecl the GenericDeclaration calling this method
 * @param signature the generic signature of the class
 */
public void parseForConstructor(GenericDeclaration genericDecl,
        String signature, Class<?>[] rawExceptionTypes) {
    setInput(genericDecl, signature);
    if (!eof) {
        parseMethodTypeSignature(rawExceptionTypes);
    } else {
        Constructor c = (Constructor) genericDecl;
        this.formalTypeParameters = EmptyArray.TYPE_VARIABLE;
        Class<?>[] parameterTypes = c.getParameterTypes();
        if (parameterTypes.length == 0) {
            this.parameterTypes = ListOfTypes.EMPTY;
        } else {
            this.parameterTypes = new ListOfTypes(parameterTypes);
        }
        Class<?>[] exceptionTypes = c.getExceptionTypes();
        if (exceptionTypes.length == 0) {
            this.exceptionTypes = ListOfTypes.EMPTY;
        } else {
            this.exceptionTypes = new ListOfTypes(exceptionTypes);
        }
    }
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:30,代码来源:GenericSignatureParser.java

示例5: resolveTypes

import libcore.util.EmptyArray; //导入依赖的package包/类
private Type[] resolveTypes(List<Type> unresolved) {
    int size = unresolved.size();
    if (size == 0) {
        return EmptyArray.TYPE;
    }
    Type[] result = new Type[size];
    for (int i = 0; i < size; i++) {
        Type type = unresolved.get(i);
        try {
            result[i] = ((ParameterizedTypeImpl) type).getResolvedType();
        } catch (ClassCastException e) {
            result[i] = type;
        }
    }
    return result;
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:17,代码来源:ListOfTypes.java

示例6: ArrayMap

import libcore.util.EmptyArray; //导入依赖的package包/类
/**
 * Create a new ArrayMap with a given initial capacity.
 */
public ArrayMap(int capacity) {
    if (capacity == 0) {
        mHashes = EmptyArray.INT;
        mArray = EmptyArray.OBJECT;
    } else {
        allocArrays(capacity);
    }
    mSize = 0;
}
 
开发者ID:Gracker,项目名称:Android-Framework-Tools-Utils,代码行数:13,代码来源:ArrayMap.java

示例7: clear

import libcore.util.EmptyArray; //导入依赖的package包/类
/**
 * Make the array map empty.  All storage is released.
 */
@Override
public void clear() {
    if (mSize > 0) {
        freeArrays(mHashes, mArray, mSize);
        mHashes = EmptyArray.INT;
        mArray = EmptyArray.OBJECT;
        mSize = 0;
    }
}
 
开发者ID:Gracker,项目名称:Android-Framework-Tools-Utils,代码行数:13,代码来源:ArrayMap.java

示例8: LongSparseLongArray

import libcore.util.EmptyArray; //导入依赖的package包/类
/**
 * Creates a new SparseLongArray containing no mappings that will not
 * require any additional memory allocation to store the specified
 * number of mappings.  If you supply an initial capacity of 0, the
 * sparse array will be initialized with a light-weight representation
 * not requiring any additional array allocations.
 */
public LongSparseLongArray(int initialCapacity) {
    if (initialCapacity == 0) {
        mKeys = EmptyArray.LONG;
        mValues = EmptyArray.LONG;
    } else {
        mKeys = ArrayUtils.newUnpaddedLongArray(initialCapacity);
        mValues = new long[mKeys.length];
    }
    mSize = 0;
}
 
开发者ID:Gracker,项目名称:Android-Framework-Tools-Utils,代码行数:18,代码来源:LongSparseLongArray.java

示例9: ArraySet

import libcore.util.EmptyArray; //导入依赖的package包/类
/**
 * Create a new ArraySet with a given initial capacity.
 */
public ArraySet(int capacity) {
    if (capacity == 0) {
        mHashes = EmptyArray.INT;
        mArray = EmptyArray.OBJECT;
    } else {
        allocArrays(capacity);
    }
    mSize = 0;
}
 
开发者ID:Gracker,项目名称:Android-Framework-Tools-Utils,代码行数:13,代码来源:ArraySet.java

示例10: clear

import libcore.util.EmptyArray; //导入依赖的package包/类
/**
 * Make the array map empty.  All storage is released.
 */
@Override
public void clear() {
    if (mSize != 0) {
        freeArrays(mHashes, mArray, mSize);
        mHashes = EmptyArray.INT;
        mArray = EmptyArray.OBJECT;
        mSize = 0;
    }
}
 
开发者ID:Gracker,项目名称:Android-Framework-Tools-Utils,代码行数:13,代码来源:ArraySet.java

示例11: LongSparseArray

import libcore.util.EmptyArray; //导入依赖的package包/类
/**
 * Creates a new LongSparseArray containing no mappings that will not
 * require any additional memory allocation to store the specified
 * number of mappings.  If you supply an initial capacity of 0, the
 * sparse array will be initialized with a light-weight representation
 * not requiring any additional array allocations.
 */
public LongSparseArray(int initialCapacity) {
    if (initialCapacity == 0) {
        mKeys = EmptyArray.LONG;
        mValues = EmptyArray.OBJECT;
    } else {
        mKeys = ArrayUtils.newUnpaddedLongArray(initialCapacity);
        mValues = ArrayUtils.newUnpaddedObjectArray(initialCapacity);
    }
    mSize = 0;
}
 
开发者ID:Gracker,项目名称:Android-Framework-Tools-Utils,代码行数:18,代码来源:LongSparseArray.java

示例12: SparseLongArray

import libcore.util.EmptyArray; //导入依赖的package包/类
/**
 * Creates a new SparseLongArray containing no mappings that will not
 * require any additional memory allocation to store the specified
 * number of mappings.  If you supply an initial capacity of 0, the
 * sparse array will be initialized with a light-weight representation
 * not requiring any additional array allocations.
 */
public SparseLongArray(int initialCapacity) {
    if (initialCapacity == 0) {
        mKeys = EmptyArray.INT;
        mValues = EmptyArray.LONG;
    } else {
        mValues = ArrayUtils.newUnpaddedLongArray(initialCapacity);
        mKeys = new int[mValues.length];
    }
    mSize = 0;
}
 
开发者ID:Gracker,项目名称:Android-Framework-Tools-Utils,代码行数:18,代码来源:SparseLongArray.java

示例13: SparseBooleanArray

import libcore.util.EmptyArray; //导入依赖的package包/类
/**
 * Creates a new SparseBooleanArray containing no mappings that will not
 * require any additional memory allocation to store the specified
 * number of mappings.  If you supply an initial capacity of 0, the
 * sparse array will be initialized with a light-weight representation
 * not requiring any additional array allocations.
 */
public SparseBooleanArray(int initialCapacity) {
    if (initialCapacity == 0) {
        mKeys = EmptyArray.INT;
        mValues = EmptyArray.BOOLEAN;
    } else {
        mKeys = ArrayUtils.newUnpaddedIntArray(initialCapacity);
        mValues = new boolean[mKeys.length];
    }
    mSize = 0;
}
 
开发者ID:Gracker,项目名称:Android-Framework-Tools-Utils,代码行数:18,代码来源:SparseBooleanArray.java

示例14: SparseArray

import libcore.util.EmptyArray; //导入依赖的package包/类
/**
 * Creates a new SparseArray containing no mappings that will not
 * require any additional memory allocation to store the specified
 * number of mappings.  If you supply an initial capacity of 0, the
 * sparse array will be initialized with a light-weight representation
 * not requiring any additional array allocations.
 */
public SparseArray(int initialCapacity) {
    if (initialCapacity == 0) {
        mKeys = EmptyArray.INT;
        mValues = EmptyArray.OBJECT;
    } else {
        mValues = ArrayUtils.newUnpaddedObjectArray(initialCapacity);
        mKeys = new int[mValues.length];
    }
    mSize = 0;
}
 
开发者ID:Gracker,项目名称:Android-Framework-Tools-Utils,代码行数:18,代码来源:SparseArray.java

示例15: LongArray

import libcore.util.EmptyArray; //导入依赖的package包/类
/**
 * Creates an empty LongArray with the specified initial capacity.
 */
public LongArray(int initialCapacity) {
    if (initialCapacity == 0) {
        mValues = EmptyArray.LONG;
    } else {
        mValues = ArrayUtils.newUnpaddedLongArray(initialCapacity);
    }
    mSize = 0;
}
 
开发者ID:Gracker,项目名称:Android-Framework-Tools-Utils,代码行数:12,代码来源:LongArray.java


注:本文中的libcore.util.EmptyArray类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。