PageRenderTime 109ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/1.1.0/core/src/main/java/com/orientechnologies/orient/core/index/OIndexDefinitionMultiValue.java

http://orient.googlecode.com/
Java | 52 lines | 8 code | 5 blank | 39 comment | 0 complexity | 1ed8ed72eda61f1006ed2d222a0aa498 MD5 | raw file
Possible License(s): Apache-2.0, AGPL-3.0
  1. /*
  2. * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.orientechnologies.orient.core.index;
  17. import java.util.Map;
  18. import com.orientechnologies.orient.core.db.record.OMultiValueChangeEvent;
  19. /**
  20. * Interface that indicates that index definition is based on collection of values but not on single value.
  21. *
  22. * @author <a href="mailto:lomakin.andrey@gmail.com">Andrey Lomakin</a>
  23. * @since 20.12.11
  24. */
  25. public interface OIndexDefinitionMultiValue extends OIndexDefinition {
  26. /**
  27. * Converts passed in value in the key of single index entry.
  28. *
  29. * @param param
  30. * Value to convert.
  31. * @return Index key.
  32. */
  33. public Object createSingleValue(final Object... param);
  34. /**
  35. * Process event that contains operation on collection and extract values that should be added removed from index to reflect
  36. * collection changes in the given index.
  37. *
  38. * @param changeEvent
  39. * Event that describes operation that was performed on collection.
  40. * @param keysToAdd
  41. * Values that should be added to related index.
  42. * @param keysToRemove
  43. * Values that should be removed to related index.
  44. */
  45. public void processChangeEvent(final OMultiValueChangeEvent<?, ?> changeEvent, final Map<Object, Integer> keysToAdd,
  46. final Map<Object, Integer> keysToRemove);
  47. }