Пример #1
0
    @Override
    public View getView(int position, View convertView, ViewGroup arg2) {
      // TODO Auto-generated method stub

      ViewHolder holder = null;
      if (convertView == null) {
        holder = new ViewHolder();
        convertView = inflater.inflate(R.layout.simple_list_item_msginfo, null);
        // 注意这里是convertview
        holder.itemName = (TextView) convertView.findViewById(R.id.item_msginfo_name);
        holder.itemDate = (TextView) convertView.findViewById(R.id.item_msginfo_date);
        holder.itemTime = (TextView) convertView.findViewById(R.id.item_msginfo_time);
        holder.itemLocation = (TextView) convertView.findViewById(R.id.item_msginfo_location);
        holder.itemSponsor = (TextView) convertView.findViewById(R.id.item_msginfo_sponsor);
        convertView.setTag(holder);
        Log.d("MsgInfoActivity", "convertView == null");
      } else {
        holder = (ViewHolder) convertView.getTag();
      }

      holder.itemName.setText((String) Data.get(position).get("ACTIVITY_NAME"));
      holder.itemDate.setText((String) Data.get(position).get("ACTIVITY_DATE"));
      holder.itemTime.setText((String) Data.get(position).get("ACTIVITY_TIME"));
      holder.itemLocation.setText((String) Data.get(position).get("ACTIVITY_LOCATION"));
      holder.itemSponsor.setText((String) Data.get(position).get("ACTIVITY_SPONSOR"));
      return convertView;
    }
Пример #2
0
 public synchronized Object rdp(Object key) {
   Object obj = null;
   Data data = (Data) map.get(key);
   if (data != null) {
     return data.get(key);
   }
   return obj;
 }
Пример #3
0
 public Data convertStringValue(String value) {
   for (Data d : models) {
     Object val = d.get(displayProperty);
     if (value.equals(val != null ? val.toString() : null)) {
       return d;
     }
   }
   return null;
 }
Пример #4
0
  /** Loads the data from multiple paths specified by pathes */
  public static Data loadData(Dataset dataset, FileSystem fs, Path[] pathes) throws IOException {
    List<Instance> instances = new ArrayList<>();

    for (Path path : pathes) {
      Data loadedData = loadData(dataset, fs, path);
      for (int index = 0; index <= loadedData.size(); index++) {
        instances.add(loadedData.get(index));
      }
    }
    return new Data(dataset, instances);
  }
Пример #5
0
 // NOTE: We take in a Resource instead of ResourceIdentifier here due to a deserialization
 // conflict
 public Relationship(
     @JsonProperty("links") Map<String, String> links, @JsonProperty("data") Data<Resource> data) {
   this.links = links;
   this.data = data;
   if (data != null) {
     if (data.isToOne()) {
       Resource resource = data.get().iterator().next();
       this.idData =
           new Data<ResourceIdentifier>(resource != null ? resource.toResourceIdentifier() : null);
     } else {
       Collection<ResourceIdentifier> resourceIdentifiers = new ArrayList<ResourceIdentifier>();
       for (Resource resource : data.get()) {
         resourceIdentifiers.add(resource.toResourceIdentifier());
       }
       this.idData = new Data<ResourceIdentifier>(resourceIdentifiers);
     }
   } else {
     this.idData = null;
   }
 }
Пример #6
0
 @Test(expected = IndexOutOfBoundsException.class)
 public void invalidGetIndexThrowsIndexOutOfBounds() {
   mFilterData.get(5);
 }
Пример #7
0
 public synchronized Object rdp(Object key) {
   Data data = (Data) map.get(key);
   if (data == null) map.put(key, (data = new Data(key)));
   return data.get(key);
 }