1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
/**
* Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Simon McDuff - initial API and implementation
* Ibrahim Sallam - code refactoring for CDO 3.0
*/
package org.eclipse.emf.cdo.server.internal.objectivity.mapper;
import org.eclipse.emf.cdo.server.internal.objectivity.db.ObjyObject;
import org.eclipse.emf.ecore.EStructuralFeature;
/**
* Mapper for composite types (featureMap, manyReference, Multiple...)
*
* @author ibrahim
*/
public interface IManyTypeMapper extends ITypeMapper
{
final String embeddedAttributeName = "value";
final String embeddedAttributeNull = "isNull";
final int valueAttributePosition = 0; // caution, we assume position index here!!!
final int nullAttributePosition = 1; // caution, we assume position index here!!!
// set a single object/value at index.
public void setValue(ObjyObject objyObject, EStructuralFeature feature, int index, Object newValue);
// get a single object/value at index.
public Object getValue(ObjyObject objyObject, EStructuralFeature feature, int index);
// remove a single value at index, it will set the value to default, and mark it
// as "null", i.e. unset.
public Object remove(ObjyObject objyObject, EStructuralFeature feature, int index);
// add value at index (extend the collection size).
public void add(ObjyObject objyObject, EStructuralFeature feature, int index, Object value);
// add all objects starting from an index. (extend the collection size).
public void addAll(ObjyObject objyObject, EStructuralFeature feature, int index, Object[] value);
// clear all collection.
public void clear(ObjyObject objyObject, EStructuralFeature feature);
// this is similar to addAll, but it replaces the existing ones.
public void setAll(ObjyObject objyObject, EStructuralFeature feature, int index, Object[] newValue);
// get all objects/values starting from an index.
public Object[] getAll(ObjyObject objyObject, EStructuralFeature feature, int index, int chunkSize);
// return the size of the collection.
public int size(ObjyObject objyObject, EStructuralFeature feature);
// move element in the feature from sourceIndex to targetIndex
public void move(ObjyObject objyObject, EStructuralFeature feature, int targetIndex, int sourceIndex);
}
|