当前位置: 首页>>代码示例>>Java>>正文


Java NSNumber类代码示例

本文整理汇总了Java中com.dd.plist.NSNumber的典型用法代码示例。如果您正苦于以下问题:Java NSNumber类的具体用法?Java NSNumber怎么用?Java NSNumber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NSNumber类属于com.dd.plist包,在下文中一共展示了NSNumber类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listConfigurationProfiles

import com.dd.plist.NSNumber; //导入依赖的package包/类
@Override
public ImmutableList<ConfigurationProfile> listConfigurationProfiles() throws IosDeviceException {
  String plistXml = await(cfgutil.get("configurationProfiles"));
  NSDictionary plist = (NSDictionary) PlistParser.fromXml(plistXml);
  String ecid = ((NSArray) plist.get("Devices")).objectAtIndex(0).toString();
  NSDictionary output = (NSDictionary) ((NSDictionary) plist.get("Output")).get(ecid);
  NSArray profileArray = (NSArray) output.get("configurationProfiles");

  ImmutableList.Builder<ConfigurationProfile> profiles = ImmutableList.builder();
  for (int i = 0; i < profileArray.count(); i++) {
    NSDictionary profileDict = (NSDictionary) profileArray.objectAtIndex(i);
    profiles.add(
        ConfigurationProfile.builder()
            .displayName(((NSString) profileDict.get("displayName")).getContent())
            .identifier(((NSString) profileDict.get("identifier")).getContent())
            .version(((NSNumber) profileDict.get("version")).intValue())
            .build());
  }
  return profiles.build();
}
 
开发者ID:google,项目名称:ios-device-control,代码行数:21,代码来源:RealDeviceImpl.java

示例2: getInt

import com.dd.plist.NSNumber; //导入依赖的package包/类
public static Integer getInt(NSObject object) {
    NSNumber temp = getNumber(object);
    if (temp != null) {
        if (temp.isInteger())
            return temp.intValue();
    }
    return null;
}
 
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:9,代码来源:PlistHelper.java

示例3: getBoolean

import com.dd.plist.NSNumber; //导入依赖的package包/类
public static boolean getBoolean(NSObject object) {
    NSNumber temp = getNumber(object);
    if (temp != null) {
        if (temp.isBoolean())
            return temp.boolValue();
    }
    return false;
}
 
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:9,代码来源:PlistHelper.java

示例4: getLong

import com.dd.plist.NSNumber; //导入依赖的package包/类
public static Long getLong(NSObject object) {
    NSNumber temp = getNumber(object);
    if (temp != null) {
        if (temp.isReal())
            return temp.longValue();
    }
    return null;
}
 
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:9,代码来源:PlistHelper.java

示例5: getFloat

import com.dd.plist.NSNumber; //导入依赖的package包/类
public static Float getFloat(NSObject object) {
    NSNumber temp = getNumber(object);
    if (temp != null) {
        if (temp.isReal())
            return temp.floatValue();
        else
            return (float)temp.intValue();
    }
    return null;
}
 
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:11,代码来源:PlistHelper.java

示例6: validateSrpInitResponse

import com.dd.plist.NSNumber; //导入依赖的package包/类
static void validateSrpInitResponse(NSDictionary srpInitResponseBlob) {
    Integer version = PListsLegacy.optionalAs(srpInitResponseBlob, "version", NSNumber.class)
            .map(NSNumber::intValue)
            .orElse(null);
    if (!version.equals(1)) {
        throw new UnsupportedOperationException("unknown SRP_INIT version: " + version);
    }
}
 
开发者ID:horrorho,项目名称:InflatableDonkey,代码行数:9,代码来源:EscrowOperationsRecover.java

示例7: getAlpha

import com.dd.plist.NSNumber; //导入依赖的package包/类
private static float getAlpha(NSDictionary dictionary) {
	if (dictionary.containsKey("alpha")) {
		return ((NSNumber) dictionary.get("alpha")).floatValue();
	}
	if (dictionary.containsKey("opacity")) {
		return ((NSNumber) dictionary.get("opacity")).floatValue();			
	}
	return 1.0f;
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:10,代码来源:ColorParser.java

示例8: getValue

import com.dd.plist.NSNumber; //导入依赖的package包/类
private static float getValue(NSDictionary dictionary) {
	if (dictionary.containsKey("value")) {
		return ((NSNumber) dictionary.get("value")).floatValue();
	}
	if (dictionary.containsKey("brightness")) {
		return ((NSNumber) dictionary.get("brightness")).floatValue();			
	}
	return 1.0f;
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:10,代码来源:ColorParser.java

示例9: getColorFromOXPArray

import com.dd.plist.NSNumber; //导入依赖的package包/类
private static long getColorFromOXPArray(NSArray colorArray) {
	NSObject[] array = colorArray.getArray();
	float r = array.length > 0 ? ((NSNumber) array[0]).floatValue() : 0;
	float g = array.length > 1 ? ((NSNumber) array[1]).floatValue() : 0;
	float b = array.length > 2 ? ((NSNumber) array[2]).floatValue() : 0;
	float a = array.length > 3 ? ((NSNumber) array[3]).floatValue() : 1;
	
	if (r <= 1.0f && g <= 1.0f && b <= 1.0f && a <= 1.0f) {
		return AliteColors.convertRgba(r, g, b, a);
	} 
	a = array.length > 3 ? ((NSNumber) array[3]).floatValue() : 255.0f;
	return AliteColors.convertRgba(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:14,代码来源:ColorParser.java

示例10: ApplicationSettings

import com.dd.plist.NSNumber; //导入依赖的package包/类
public ApplicationSettings(String path)
{
    this.path = path;

    try {
        data = (NSDictionary)PropertyListParser.parse(path);

        interfaceOpacity = ((NSNumber)data.objectForKey(INTERFACE_OPACITY)).floatValue();
        isLeftHanded     = ((NSNumber)data.objectForKey(IS_LEFT_HANDED)).boolValue();
        isAccMode        = ((NSNumber)data.objectForKey(IS_ACC_MODE)).boolValue();
        isFirstRun       = ((NSNumber)data.objectForKey(IS_FIRST_RUN)).boolValue();
        isHeadFreeMode   = ((NSNumber)data.objectForKey(IS_HEAD_FREE_MODE)).boolValue();
        yawEnable        =  ((NSNumber)data.objectForKey(YAW_ENABLE)).boolValue();
        isAltHoldMode    = ((NSNumber)data.objectForKey(IS_ALT_HOLD_MODE)).boolValue();
        isBeginnerMode   = ((NSNumber)data.objectForKey(IS_BEGINNER_MODE)).boolValue();
        aileronDeadBand  = ((NSNumber)data.objectForKey(AILERON_DEAD_BAND)).floatValue();
        elevatorDeadBand = ((NSNumber)data.objectForKey(ELEVATOR_DEAD_BAND)).floatValue();
        rudderDeadBand   = ((NSNumber)data.objectForKey(RUDDER_DEAD_BAND)).floatValue();
        takeOffThrottle  = ((NSNumber)data.objectForKey(TAKE_OFF_THROTTLE)).floatValue();

        NSArray rawChannels = (NSArray)data.objectForKey(ApplicationSettings.CHANNELS);
        int channelCount = rawChannels.count();

        channels = new ArrayList<Channel>(channelCount);

        for(int channelIdx = 0; channelIdx < channelCount; channelIdx++){
            Channel oneChannel = new Channel(this, channelIdx);
            channels.add(oneChannel);
        }
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
 
开发者ID:oroca,项目名称:SkyRover_Android,代码行数:35,代码来源:ApplicationSettings.java

示例11: Channel

import com.dd.plist.NSNumber; //导入依赖的package包/类
public Channel(ApplicationSettings settings, int idx){
    ownerSettings = settings;
    this.idx = idx;
    NSArray channels = (NSArray)settings.getData().objectForKey(ApplicationSettings.CHANNELS);
    data = (NSDictionary)channels.objectAtIndex(idx);

    name       = ((NSString)data.objectForKey(NAME)).getContent();
    isReversed = ((NSNumber)data.objectForKey(IS_REVERSED)).boolValue();
    trimValue  = ((NSNumber)data.objectForKey(TRIM_VALUE)).floatValue();
    outputAdjustabledRange = ((NSNumber)data.objectForKey(OUTPUT_ADJUSTABLE_RANGE)).floatValue();
    defaultOutputValue =  ((NSNumber)data.objectForKey(DEFAULT_OUTPUT_VALUE)).floatValue();
}
 
开发者ID:oroca,项目名称:SkyRover_Android,代码行数:13,代码来源:Channel.java

示例12: getInfoPlistOverrideKeys

import com.dd.plist.NSNumber; //导入依赖的package包/类
private ImmutableMap<String, NSObject> getInfoPlistOverrideKeys() {
  ImmutableMap.Builder<String, NSObject> keys = ImmutableMap.builder();

  if (platform.getType() == ApplePlatformType.MAC) {
    if (needsLSRequiresIPhoneOSInfoPlistKeyOnMac()) {
      keys.put("LSRequiresIPhoneOS", new NSNumber(false));
    }
  } else if (!platform.getType().isWatch() && !isLegacyWatchApp()) {
    keys.put("LSRequiresIPhoneOS", new NSNumber(true));
  }

  return keys.build();
}
 
开发者ID:facebook,项目名称:buck,代码行数:14,代码来源:AppleBundle.java

示例13: workspaceDisablesSchemeAutoCreation

import com.dd.plist.NSNumber; //导入依赖的package包/类
@Test
public void workspaceDisablesSchemeAutoCreation() throws Exception {
  Path workspacePath = generator.writeWorkspace();
  Optional<String> settings =
      projectFilesystem.readFileIfItExists(
          workspacePath.resolve("xcshareddata/WorkspaceSettings.xcsettings"));
  assertThat(settings.isPresent(), equalTo(true));
  NSObject object = PropertyListParser.parse(settings.get().getBytes(Charsets.UTF_8));
  assertThat(object, instanceOf(NSDictionary.class));
  NSObject autocreate =
      ((NSDictionary) object).get("IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded");
  assertThat(autocreate, instanceOf(NSNumber.class));
  assertThat((NSNumber) autocreate, equalTo(new NSNumber(false)));
}
 
开发者ID:facebook,项目名称:buck,代码行数:15,代码来源:WorkspaceGeneratorTest.java

示例14: testCopyFilesBuildPhaseWithNameAndDepoymentPostprocessing

import com.dd.plist.NSNumber; //导入依赖的package包/类
@Test
public void testCopyFilesBuildPhaseWithNameAndDepoymentPostprocessing() {
  final String copyPhaseName = "Test Phase Name";
  PBXCopyFilesBuildPhase copyPhase = makeCopyFilesPhase();
  copyPhase.setRunOnlyForDeploymentPostprocessing(Optional.of(Boolean.TRUE));
  copyPhase.setName(Optional.of(copyPhaseName));
  target.getBuildPhases().add(copyPhase);

  NSDictionary projPlist = serializer.toPlist();
  NSDictionary copyPhaseDict = getObjectForGID(copyPhase.getGlobalID(), projPlist);

  assertTrue(copyPhaseDict.get("name").equals(new NSString(copyPhaseName)));
  assertTrue(copyPhaseDict.get("runOnlyForDeploymentPostprocessing").equals(new NSNumber(1)));
}
 
开发者ID:facebook,项目名称:buck,代码行数:15,代码来源:PBXBuildPhasesTest.java

示例15: setUIStatusBarHidden

import com.dd.plist.NSNumber; //导入依赖的package包/类
public void setUIStatusBarHidden(boolean status) {
	NSNumber nsstatus = new NSNumber(status);
	this.rootDict.put(UIStatusBarHidden, nsstatus);
}
 
开发者ID:apicloudcom,项目名称:WebStorm-APICloud-Plugins,代码行数:5,代码来源:IPAModifyPlist.java


注:本文中的com.dd.plist.NSNumber类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。