Get the index of the parent expression that contains the given index.
Returns -1 if the indexed expression has no parent.

@param index
@return
779574
public int getParentExpressionIndex(int index) {
    if (index == 0) {
      return -1;
    } else {
      int[] parts = findSubexpression(index);
      int parentIndex = subexpressions.get(parts[0]).getParentExpressionIndex(parts[1]);
      
      if (parentIndex == -1) {
        // index refers to a child of this expression.
        return 0;
      } else {
        // Return the index into this expression of the chosen child,
        // plus the index into that expression.
        return parentIndex + parts[2]; 
      }
    }
  }
414006
public E get(int index) {
        if (index >= mSize)
            throw new IndexOutOfBoundsException("Index: " + index + ", Size: "
                    + mSize);

        return index < 0 ? mElements.get(index + mSize) : mElements.get(index);
    }
402109
public int[] getChildIndexes(int index) {
    if (index == 0) {
      if (isConstant()) {
        return new int[0];
      } else {
        int[] result = new int[subexpressions.size()];
        int startIndex = 1;
        for (int i = 0; i < subexpressions.size(); i++) {
          result[i] = startIndex;
          startIndex += subexpressions.get(i).size();
        }
        return result;
      }
    } else {
      int[] parts = findSubexpression(index);
      int[] result = subexpressions.get(parts[0]).getChildIndexes(parts[1]);
      for (int i = 0; i < result.length; i++) {
        result[i] += parts[2];
      }
      return result;
    }
  }
618618
protected void ensureRestrictedIndex(final int index) {
        if (index < 0) throw new IndexOutOfBoundsException("Index (" + index + ") is negative");
        if (index >= size())
            throw new IndexOutOfBoundsException("Index (" + index + ") is greater than or equal to list size (" + (size()) + ")");
    }
114133
protected function parentIndex($index)
	{
		$r = false;
		
		if($index > 1)
		{
			$r = floor($index / 2);
		}
		else if($index === 1)
		{
			$r = null;
		}
		
		return $r;
	}
1243199
public XEvent get(int index) {
		try {
			XEvent event = events.get(index);
			return event;
		} catch (IOException e) {
			e.printStackTrace();
			return null;
		}
	}
398905
public int getIndex() {
        if (parent != null) {
            for (int i = 0; i < parent.children.size(); i++) {
                if (parent.children.get(i) == this) {
                    return i;
                }
            }
        }
        
        return -1;
    }
90195
public boolean getBoolean(int index)
  {
    Object value = _values[index - 1];

    if (value instanceof Boolean) {
      return (Boolean) value;
    }
    else {
      return Boolean.valueOf(value.toString());
    }
  }
920109
Index getIndex(String indexName) {

        Index[] indexes = indexList;
        int     i       = getIndexIndex(indexName);

        return i == -1 ? null
                       : indexes[i];
    }
694576
public int indexOfRelativeIndex(int relativeIndex) {
    for (int i = 0; i < relativeIndices.length; i++) {
      if (relativeIndices[i] == relativeIndex) {
        return i;
      }
    }
    return -1;
  }
655767
public SequenceView<C> get(int index) {
		int start = toStartIndex(index);
		int end  = index + (getWindowSize() - 1);
		return getBackingSequence().getSubSequence(start, end);
	}
254231
public void setIndex(int index) {
        ElementBase parent = getParent();
        
        if (parent == null) {
            CWFException.raise("Element has no parent.");
        }
        
        int currentIndex = parent.children.indexOf(this);
        
        if (currentIndex < 0 || currentIndex == index) {
            return;
        }
        
        parent.moveChild(currentIndex, index);
    }
116064
public static boolean getAt(BitSet self, int index) {
        int i = normaliseIndex(index, self.length());
        return self.get(i);
    }
493510
@SuppressWarnings("unchecked")
    public V getValue(int index)
    {
        if ((index < 0) || (index >= size()))
        {
            throw new IndexOutOfBoundsException();
        }
        return (V) _array[index * 2 + 1];
    }
289315
public boolean isChildOf(GeometryIndex parentIndex, GeometryIndex childIndex) {
		if (parentIndex.getValue() != childIndex.getValue()) {
			return false;
		}
		if (parentIndex.hasChild() && childIndex.hasChild()) {
			return isChildOf(parentIndex.getChild(), childIndex.getChild());
		} else if (!parentIndex.hasChild() && childIndex.hasChild()) {
			return true;
		}
		return false;
	}
1336810
@Override
    public T get(int index) {
        if (displacement != null) {
            return super.get(index - displacement);
        }
        return super.get(index);
    }
581736
function (index) {
		if (arguments.length < 1) {
			return this;
		}
		if (index < 0) {
			index = this.length + index;
		}
		if (hasProperty(this, index)) {
			return this[index];
		}
		return null;
	}