Examples of ByteList


Examples of com.gs.collections.api.list.primitive.ByteList

        }
        if (!(otherList instanceof ByteList))
        {
            return false;
        }
        ByteList list = (ByteList) otherList;
        return list.isEmpty();
    }
View Full Code Here

Examples of it.unimi.dsi.fastutil.bytes.ByteList

                if (!block.isSoftClipped()) {

                    final int vrPos = var.getPosition() + entry.getPosition();
                    if (hasReadDeletion(var) && vrPos >= block.getStart() && vrPos <= block.getEnd()) {

                        ByteList leftBases = new ByteArrayList(block.getBases());
                        ByteList leftScores = new ByteArrayList(block.getQualities());
                        ByteList rightBases = new ByteArrayList(block.getBases());
                        ByteList rightScores = new ByteArrayList(block.getQualities());
                        int deletionPosition = var.getPosition() - 1;
                        leftBases = leftBases.subList(0, deletionPosition);
                        rightBases = rightBases.subList(deletionPosition, rightBases.size());

                        leftScores = leftScores.subList(0, deletionPosition);
                        rightScores = rightScores.subList(deletionPosition, rightScores.size());

                        AlignmentBlock left = AlignmentBlock.getInstance(getChr(), block.getStart(),
                                leftBases.toByteArray(new byte[leftBases.size()]),
                                leftScores.toByteArray(new byte[leftScores.size()]));

                        AlignmentBlock right = AlignmentBlock.getInstance(getChr(), block.getStart() + leftBases.size()
                                + var.getFrom().length(),
                                rightBases.toByteArray(new byte[rightBases.size()]),
                                rightScores.toByteArray(new byte[rightScores.size()]));

                        blocks.remove(block);
                        newBlocks.add(left);
                        newBlocks.add(right);
View Full Code Here

Examples of macromedia.asc.util.ByteList

        int return_type = type != null ? addClassName(type.getName(cx)) : 0;
       

        IntList param_types = null;
        IntList param_values = null;
        ByteList param_kinds = null;

        {
            ObjectValue obj = cx.scope();
            Slots slots = obj.slots;

            if (slots != null)
            {
                param_types = new IntList(slots.size());
                param_values = new IntList(slots.size()); // default values
                param_kinds = new ByteList(slots.size());
   
                Iterator<Slot> it = slots.iterator();
                //it.next(); // first one is this
                boolean value_required = false;
                for (int i = 1; it.hasNext() && i < max_params; ++i)
                {
                    Slot slot = it.next();
                    int type_index = addClassName(slot.getType().getName(cx));
                    param_types.add(type_index);
   
                    int value_index = 0;
                    byte value_kind = 0;
                    ObjectValue iv = slot.getInitializerValue();
                    if (iv != null)
                    {
                        value_required = true;
                        String value = iv.toString();
                        NumberUsage numberUsage = iv.getNumberUsage();
                        TypeValue defaultValueType = slot.getInitializerValue().type != null ? slot.getInitializerValue().type.getTypeValue() : null;
                        if (defaultValueType == cx.booleanType())
                        {
                            // The index doesn't matter, as long as its non 0
                            // there are no boolean values in any cpool, instead the value will be determined by the kind byte
                            value_index = value.equals("true")?CONSTANT_True:CONSTANT_False;
                            value_kind = value.equals("true")?CONSTANT_True:CONSTANT_False;
                        }
                        else if (defaultValueType == cx.stringType())
                        {
                            value_index = ab.addUtf8Constant(bytecodeFactory.ConstantUtf8Info(value));
                            value_kind = CONSTANT_Utf8;
                        }
                        else if (defaultValueType == cx.intType())
                        {
                            value_index = ab.addIntConstant(bytecodeFactory.ConstantIntegerInfo(getValueOfNumberLiteral(value,new TypeValue[1], numberUsage).intValue()));
                            value_kind = CONSTANT_Integer;
                        }
                        else if ((defaultValueType == cx.doubleType()) || (cx.abcVersion(Features.TARGET_AVM1) && (defaultValueType == cx.uintType())))
                        {
                            value_index = ab.addDoubleConstant(bytecodeFactory.ConstantDoubleInfo(getValueOfNumberLiteral(value,new TypeValue[1], numberUsage).doubleValue()));
                            value_kind = CONSTANT_Double;
                        }
                        else if (defaultValueType == cx.uintType())
                        {
                            value_index = ab.addUintConstant(bytecodeFactory.ConstantUintInfo(getValueOfNumberLiteral(value,new TypeValue[1], numberUsage).uintValue()));
                            value_kind = CONSTANT_UInteger;
                        }
                        else if (cx.statics.es4_numerics && (defaultValueType == cx.decimalType()))
                        {
                            value_index = ab.addDecimalConstant(bytecodeFactory.ConstantDecimalInfo(getValueOfNumberLiteral(value,new TypeValue[1], numberUsage).decimalValue()));
                            value_kind = CONSTANT_Decimal;
                        }
                        else if (defaultValueType == cx.nullType())
                        {
                            // Similar to boolean above, the value will be determined by the kind byte (there is only 1 possible value for null)
                            value_index = CONSTANT_Null;
                            value_kind = CONSTANT_Null;
                        }
                        else if (defaultValueType == cx.voidType())
                        {
                            value_index = 0; // will be undefined at runtime
                            value_kind = 0;
                        }
                        else if (slot.getInitializerValue() instanceof NamespaceValue )
                        {
                            value_index = addNamespace(slot.getInitializerValue());
                            value_kind = CONSTANT_Namespace;
                        }
                    }
                    if (value_required)
                    {
                        param_values.add(value_index);
                        param_kinds.add(value_kind);
                    }
                }
                if (value_required)
                {
                    flags |= METHOD_HasOptional;
View Full Code Here

Examples of org.apache.commons.collections.primitives.ByteList

    protected ByteList makeEmptyByteList() {
        return new ArrayByteList();
    }
   
    protected ByteList makeFullByteList() {
        ByteList list = makeEmptyByteList();
        byte[] elts = getFullElements();
        for(int i=0;i<elts.length;i++) {
            list.add((byte)elts[i]);
        }
        return list;
    }
View Full Code Here

Examples of org.apache.xerces.xs.datatypes.ByteList

                    System.out.println(d.getValue());
                    break;
                   
                case XSConstants.HEXBINARY_DT:
                case XSConstants.BASE64BINARY_DT:
                    ByteList list = (ByteList)value;
                    System.out.println(list.getLength());
                    break;
                   
                case XSConstants.LIST_DT:
                case XSConstants.LISTOFUNION_DT:
                    ObjectList l = (ObjectList)value;
View Full Code Here

Examples of org.gephi.data.attributes.type.ByteList

    public static AbstractList<?> fromArray(Object array) {
        Class<?> componentType = array.getClass().getComponentType();

        if (componentType == byte.class)
            return new ByteList((byte[]) array);
        else if (componentType == Byte.class)
            return new ByteList((Byte[]) array);

        else if (componentType == short.class)
            return new ShortList((short[]) array);
        else if (componentType == Short.class)
            return new ShortList((Short[]) array);
View Full Code Here

Examples of org.jruby.util.ByteList

    /** inspect_hash
     *
     */
    private IRubyObject inspectHash(final ThreadContext context) {
        final ByteList buffer = new ByteList();
        buffer.append('{');
        final boolean[] firstEntry = new boolean[1];

        firstEntry[0] = true;
        visitAll(new Visitor() {
            public void visit(IRubyObject key, IRubyObject value) {
                if (!firstEntry[0]) buffer.append(',').append(' ');

                buffer.append(inspect(context, key).getByteList());
                buffer.append('=').append('>');
                buffer.append(inspect(context, value).getByteList());
                firstEntry[0] = false;
            }
        });
        buffer.append('}');
        return getRuntime().newString(buffer);
    }
View Full Code Here

Examples of org.jruby.util.ByteList

    public IRubyObject captures(ThreadContext context) {
        return match_array(context.getRuntime(), 1);
    }

    private int nameToBackrefNumber(RubyString str) {
        ByteList value = str.getByteList();
        try {
            return pattern.nameToBackrefNumber(value.bytes, value.begin, value.begin + value.realSize, regs);
        } catch (JOniException je) {
            throw getRuntime().newIndexError(je.getMessage());
        }
View Full Code Here

Examples of org.jruby.util.ByteList

    /** inspect_ary
     *
     */
    private IRubyObject inspectAry(ThreadContext context) {
        ByteList buffer = new ByteList();
        buffer.append('[');
        boolean tainted = isTaint();

        for (int i = 0; i < realLength; i++) {
            if (i > 0) buffer.append(',').append(' ');

            RubyString str = inspect(context, values[begin + i]);
            if (str.isTaint()) tainted = true;
            buffer.append(str.getByteList());
        }
        buffer.append(']');

        RubyString str = getRuntime().newString(buffer);
        if (tainted) str.setTaint(true);

        return str;
View Full Code Here

Examples of org.jruby.util.ByteList

        if (!sep.isNil()) {
            sep = strSep = sep.convertToString();
            len += strSep.getByteList().length() * (realLength - 1);
        }

        ByteList buf = new ByteList((int)len);
        for (int i = begin; i < begin + realLength; i++) {
            IRubyObject tmp;
            try {
                tmp = values[i];
            } catch (ArrayIndexOutOfBoundsException e) {
                concurrentModification();
                return runtime.newString("");
            }
            if (tmp instanceof RubyString) {
                // do nothing
            } else if (tmp instanceof RubyArray) {
                if (runtime.isInspecting(tmp)) {
                    tmp = runtime.newString("[...]");
                } else {
                    tmp = inspectJoin(context, (RubyArray)tmp, sep);
                }
            } else {
                tmp = RubyString.objAsString(context, tmp);
            }

            if (i > begin && !sep.isNil()) buf.append(strSep.getByteList());

            buf.append(tmp.asString().getByteList());
            if (tmp.isTaint()) taint = true;
        }

        RubyString result = runtime.newString(buf);

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.