示例#1
0
 public void putProp(int propType, Object prop) {
   if (prop == null) {
     removeProp(propType);
   } else {
     PropListItem item = ensureProperty(propType);
     item.objectValue = prop;
   }
 }
示例#2
0
 private PropListItem ensureProperty(int propType) {
   PropListItem item = lookupProperty(propType);
   if (item == null) {
     item = new PropListItem();
     item.type = propType;
     item.next = propListHead;
     propListHead = item;
   }
   return item;
 }
示例#3
0
 public void removeProp(int propType) {
   PropListItem x = propListHead;
   if (x != null) {
     PropListItem prev = null;
     while (x.type != propType) {
       prev = x;
       x = x.next;
       if (x == null) {
         return;
       }
     }
     if (prev == null) {
       propListHead = x.next;
     } else {
       prev.next = x.next;
     }
   }
 }
示例#4
0
 public void putIntProp(int propType, int prop) {
   PropListItem item = ensureProperty(propType);
   item.intValue = prop;
 }