/*
Internal: Static version of {@link ObjectWrapper#getIndexedValue(Property, int)}.
762627
@SuppressWarnings("unchecked")
    private static Object getIndexedValue(Object obj, Property property, int index, ObjectWrapper options) {
        if (property == null) {
            throw new IllegalArgumentException("Cannot get the indexed value from 'null' property.");
        }

        Object propertyValue = property.get(obj);

        if (propertyValue == null) {
            throw new NullPointerException("Invalid 'null' value found for indexed '" + property + "' in "
                                                   + obj.getClass().getName() + ".");

        }

        if (propertyValue instanceof List) {
            List list = (List) propertyValue;
            int size = list.size();

            if (size < index) {
                if (options.isOutOfBoundsSafety) {
                    return null;
                } else {
                    throw new IndexOutOfBoundsException("The indexed " + property + " in "
                                                                + obj.getClass().getSimpleName() + " object has only '" + size + "' elements," +
                                                                " but index '" + index + "' requested.");
                }
            }

            return list.get(index);
        } else if (propertyValue.getClass().isArray()) {
            int lenght = Array.getLength(propertyValue);

            if (lenght < index && options.isOutOfBoundsSafety) {
                return null;
            }

            try {
                return Array.get(propertyValue, index);
            } catch (ArrayIndexOutOfBoundsException e) {
                throw new IndexOutOfBoundsException("The indexed " + property + " in "
                                                            + obj.getClass().getSimpleName() + " object has only '" + lenght + "' elements," +
                                                            " but index '" + index + "' requested.");

            }
        } else if (propertyValue instanceof Iterable) {
            Iterable iterable = (Iterable) propertyValue;

            int k = 0;
            for (Object object : iterable) {
                if (k == index) {
                    return object;
                }

                k++;// Hopefully not an infinite iteration
            }

            // Nothing found
            if (options.isOutOfBoundsSafety) {
                return null;
            } else {
                throw new IndexOutOfBoundsException("The indexed " + property + " in "
                                                            + obj.getClass().getSimpleName() + " object has less than '" + index + "'" +
                                                            " elements.");
            }
        } else {
            throw new IllegalArgumentException("Cannot get an indexed value from the not indexed " + property
                                                       + ". Only List, array and Iterable types are supported, but " + property.getType().getSimpleName()
                                                       + " found.");
        }
    }
394248
@SuppressWarnings("unchecked")
    private <T> List<T> getListValue(Class<T> type, String propertyName, EDBObject object) {
        List<T> temp = new ArrayList<>();
        for (int i = 0;; i++) {
            String property = getEntryNameForList(propertyName, i);
            Object obj = object.getObject(property);
            if (obj == null) {
                break;
            }
            if (OpenEngSBModel.class.isAssignableFrom(type)) {
                obj = convertEDBObjectToUncheckedModel(type, edbService.getObject(object.getString(property)));
            }
            temp.add((T) obj);
            object.remove(property);
        }
        return temp;
    }
638176
@Override
	public Object getValueAt(final int row, final int visibleColumnIndex) {
		final int actualIndex = this.visibilityManager.getActualIndexFromVisibleIndex(visibleColumnIndex);
		return getRecords().get(row).getColumnValue(actualIndex);
	}
984796
public int get1Value(int index) {
        try {
            return( value.get(index) );
        }
        catch (IndexOutOfBoundsException e) {
            Log.e(TAG, "X3D MFInt32 get1Value(index) out of bounds." + e);
        }
        catch (Exception e) {
            Log.e(TAG, "X3D MFInt32 get1Value(index) exception " + e);
        }
        return -1;
    }
881114
public int getValueIndex() {

        int result = 0;
        Node previousSibling = getElement().getPreviousSibling();
        while (previousSibling != null) {
            result++;
            previousSibling = previousSibling.getPreviousSibling();
        }
        return result;
    }
1138606
@Override
	public Number getValue(ValueDimension dim, int index) {
		return values.get(dim).get(index);
	}
185020
public static <T, IV> int detectIndexWith(
            T[] objectArray,
            Predicate2<? super T, IV> predicate,
            IV injectedValue)
    {
        if (objectArray == null)
        {
            throw new IllegalArgumentException("Cannot perform a detectIndexWith on null");
        }
        for (int i = 0; i < objectArray.length; i++)
        {
            if (predicate.accept(objectArray[i], injectedValue))
            {
                return i;
            }
        }
        return -1;
    }
524428
private static int index(Object o) {
        Integer i = TYPE_INDICES.get(o);
        if (i == null) {
            synchronized (TYPE_INDICES) {
                // check that another thread did not already update the index
                i = TYPE_INDICES.get(o);
                if (i != null)
                    return i;
                else {
                    int j = TYPE_INDICES.size();
                    TYPE_INDICES.put(o, j);
                    TYPES.add(o);
                    return j;
                }
            }
        }
        return i;
    }
336673
private static function getIndexValue(AbstractClassContent $content, $indexedField)
    {
        if ('@' === substr($indexedField, 0, 1)) {
            // parameter indexation
            return self::getParamValue($content, substr($indexedField, 1));
        } else {
            // element indexation
            return self::getContentValue($content, $indexedField);
        }
    }
1209769
<T> T getValue( Object object, String name )
	{
		T result = getPropertyImpl( object, name );
		if( result instanceof Property )
		{
			@SuppressWarnings( "unchecked" )
			Property<T> property = ((Property<T>) result);
			return property.getValue();
		}

		return result;
	}
810608
private IndexedPropertyMethodMetadata<?> getIndexedPropertyMethodMetadata(Collection<MethodMetadata<?, ?>> methodMetadataOfType) {
        for (MethodMetadata methodMetadata : methodMetadataOfType) {
            AnnotatedMethod annotatedMethod = methodMetadata.getAnnotatedMethod();
            Annotation indexedAnnotation = annotatedMethod.getByMetaAnnotation(IndexDefinition.class);
            if (indexedAnnotation != null) {
                if (!(methodMetadata instanceof PrimitivePropertyMethodMetadata)) {
                    throw new XOException("Only primitive properties are allowed to be used for indexing.");
                }
                return new IndexedPropertyMethodMetadata<>((PropertyMethod) annotatedMethod, (PrimitivePropertyMethodMetadata) methodMetadata,
                        metadataFactory.createIndexedPropertyMetadata((PropertyMethod) annotatedMethod));
            }
        }
        return null;
    }
694108
public LazyType getType(int index) throws LazyException{
		LazyNode token=getValueToken(index);
		switch(token.type){
			case LazyNode.OBJECT: return LazyType.OBJECT;
			case LazyNode.ARRAY: return LazyType.ARRAY;
			case LazyNode.VALUE_TRUE: return LazyType.BOOLEAN;
			case LazyNode.VALUE_FALSE: return LazyType.BOOLEAN;
			case LazyNode.VALUE_NULL: return LazyType.NULL;
			case LazyNode.VALUE_STRING: return LazyType.STRING;
			case LazyNode.VALUE_ESTRING: return LazyType.STRING;
			case LazyNode.VALUE_INTEGER: return LazyType.INTEGER;
			case LazyNode.VALUE_FLOAT: return LazyType.FLOAT;
		}
		return null;
	}
449986
public String getValue(String propertyName, int index) throws JspCoreException {
        if (rows.size() > index) {
            QueryRow qr = (QueryRow) rows.elementAt(index);
            return (qr.getValue(propertyName));
        }
        else
            return (null);
    }
590577
final int getIndexValue() {
        if (anteContextLength == pattern.length()) {
            // A pattern with just ante context {such as foo)>bar} can
            // match any key.
            return -1;
        }
        int c = UTF16.charAt(pattern, anteContextLength);
        return data.lookupMatcher(c) == null ? (c & 0xFF) : -1;
    }
423273
private static int findIndexOfValue(final Method method) {
        int index = 0;
        for (Annotation[] annotations : method.getParameterAnnotations()) {
            for (Annotation a : annotations) {
                if (XBValue.class.equals(a.annotationType())) {
                    return index;
                }
            }
            ++index;
        }
        return 0; // If no attribute is annotated, the first one is taken.
    }
418145
Object getIndexedType(int index)
    {
        Object ae = indexedElementMap.get(index);
        if (ae == null)
        {
            throw new VerifyError("constant pool at "+index+" not proper type");
        }
        return ae;
    }
732932
public int getValueAsInt(int index) throws IOException {
        if (index >= structure.valueSizes.size()) {
            throw new IOException("Index " + index + " is out of range.");
        }
        return Bytes.toInt(value, structure.valueByteOffsets.get(index));
    }