AutoDetectDataType switchType(Object obj){
  int typeId=getTypeId(obj);
  AutoDetectDataType l=last;
  if (typeId != l.typeId) {
    last=l=newType(typeId);
  }
  return l;
}

AutoDetectDataType switchType ( Object obj ) { int typeId = getTypeId ( obj ) ; AutoDetectDataType l = last ; if ( typeId != l . typeId ) { last = l = newType ( typeId ) ; } return l ; }
switch the last remembered type to match the type of the given object .
