URIStructure.java :  » App » android-cartridge » com » googlecode » andromdaid » cp » Android Open Source

Android Open Source » App » android cartridge 
android cartridge » com » googlecode » andromdaid » cp » URIStructure.java
package com.googlecode.andromdaid.cp;

import android.text.TextUtils;

public class URIStructure {
  public static class IdentifierInfo {
    public final String columnName;
    public final int uriSegment;
    public final String tableName;

    /**
     * Constructor for external identifiers.
     * @param columnName
     * @param uriSegment
     * @param tableName
     */
    public IdentifierInfo(String columnName, int uriSegment,
        String tableName) {
      this.columnName = columnName;
      this.uriSegment = uriSegment;
      this.tableName = tableName;
    }

    /**
     * Constructor for identifier in the base table.
     * 
     * @param columnName
     * @param uriSegment
     */
    public IdentifierInfo(String columnName, int uriSegment) {
      this(columnName, uriSegment, null);
    }
  }

  public final String tableName;
  public final IdentifierInfo[] identifiers;
  public URIStructure(String tableName, IdentifierInfo[] identifiers) {
    this.tableName = tableName;
    this.identifiers = identifiers;
  }
  
  public boolean hasExternalIdentifiers(){
    boolean result = false;
    for (IdentifierInfo identifierInfo : this.identifiers) {
      result |= !TextUtils.isEmpty(identifierInfo.tableName);
    }
    return result;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.