View Javadoc
1   /*
2   Copyright (c) 2013 James Ahlborn
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  
17  package com.healthmarketscience.jackcess.complex;
18  
19  import java.io.IOException;
20  import java.util.Collection;
21  import java.util.List;
22  import java.util.Map;
23  
24  import com.healthmarketscience.jackcess.Row;
25  
26  /**
27   * Base class for the additional information tracked for complex columns.
28   *
29   * @author James Ahlborn
30   */
31  public interface ComplexColumnInfo<V extends ComplexValue>
32  {
33    public ComplexDataType getType();
34  
35    public int countValues(int complexValueFk) throws IOException;
36  
37    public List<Row> getRawValues(int complexValueFk)
38      throws IOException;
39  
40    public List<Row> getRawValues(int complexValueFk,
41                                  Collection<String> columnNames)
42      throws IOException;
43  
44    public List<V> getValues(ComplexValueForeignKey complexValueFk)
45      throws IOException;
46  
47    public ComplexValue.Id addRawValue(Map<String,?> rawValue)
48      throws IOException;
49  
50    public ComplexValue.Id addValue(V value) throws IOException;
51  
52    public void addValues(Collection<? extends V> values) throws IOException;
53  
54    public ComplexValue.Id updateRawValue(Row rawValue) throws IOException;
55  
56    public ComplexValue.Id updateValue(V value) throws IOException;
57  
58    public void updateValues(Collection<? extends V> values) throws IOException;
59  
60    public void deleteRawValue(Row rawValue) throws IOException;
61  
62    public void deleteValue(V value) throws IOException;
63  
64    public void deleteValues(Collection<? extends V> values) throws IOException;
65  
66    public void deleteAllValues(int complexValueFk) throws IOException;
67  
68    public void deleteAllValues(ComplexValueForeignKey complexValueFk)
69      throws IOException;
70  
71  }