class OCompositeIndexDefinition extends ODocumentWrapperNoClass implements OIndexDefinition {

  public Object getDocumentValueToIndex(final ODocument iDocument) {
    final List<OCompositeKey> compositeKeys = new ArrayList<OCompositeKey>(10);
    final OCompositeKey firstKey = new OCompositeKey();
    boolean containsCollection = false;

    compositeKeys.add(firstKey);

    for (final OIndexDefinition indexDefinition : indexDefinitions) {
      final Object result = indexDefinition.getDocumentValueToIndex(iDocument);

      if (result == null)
        return null;

      containsCollection = addKey(firstKey, compositeKeys, containsCollection, result);
    }

    if (!containsCollection)
      return firstKey;

    return compositeKeys;
  }

  public  OCompositeIndexDefinition();
  public  OCompositeIndexDefinition(final String iClassName);
  public  OCompositeIndexDefinition(final String iClassName, final List<? extends OIndexDefinition> iIndexes);

}