]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/VariantAccessor.java
Added addFirst/After/Before + remove SCL functions for Ordered Sets
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / accessor / VariantAccessor.java
1 /*******************************************************************************
2  *  Copyright (c) 2010 Association for Decentralized Information Management in
3  *  Industry THTH ry.
4  *  All rights reserved. This program and the accompanying materials
5  *  are made available under the terms of the Eclipse Public License v1.0
6  *  which accompanies this distribution, and is available at
7  *  http://www.eclipse.org/legal/epl-v10.html
8  *
9  *  Contributors:
10  *      VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.databoard.accessor;
13
14 import org.simantics.databoard.accessor.error.AccessorConstructionException;
15 import org.simantics.databoard.accessor.error.AccessorException;
16 import org.simantics.databoard.binding.Binding;
17 import org.simantics.databoard.type.Datatype;
18 import org.simantics.databoard.type.VariantType;
19
20
21 public interface VariantAccessor extends Accessor {
22
23         /**
24          * Get an accessor to the variant's content. 
25          * 
26          * @return value
27          * @throws AccessorException
28          */
29         <T extends Accessor> T getContentAccessor() throws AccessorConstructionException;
30         
31         /**
32          * Set the content of this variant.
33          * 
34          * (Note! this methods sets the _content_ value, in contrast to 
35          * {@link Accessor#setValue(org.simantics.databoard.binding.Binding, Object)} 
36          * which sets the _variant_ value.  
37          * 
38          * @param valueBinding
39          * @param value
40          * @throws AccessorException
41          */
42         void setContentValue(Binding valueBinding, Object value) throws AccessorException;
43         
44         /**
45          * Get the content of this variant
46          *  
47          * @param contentBinding
48          * @return content
49          * @throws AccessorException
50          */
51         Object getContentValue(Binding contentBinding) throws AccessorException;
52         
53         /**
54          * Get the type of the content
55          * 
56          * @return type
57          * @throws AccessorException
58          */
59         Datatype getContentType() throws AccessorException;
60         
61         /**
62          * Get the type of this variant.
63          * 
64          * @return VariantType always
65          */
66         VariantType type();
67         
68 }
69