001: /*
002: * Created on 09.11.2005 for PIROL
003: *
004: * SVN header information:
005: * $Author: javamap $
006: * $Rev: 856 $
007: * $Date: 2007-06-18 21:15:27 -0700 (Mon, 18 Jun 2007) $
008: * $Id: PirolFeatureCollectionRole.java 856 2007-06-19 04:15:27Z javamap $
009: */
010: package de.fho.jump.pirol.utilities.FeatureCollection;
011:
012: /**
013: * Base class for different roles of a PirolFeatureCollection, like RasterImage, Grid, Outline, etc.
014: *
015: * @author Ole Rahn
016: * <br>
017: * <br>FH Osnabrück - University of Applied Sciences Osnabrück,
018: * <br>Project: PIROL (2005),
019: * <br>Subproject: Daten- und Wissensmanagement
020: *
021: * @version $Rev: 856 $
022: * @see de.fhOsnabrueck.jump.pirol.utilities.FeatureCollection.PirolFeatureCollection
023: *
024: */
025: public abstract class PirolFeatureCollectionRole {
026:
027: protected PirolFeatureCollectionRoleTypes type = null;
028:
029: /** Number of existent roles roles */
030: public static final int numOfExistentRoles = PirolFeatureCollectionRoleTypes
031: .getNumOfTypes();
032:
033: public PirolFeatureCollectionRole(
034: PirolFeatureCollectionRoleTypes type) {
035: this .type = type;
036: }
037:
038: /**
039: *
040: *@return an integer that specifies the role type of the derived role object
041: *
042: *@see PirolFeatureCollectionRoleTypes
043: */
044: public int getRoleId() {
045: return this .type.getType();
046: }
047:
048: public PirolFeatureCollectionRoleTypes getType() {
049: return this .type;
050: }
051:
052: /**
053: *
054: *@return true if it contains gridded data (e.g. grid layer), else false
055: */
056: public boolean containsGrid() {
057: return false;
058: }
059:
060: /**
061: *
062: *@return true if it contains raster data (e.g. raster image layer), else false
063: */
064: public boolean containsImage() {
065: return false;
066: }
067:
068: /**
069: * Check if this role is the same type of role as the given one.
070: * Caution: If this role contains specific information (like RasterImage role), this information
071: * is not checked for equality - Only the type of the role is checked!
072: *@param role role to check for type equality
073: *@return true if this role is the same type of role as the given one, else false
074: */
075: public boolean equalsRole(PirolFeatureCollectionRole role) {
076: return this .getRoleId() == role.getRoleId();
077: }
078:
079: /**
080: * Check if this role is the same type of role as the given one.
081: * Caution: If this role contains specific information (like RasterImage role), this information
082: * is not checked for equality - Only the type of the role is checked!
083: *@param role role to check for type equality
084: *@return true if this role is the same type of role as the given one, else false
085: */
086: public boolean equalsRole(PirolFeatureCollectionRoleTypes roleType) {
087: return this .getRoleId() == roleType.getType();
088: }
089:
090: /**
091: * Check if this role is the same type of role as the given role id.
092: *@param roleID id of the role type to check for type equality
093: *@return true if this role is the same type of role as the given ID, else false
094: *
095: *@see PirolFeatureCollectionRoleTypes
096: */
097: public boolean equalsRole(int roleID) {
098: return this .getRoleId() == roleID;
099: }
100:
101: /**
102: * Method to be called e.g. by a FeatureCollection, when it's disposed
103: * to free RAM that may be bound in references to objects, that are still
104: * referenced by other objects, but won't be used without the FeatureCollection.
105: *
106: */
107: public void clearRam() {
108: return;
109: }
110:
111: }
|