1 package uk.ac.vamsas.objects.utils;
\r
3 import uk.ac.vamsas.objects.core.Property;
\r
5 public class Properties {
\r
6 public static Property newProperty(String name, String type, String content)
\r
8 Property vProperty = new Property();
\r
9 vProperty.setName(name);
\r
12 vProperty.setType(type);
\r
16 vProperty.setType(STRINGTYPE);
\r
18 vProperty.setContent(content);
\r
21 public static String STRINGTYPE="string";
\r
22 public static String FLOATTYPE="float";
\r
23 public static String INTEGERTYPE="integer";
\r
25 public boolean isString(Property p)
\r
27 return isType(p, STRINGTYPE);
\r
32 * @param p the property to test for type
\r
33 * @param typeString one of the string constants in this class
\r
34 * @return true if p is of type 'typeString'
\r
36 public boolean isType(Property p, String typeString) {
\r
37 return (p==null) ? false : (p.getType().toLowerCase().equals(typeString));
\r