1 24 package org.objectweb.jalisto.se.impl.meta; 25 26 import org.objectweb.jalisto.se.api.ClassDescription; 27 import org.objectweb.jalisto.se.api.query.FieldDescription; 28 import org.objectweb.jalisto.se.api.MetaType; 29 30 public class FieldDescriptionImpl implements FieldDescription { 31 32 public FieldDescriptionImpl(String fieldName, MetaType type) { 33 this.fieldName = fieldName; 34 this.type = type; 35 this.index = -1; 36 this.indexDescription = new IndexDescription(this); 37 } 38 39 public short getIndex() { 40 return index; 41 } 42 43 public void setIndex(short index) { 44 this.index = index; 45 } 46 47 public String getFieldName() { 48 return fieldName; 49 } 50 51 public void setFieldName(String fieldName) { 52 this.fieldName = fieldName; 53 } 54 55 public MetaType getType() { 56 return type; 57 } 58 59 public void setType(MetaType type) { 60 this.type = type; 61 } 62 63 public boolean isIndexDefined() { 64 return indexDescription.isIndexDefined(); 65 } 66 67 public IndexDescription getIndexDescription() { 68 return indexDescription; 69 } 70 71 public ClassDescription getClassMeta() { 72 return classMeta; 73 } 74 75 public void setClassMeta(ClassDescription classMeta) { 76 this.classMeta = (ClassDescriptionImpl) classMeta; 77 } 78 79 public boolean equals(Object o) { 80 try { 81 FieldDescriptionImpl candidate = (FieldDescriptionImpl) o; 82 return (candidate.fieldName.equals(this.fieldName) && 83 (candidate.index == this.index) && 84 (candidate.type.equals(this.type))); 86 } catch (Exception e) { 87 } 88 return false; 89 } 90 91 public String toString() { 92 return fieldName + " : " + type.toString(); 93 } 94 95 private ClassDescriptionImpl classMeta; 96 private String fieldName; 97 private short index; 98 private MetaType type; 99 private IndexDescription indexDescription; 100 101 102 static final long serialVersionUID = -7589377097964763559L; 103 } 104 | Popular Tags |