View Javadoc

1   /*
2    * jGuild Project: jRPM
3    * Released under the Apache License ( http://www.apache.org/LICENSE )
4    */
5   package com.jguild.jrpm.io.datatype;
6   
7   import com.jguild.jrpm.io.constant.RPMIndexType;
8   
9   
10  /***
11   * Global interface for all RPM data types
12   *
13   * @author kuss
14   */
15  public interface DataTypeIf {
16      /***
17       * Returns TRUE if this object contains an array
18       * or FALSE if it is not an array.
19       *
20       * @return TRUE if this object contains an array
21       */
22      public abstract boolean isArray();
23  
24      /***
25       * Get the data as an object.
26       *
27       * @return The object
28       */
29      public abstract Object getDataObject();
30  
31      /***
32       * Returns the number of elements stored in this data type.
33       *
34       * @return The number of elements
35       */
36      public abstract long getElementCount();
37  
38      /***
39       * Returns the size of this type in the RPM file
40       *
41       * @return The size in bytes
42       */
43      public abstract long getSize();
44  
45      /***
46       * Get the type of this data object
47       *
48       * @return The type
49       */
50      public abstract RPMIndexType getType();
51  
52      /***
53       * Gets the i-th element of this object.
54       *
55       * @param i The element number
56       * @return The object
57       * @throws IndexOutOfBoundsException if i doesn't fit into the array
58       */
59      public abstract Object get(int i);
60  }