Example #1
0
 /**
  * Get the type for a given name.
  *
  * @param name the name.
  * @return the data type.
  */
 public static SpatialDataType getType4Name(String name) {
   for (SpatialDataType type : values()) {
     if (type.getTypeName().equals(name)) {
       return type;
     }
   }
   throw new IllegalArgumentException("No such type known: " + name);
 }
Example #2
0
 /**
  * Get the type for a given code.
  *
  * @param code the code.
  * @return the data type.
  */
 public static SpatialDataType getType4Code(int code) {
   for (SpatialDataType type : values()) {
     if (type.getCode() == code) {
       return type;
     }
   }
   throw new IllegalArgumentException("No such type known: " + code);
 }