Example #1
0
 private static boolean dbrTypeMatch(DBRType aType, DBRType anotherType) {
   if (aType.getClass() == null && anotherType.getClass() != null) {
     return false;
   }
   if (aType.getClass() != null && anotherType.getClass() == null) {
     return false;
   }
   return aType.isBYTE() && anotherType.isBYTE()
       || aType.isDOUBLE() && anotherType.isDOUBLE()
       || aType.isENUM() && anotherType.isENUM()
       || aType.isFLOAT() && anotherType.isFLOAT()
       || aType.isINT() && anotherType.isINT()
       || aType.isSHORT() && anotherType.isSHORT()
       || aType.isSTRING() && anotherType.isSTRING();
 }
Example #2
0
 /** @return TIME_... type for this channel. */
 public static DBRType getTimeType(final boolean plain, final DBRType type) {
   if (type.isDOUBLE()) return plain ? DBRType.DOUBLE : DBRType.TIME_DOUBLE;
   else if (type.isFLOAT()) return plain ? DBRType.FLOAT : DBRType.TIME_FLOAT;
   else if (type.isINT()) return plain ? DBRType.INT : DBRType.TIME_INT;
   else if (type.isSHORT()) return plain ? DBRType.SHORT : DBRType.TIME_SHORT;
   else if (type.isENUM()) return plain ? DBRType.SHORT : DBRType.TIME_ENUM;
   else if (type.isBYTE()) return plain ? DBRType.BYTE : DBRType.TIME_BYTE;
   // default: get as string
   return plain ? DBRType.STRING : DBRType.TIME_STRING;
 }