Java Code Examples for java.lang.Integer

The following are top voted examples for showing how to use java.lang.Integer. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: openjdk-jdk10   File: TestCipherKeyWrapperTest.java   Source Code and License 7 votes vote down vote up
private void wrapperPBEKeyTest(Provider p) throws InvalidKeySpecException,
        InvalidKeyException, NoSuchPaddingException,
        IllegalBlockSizeException, InvalidAlgorithmParameterException,
        NoSuchAlgorithmException {
    for (String alg : PBE_ALGORITHM_AR) {
        String baseAlgo = alg.split("/")[0].toUpperCase();
        // only run the tests on longer key lengths if unlimited version
        // of JCE jurisdiction policy files are installed

        if (Cipher.getMaxAllowedKeyLength(alg) < Integer.MAX_VALUE
                && (baseAlgo.endsWith("TRIPLEDES") || alg
                        .endsWith("AES_256"))) {
            out.println("keyStrength > 128 within " + alg
                    + " will not run under global policy");
            continue;
        }
        SecretKeyFactory skf = SecretKeyFactory.getInstance(baseAlgo, p);
        SecretKey key = skf.generateSecret(new PBEKeySpec("Secret Lover"
                .toCharArray()));
        wrapTest(alg, alg, key, key, Cipher.SECRET_KEY, true);
    }
}
 
Example 2
Project: jdk8u-jdk   File: TestCipherKeyWrapperTest.java   Source Code and License 7 votes vote down vote up
private void wrapperPBEKeyTest(Provider p) throws InvalidKeySpecException,
        InvalidKeyException, NoSuchPaddingException,
        IllegalBlockSizeException, InvalidAlgorithmParameterException,
        NoSuchAlgorithmException {
    for (String alg : PBE_ALGORITHM_AR) {
        String baseAlgo = alg.split("/")[0].toUpperCase();
        // only run the tests on longer key lengths if unlimited version
        // of JCE jurisdiction policy files are installed

        if (Cipher.getMaxAllowedKeyLength(alg) < Integer.MAX_VALUE
                && (baseAlgo.endsWith("TRIPLEDES") || alg
                        .endsWith("AES_256"))) {
            out.println("keyStrength > 128 within " + alg
                    + " will not run under global policy");
            continue;
        }
        SecretKeyFactory skf = SecretKeyFactory.getInstance(baseAlgo, p);
        SecretKey key = skf.generateSecret(new PBEKeySpec("Secret Lover"
                .toCharArray()));
        wrapTest(alg, alg, key, key, Cipher.SECRET_KEY, true);
    }
}
 
Example 3
Project: OpenDA   File: WflowPythonToJavaAdapter.java   Source Code and License 6 votes vote down vote up
/**
 * See wflow_adapt.py:
 *  # Try and read config file and set default options
 *  config = ConfigParser.SafeConfigParser()
 *  config.optionxform = str
 *  config.read(case + "/" + iniFile)
 *
 *  # Get outpumapstacks from wflow ini
 *  mstacks  = config.options('outputmaps')
 *  for a in mstacks:
 *     var = config.get("outputmaps",a)
 *
 * @return String[] outmap names.
 */
public String[] getOutputMapNamesFromConfig(File configFile) {
	try {
		this.jep.eval("tempConfig = ConfigParser.SafeConfigParser()");
		this.jep.eval("tempConfig.optionxform = str");
		String configFilePath = BBUtils.getFilePathStringForPython(configFile);
		this.jep.set("configFilePath", configFilePath);
		this.jep.eval("tempConfig.read(configFilePath)");
		this.jep.eval("tempOutputMaps = tempConfig.options('outputmaps')");
		int numberOfOutputMaps = (Integer) this.jep.getValue("len(tempOutputMaps)");
		String[] outputMapNames = new String[numberOfOutputMaps];
		for (int i = 0; i < outputMapNames.length; i++) {
			this.jep.set("tempIndex", i);
			outputMapNames[i] = (String) this.jep.getValue("tempConfig.get('outputmaps', tempOutputMaps[tempIndex])");
		}
		return outputMapNames;
	} catch (JepException e) {
		throw new RuntimeException(getClass().getSimpleName() + ": exception during call to python code. Message was: " + e.getMessage(), e);
	}
}
 
Example 4
Project: OpenDA   File: WflowPythonToJavaAdapter.java   Source Code and License 6 votes vote down vote up
public static synchronized void readPcRasterMapValues(Jep jep, String variableName, double[] dest) throws JepException {
    String bufferName = "readPcRasterMapValues" + dest.length;
    Map<Integer, DoubleBuffer> map = readPcRasterMapValuesBuffers.get(jep);
    if (map == null) {
        map = new HashMap<Integer, DoubleBuffer>();
        readPcRasterMapValuesBuffers.put(jep, map);
    }
    DoubleBuffer buffer = map.get(dest.length);
    if (buffer == null) {
        buffer = buffers.get(dest.length);
        if (buffer == null) {
            buffer = createNativeDoubleBuffer(dest.length);
            buffers.put(dest.length, buffer);
        }
        declareDoubleArray(jep, bufferName, buffer);
        map.put(dest.length, buffer);
    }
    jep.eval(bufferName + "[:]=reshape(pcr2numpy(" + variableName + ", 1E31), " + dest.length + ')');
    buffer.rewind();
    buffer.get(dest);
}
 
Example 5
Project: nightclazz-graphql   File: AntennaFields.java   Source Code and License 6 votes vote down vote up
public AntennaFields(@Nonnull String __typename, @Nullable Coordinates coordinates,
    @Nullable String generation, @Nullable String provider, @Nullable String lastUpdate,
    @Nullable String status, @Nullable Integer dist, @Nullable String insee,
    @Nullable String city, @Nullable String addressLabel) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
}
 
Example 6
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromOrange(@Nonnull String __typename, @Nullable Coordinates coordinates,
    @Nullable String generation, @Nullable String provider, @Nullable String lastUpdate,
    @Nullable String status, @Nullable Integer dist, @Nullable String insee,
    @Nullable String city, @Nullable String addressLabel, @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 7
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromBouygues(@Nonnull String __typename,
    @Nullable Coordinates1 coordinates, @Nullable String generation, @Nullable String provider,
    @Nullable String lastUpdate, @Nullable String status, @Nullable Integer dist,
    @Nullable String insee, @Nullable String city, @Nullable String addressLabel,
    @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 8
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromSfr(@Nonnull String __typename, @Nullable Coordinates2 coordinates,
    @Nullable String generation, @Nullable String provider, @Nullable String lastUpdate,
    @Nullable String status, @Nullable Integer dist, @Nullable String insee,
    @Nullable String city, @Nullable String addressLabel, @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 9
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromFree(@Nonnull String __typename, @Nullable Coordinates3 coordinates,
    @Nullable String generation, @Nullable String provider, @Nullable String lastUpdate,
    @Nullable String status, @Nullable Integer dist, @Nullable String insee,
    @Nullable String city, @Nullable String addressLabel, @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 10
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromOrange1(@Nonnull String __typename, @Nullable Coordinates4 coordinates,
    @Nullable String generation, @Nullable String provider, @Nullable String lastUpdate,
    @Nullable String status, @Nullable Integer dist, @Nullable String insee,
    @Nullable String city, @Nullable String addressLabel, @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 11
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromBouygues1(@Nonnull String __typename,
    @Nullable Coordinates5 coordinates, @Nullable String generation, @Nullable String provider,
    @Nullable String lastUpdate, @Nullable String status, @Nullable Integer dist,
    @Nullable String insee, @Nullable String city, @Nullable String addressLabel,
    @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 12
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromFree1(@Nonnull String __typename, @Nullable Coordinates7 coordinates,
    @Nullable String generation, @Nullable String provider, @Nullable String lastUpdate,
    @Nullable String status, @Nullable Integer dist, @Nullable String insee,
    @Nullable String city, @Nullable String addressLabel, @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 13
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromOrange2(@Nonnull String __typename, @Nullable Coordinates8 coordinates,
    @Nullable String generation, @Nullable String provider, @Nullable String lastUpdate,
    @Nullable String status, @Nullable Integer dist, @Nullable String insee,
    @Nullable String city, @Nullable String addressLabel, @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 14
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromBouygues2(@Nonnull String __typename,
    @Nullable Coordinates9 coordinates, @Nullable String generation, @Nullable String provider,
    @Nullable String lastUpdate, @Nullable String status, @Nullable Integer dist,
    @Nullable String insee, @Nullable String city, @Nullable String addressLabel,
    @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 15
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromSfr2(@Nonnull String __typename, @Nullable Coordinates10 coordinates,
    @Nullable String generation, @Nullable String provider, @Nullable String lastUpdate,
    @Nullable String status, @Nullable Integer dist, @Nullable String insee,
    @Nullable String city, @Nullable String addressLabel, @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 16
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromFree2(@Nonnull String __typename, @Nullable Coordinates11 coordinates,
    @Nullable String generation, @Nullable String provider, @Nullable String lastUpdate,
    @Nullable String status, @Nullable Integer dist, @Nullable String insee,
    @Nullable String city, @Nullable String addressLabel, @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 17
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromOrange3(@Nonnull String __typename,
    @Nullable Coordinates12 coordinates, @Nullable String generation, @Nullable String provider,
    @Nullable String lastUpdate, @Nullable String status, @Nullable Integer dist,
    @Nullable String insee, @Nullable String city, @Nullable String addressLabel,
    @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 18
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromBouygues3(@Nonnull String __typename,
    @Nullable Coordinates13 coordinates, @Nullable String generation, @Nullable String provider,
    @Nullable String lastUpdate, @Nullable String status, @Nullable Integer dist,
    @Nullable String insee, @Nullable String city, @Nullable String addressLabel,
    @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 19
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromSfr3(@Nonnull String __typename, @Nullable Coordinates14 coordinates,
    @Nullable String generation, @Nullable String provider, @Nullable String lastUpdate,
    @Nullable String status, @Nullable Integer dist, @Nullable String insee,
    @Nullable String city, @Nullable String addressLabel, @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 20
Project: nightclazz-graphql   File: SearchQuery.java   Source Code and License 6 votes vote down vote up
public NearestAntennaFromFree3(@Nonnull String __typename, @Nullable Coordinates15 coordinates,
    @Nullable String generation, @Nullable String provider, @Nullable String lastUpdate,
    @Nullable String status, @Nullable Integer dist, @Nullable String insee,
    @Nullable String city, @Nullable String addressLabel, @Nonnull Fragments fragments) {
  if (__typename == null) {
    throw new NullPointerException("__typename can't be null");
  }
  this.__typename = __typename;
  this.coordinates = coordinates;
  this.generation = generation;
  this.provider = provider;
  this.lastUpdate = lastUpdate;
  this.status = status;
  this.dist = dist;
  this.insee = insee;
  this.city = city;
  this.addressLabel = addressLabel;
  if (fragments == null) {
    throw new NullPointerException("fragments can't be null");
  }
  this.fragments = fragments;
}
 
Example 21
Project: GOLAD   File: TimeLimit.java   Source Code and License 6 votes vote down vote up
public void clickAction(){
    JTextField hours = new JTextField();
    JTextField minutes = new JTextField();
    JTextField seconds = new JTextField();
    Object[] message = {
        "Hours", hours,
        "Minutes", minutes,
        "Seconds",seconds
    };
    int option = JOptionPane.showConfirmDialog(null, message, "Time Limit", JOptionPane.OK_CANCEL_OPTION);
    if (option == JOptionPane.OK_OPTION) {
        try{
            w.setTimeLimit(Integer.parseInt(hours.getText()),
            Integer.parseInt(minutes.getText()),
            Integer.parseInt(seconds.getText()),0);
        }catch(Exception e){
            w.setTimeLimit(Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE);
        }
    }
}
 
Example 22
Project: GOLAD   File: MyWorld.java   Source Code and License 6 votes vote down vote up
public String getCaryString(){
    int humanNum = 0;
    int timeLimitNum=99999;
    int timeBonusNum=99999;
    if(redBot){
        humanNum+=(2*redDepth+4);//(redDepth/2+1)*4
    }
    if(blueBot){
        humanNum+=(blueDepth/2+1);
    }
    if(timeLimit[1]!=Integer.MAX_VALUE){
        timeLimitNum = timeLimit[1];
        timeBonusNum = timeBonus;
    }
    if(screen==2){
        boardStart = getBoard();
        moveSequence = "";
    }
    String result = rules+","+Math.max(WIDTH,HEIGHT)+","+timeLimitNum+","+timeBonusNum+","+humanNum+","+boardStart+moveSequence;
    return result;
}
 
Example 23
Project: GOLAD   File: MyWorld.java   Source Code and License 6 votes vote down vote up
public String getBoard(){
    String result="";
    int counter=2;
    int sum=0;
    ArrayList<Integer> triplets = new ArrayList<Integer>();
    for(int x=0; x<WIDTH; x++){
        for(int y=HEIGHT-1;y>=0;y--){
            Tile t=allTiles[x][y];
            sum+=(Math.pow(4,counter)*t.getState());
            if(counter==0){
                triplets.add(sum);
                sum=0;
                counter=3;
            }
            counter--;
        }
    }
    if(counter!=2){
        triplets.add(sum);
    }
    for(int i:triplets){
        result+=charTable.toCharArray()[i];
    }
    return result;
}
 
Example 24
Project: GOLAD   File: MyWorld.java   Source Code and License 6 votes vote down vote up
public void setTimeLimit(int hours,int minutes,int seconds, int milliseconds){
    timeLimit = new int[]{hours,minutes,seconds,milliseconds};
    if(screen==3){
        removeObjects(getObjectsAt(750,180,Text.class));
        if(hours==Integer.MAX_VALUE){
            addObject(new Text("Untimed",30),750,180);
        }else{
            String maxTimeString = String.valueOf(hours)+":"+
                String.valueOf(minutes)+":"+
                String.valueOf(seconds);
            addObject(new Text(maxTimeString,30),750,180);
        }
    }
}
 
Example 25
Project: openjdk-jdk10   File: ExtDirs.java   Source Code and License 6 votes vote down vote up
public static void main(String... args) throws Exception {
    String value = System.getProperty("java.ext.dirs");
    System.out.format("java.ext.dirs = '%s'%n", value);
    if (args.length > 0) {
        int index = Integer.valueOf(args[0]);
        String expectedValue = VALUES[index];
        if (!(expectedValue == value ||
                (value != null && value.isEmpty()) ||
                (expectedValue != null & expectedValue.equals(value)))) {
            throw new RuntimeException("java.ext.dirs (" +
                    value + ") != " + expectedValue);
        }
        // launched by subprocess.
        return;
    }

    if (value != null) {
        throw new RuntimeException("java.ext.dirs not removed: " + value);
    }

    fatalError(0, "-Djava.ext.dirs=foo");
    start(0);
    start(1, "-Djava.ext.dirs=");
    start(2, "-Djava.ext.dirs=\"\"");
}
 
Example 26
Project: SVGAPlayer-Android   File: MovieParams.java   Source Code and License 5 votes vote down vote up
public MovieParams(Float viewBoxWidth, Float viewBoxHeight, Integer fps, Integer frames,
    ByteString unknownFields) {
  super(ADAPTER, unknownFields);
  this.viewBoxWidth = viewBoxWidth;
  this.viewBoxHeight = viewBoxHeight;
  this.fps = fps;
  this.frames = frames;
}
 
Example 27
Project: openjdk-jdk10   File: TestCipherKeyWrapperTest.java   Source Code and License 5 votes vote down vote up
private void wrapperBlowfishKeyTest() throws InvalidKeyException,
        NoSuchAlgorithmException, NoSuchPaddingException,
        IllegalBlockSizeException, InvalidAlgorithmParameterException {
    // how many kinds of padding mode
    int padKinds;
    // Keysize should be multiple of 8 bytes.
    int KeyCutter = 8;
    int kSize = BLOWFISH_MIN_KEYSIZE;
    String algorithm = "Blowfish";
    int maxAllowKeyLength = Cipher.getMaxAllowedKeyLength(algorithm);
    boolean unLimitPolicy = maxAllowKeyLength == Integer.MAX_VALUE;
    SecretKey key = null;
    while (kSize <= BLOWFISH_MAX_KEYSIZE) {
        for (String mode : MODEL_AR) {
            // PKCS5padding is meaningful only for ECB, CBC, PCBC
            if (mode.equalsIgnoreCase(MODEL_AR[0])
                    || mode.equalsIgnoreCase(MODEL_AR[1])
                    || mode.equalsIgnoreCase(MODEL_AR[2])) {
                padKinds = PADDING_AR.length;
            } else {
                padKinds = 1;
            }
            // Initialization
            KeyGenerator kg = KeyGenerator.getInstance(algorithm);
            for (int k = 0; k < padKinds; k++) {
                String transformation = algorithm + "/" + mode + "/"
                        + PADDING_AR[k];
                if (NOPADDING.equals(PADDING_AR[k]) && kSize % 64 != 0) {
                    out.println(transformation
                            + " will not run if input length not multiple"
                            + " of 8 bytes when padding is " + NOPADDING);
                    continue;
                }
                kg.init(kSize);
                key = kg.generateKey();
                // only run the tests on longer key lengths if unlimited
                // version of JCE jurisdiction policy files are installed
                if (!unLimitPolicy && kSize > LINIMITED_KEYSIZE) {
                    out.println("keyStrength > 128 within " + algorithm
                            + " will not run under global policy");
                } else {
                    wrapTest(transformation, transformation, key, key,
                            Cipher.SECRET_KEY, false);
                }
            }
        }
        if (kSize <= LINIMITED_KEYSIZE) {
            KeyCutter = 8;
        } else {
            KeyCutter = 48;
        }
        kSize += KeyCutter;
    }
}
 
Example 28
Project: dataenum   File: MultipleValues.java   Source Code and License 5 votes vote down vote up
@Override
public int hashCode() {
  int result = 0;
  result = result * 31 + Integer.valueOf(param1).hashCode();
  result = result * 31 + Boolean.valueOf(param2).hashCode();
  return result;
}
 
Example 29
Project: dataenum   File: MultipleValues.java   Source Code and License 5 votes vote down vote up
@Override
public int hashCode() {
  int result = 0;
  result = result * 31 + Integer.valueOf(param1).hashCode();
  result = result * 31 + Boolean.valueOf(param2).hashCode();
  return result;
}
 
Example 30
Project: dataenum   File: InPackage.java   Source Code and License 5 votes vote down vote up
@Override
public int hashCode() {
  int result = 0;
  result = result * 31 + Integer.valueOf(param1).hashCode();
  result = result * 31 + Boolean.valueOf(param2).hashCode();
  return result;
}
 
Example 31
Project: dataenum   File: PrimitiveValue.java   Source Code and License 5 votes vote down vote up
@Override
public int hashCode() {
  int result = 0;
  result = result * 31 + Integer.valueOf(param1).hashCode();
  result = result * 31 + Boolean.valueOf(param2).hashCode();
  result = result * 31 + Float.valueOf(param3).hashCode();
  result = result * 31 + Double.valueOf(param4).hashCode();
  return result;
}
 
Example 32
Project: OpenJSharp   File: IPAddressName.java   Source Code and License 5 votes vote down vote up
private void parseIPv6(String name) throws IOException {

        int slashNdx = name.indexOf('/');
        if (slashNdx == -1) {
            address = InetAddress.getByName(name).getAddress();
        } else {
            address = new byte[32];
            byte[] base = InetAddress.getByName
                (name.substring(0, slashNdx)).getAddress();
            System.arraycopy(base, 0, address, 0, 16);

            // append a mask corresponding to the num of prefix bits specified
            int prefixLen = Integer.parseInt(name.substring(slashNdx+1));
            if (prefixLen > 128)
                throw new IOException("IPv6Address prefix is longer than 128");

            // create new bit array initialized to zeros
            BitArray bitArray = new BitArray(MASKSIZE * 8);

            // set all most significant bits up to prefix length
            for (int i = 0; i < prefixLen; i++)
                bitArray.set(i, true);
            byte[] maskArray = bitArray.toByteArray();

            // copy mask bytes into mask portion of address
            for (int i = 0; i < MASKSIZE; i++)
                address[MASKSIZE+i] = maskArray[i];
        }
    }
 
Example 33
Project: siiMobilityAppKit   File: CalendarProviderAccessor.java   Source Code and License 5 votes vote down vote up
@Override
public String createEvent(Uri eventsUri, String title, long startTime, long endTime,
                          String description, String location, Long firstReminderMinutes, Long secondReminderMinutes,
                          String recurrence, int recurrenceInterval, String recurrenceWeekstart,
                          String recurrenceByDay, String recurrenceByMonthDay, Long recurrenceEndTime, Long recurrenceCount,
                          String allday, Integer calendarId, String url) {
  eventsUri = eventsUri == null ? Uri.parse(CONTENT_PROVIDER + CONTENT_PROVIDER_PATH_EVENTS) : eventsUri;
  return super.createEvent(eventsUri, title, startTime, endTime, description, location,
          firstReminderMinutes, secondReminderMinutes, recurrence, recurrenceInterval, recurrenceWeekstart,
          recurrenceByDay, recurrenceByMonthDay, recurrenceEndTime, recurrenceCount, allday, calendarId, url);
}
 
Example 34
Project: siiMobilityAppKit   File: CalendarProviderAccessor.java   Source Code and License 5 votes vote down vote up
@Override
public String createEvent(Uri eventsUri, String title, long startTime, long endTime,
                          String description, String location, Long firstReminderMinutes, Long secondReminderMinutes,
                          String recurrence, int recurrenceInterval, String recurrenceWeekstart,
                          String recurrenceByDay, String recurrenceByMonthDay, Long recurrenceEndTime, Long recurrenceCount,
                          String allday, Integer calendarId, String url) {
  eventsUri = eventsUri == null ? Uri.parse(CONTENT_PROVIDER + CONTENT_PROVIDER_PATH_EVENTS) : eventsUri;
  return super.createEvent(eventsUri, title, startTime, endTime, description, location,
          firstReminderMinutes, secondReminderMinutes, recurrence, recurrenceInterval, recurrenceWeekstart,
          recurrenceByDay, recurrenceByMonthDay, recurrenceEndTime, recurrenceCount, allday, calendarId, url);
}
 
Example 35
Project: auto-value-bundle   File: AutoValue_TestClassBundledGCM.java   Source Code and License 5 votes vote down vote up
AutoValue_TestClassBundledGCM(Bundle bundle, byte someByte, boolean someBoolean, short someShort,
        int someInt, long someLong, char someChar, float someFloat, double someDouble,
        String someString, CharSequence someCharSequence, Parcelable someParcelable,
        ArrayList<Parcelable> someParcelableArrayList,
        SparseArray<Parcelable> someParcelableSparseArray, Serializable someSerializable,
        ArrayList<Integer> someIntegerArrayList, ArrayList<String> someStringArrayList,
        ArrayList<CharSequence> someCharSequenceArrayList, byte[] someByteArray,
        short[] someShortArray, char[] someCharArray, float[] someFloatArray,
        UnknownObject someUnknownObject, ArrayList<UnknownObject> someUnknownObjectList,
        TestEnum testEnum) {
    super(bundle,
            someByte,
            someBoolean,
            someShort,
            someInt,
            someLong,
            someChar,
            someFloat,
            someDouble,
            someString,
            someCharSequence,
            someParcelable,
            someParcelableArrayList,
            someParcelableSparseArray,
            someSerializable,
            someIntegerArrayList,
            someStringArrayList,
            someCharSequenceArrayList,
            someByteArray,
            someShortArray,
            someCharArray,
            someFloatArray,
            someUnknownObject,
            someUnknownObjectList,
            testEnum);
}
 
Example 36
Project: GOLAD   File: MyWorld.java   Source Code and License 5 votes vote down vote up
public void readBoard(String in,boolean update){   
    moveSequence = "";
    redTurn = true;
    blueTurn = false;
    try{
        String[] parts;
        boolean newMode = false;
        char[] id = in.toCharArray();
        if(id[0]=='B'){
            int indexOfFirstComma = in.indexOf(",");
            int indexOfFirstSlash = in.indexOf("/");
            birth.clear();
            survive.clear();
            for(int i=1;i<indexOfFirstSlash;i++){
                birth.add(Character.getNumericValue(id[i]));
            }
            for(int i=indexOfFirstSlash+2;i<indexOfFirstComma;i++){
                survive.add(Character.getNumericValue(id[i]));
            }
            parts = in.substring(indexOfFirstComma+1).split(",");
        }else{
            parts = in.split(",");
        }
        if (parts.length < 5) {
            throw new IOException();
        }
 
        WIDTH = HEIGHT = Math.min(Math.max(Integer.parseInt(parts[0]),3),20);
        timeLimit[0]=0;
        timeLimit[1] = Integer.parseInt(parts[1]);
        timeLimit[2]=0;
        timeLimit[3]=0;
        timeBonus = Integer.parseInt(parts[2]);
        int humanNum = Integer.parseInt(parts[3]);
        stringToBoard(parts[4],update);
        /*redDepth = (int)(((humanNum/4)-1)*2);
        blueDepth = (((humanNum%4)-1)*2);
        if(redDepth<0){
            redBot = false;
        }else{
            redBot = true;
        }
        if(blueDepth<0){
            blueBot = false;
        }else{
            redBot = true;
        }*/
        int noSwapsUntil = -1;
        String[] moves = new String[parts.length-5];
        for(int i = 0; i<moves.length; i++){
            moves[i]=parts[i+5];
        } 
        int moveLimit = Integer.MAX_VALUE;
        if(screen==4){
            moveArray = moves;        
            totalMoves = moveArray.length;
            moveNumber = 0;
            saveTiles();
        }else{
            saveTiles();
            for (int t = 0; t < moves.length; t++) { // Go through all the moves.
                makeMove(moves[t]);
            } 
        }
        updateNumbers();
        updateLists();            
        boardStart = getBoard();
    }catch (Exception e) {
        JFrame frame = new JFrame("Error");
        JOptionPane.showMessageDialog(frame, "Illegal game string", "Error", 0);
    }       
}
 
Example 37
Project: GOLAD   File: MyWorld.java   Source Code and License 5 votes vote down vote up
public void makeMove(String s){
    String[] moveParts = s.split("\\+");
    if (moveParts.length == 3) {
        redTimer.set(Integer.parseInt(moveParts[1])*(long)(0.01f));
        blueTimer.set(Integer.parseInt(moveParts[2])*(long)(0.01f));
    }else{
        redTimer.set(0);
        blueTimer.set(0);
    }
    int moveType = charTable.indexOf(moveParts[0].charAt(moveParts[0].length()-1))-12;
    if (moveType <= 3) {
        
        int x = charTable.indexOf(moveParts[0].charAt(0))-12;
        int y = charTable.indexOf(moveParts[0].charAt(1))-12;
        if(moveType==1){
            if(redTurn){
                allTiles[x][HEIGHT-y-1].setState(1);
            }else if(blueTurn){
                allTiles[x][HEIGHT-y-1].setState(2);
            }
        }else{
            int swapWith = 0;
            allTiles[x][HEIGHT-y-1].setState(0);
        }
        allTiles[x][HEIGHT-y-1].preupdate(allTiles);
        allTiles[x][HEIGHT-y-1].updateNeighbours(allTiles);
    }else if (moveType == 4){
        //moveNumber = 0;
        //totalMoves = 0;
        doTurn();
    }else{
        int endGameCause = moveType-5;
        endGameCause = 2+3*(moveType-5);
        return;
    }
}
 
Example 38
Project: GOLAD   File: MyWorld.java   Source Code and License 5 votes vote down vote up
public void playerSelect(){
    killAll();
    selected = 0;
    screen = 3;
    HEIGHT = 20;
    WIDTH = 20;
    birth.clear();
    survive.clear();
    birth.add(3);
    survive.add(2);
    survive.add(3);
    redBot = false;
    blueBot = false;
    timeLimit = new int[]{Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE};
    timeBonus = 0;
    addObject(new Text("Player 1", Color.red, 70+fontScale), 200, 40);
    addObject(new SelectPlayers(this, 6),200,120);
    addObject(new Text("Player 2", Color.blue, 70+fontScale), 200, 200);
    addObject(new SelectPlayers(this, 6),200,280);
    addObject(new BoardSize(this),500,120);
    addObject(new Text("20x20",30),500,150);
    addObject(new ChangeRules(this),500,240);
    drawRules();
    addObject(new TimeLimit(this),750,120);
    addObject(new Text("Untimed",30),750,180);
    addObject(new TimeBonus(this),750,240);
    addObject(new Text("0s",30),750,300);
    addObject(new PlayGame(this),435,450);
    addObject(new MainMenu(this), 435,530);      
}
 
Example 39
Project: GOLAD   File: MyWorld.java   Source Code and License 5 votes vote down vote up
public void updateNumbers(){
    if(redNumber!=null){
        removeObject(redNumber);
    }
    if(blueNumber!=null){
        removeObject(blueNumber);
    }
    redNumber = new Text(Integer.toString(reds.size()),30+fontScale);
    blueNumber = new Text(Integer.toString(blues.size()),30+fontScale);
    addObject(redNumber,700,70);
    addObject(blueNumber,700,161);
}
 
Example 40
Project: GOLAD   File: BoardSize.java   Source Code and License 5 votes vote down vote up
public void clickAction(){
    JTextField width = new JTextField();
    JTextField height = new JTextField();
    Object[] message = {
        "Width:", width,
        "Height:", height
    };
    int option = JOptionPane.showConfirmDialog(null, message, "Board Size", JOptionPane.OK_CANCEL_OPTION);
    if (option == JOptionPane.OK_OPTION) {
        try{
            w.setBoardSize(Integer.parseInt(width.getText()),Integer.parseInt(height.getText()));
        }catch(Exception e){}
    }
}
 
Example 41
Project: jdk8u-jdk   File: IPAddressName.java   Source Code and License 5 votes vote down vote up
private void parseIPv6(String name) throws IOException {

        int slashNdx = name.indexOf('/');
        if (slashNdx == -1) {
            address = InetAddress.getByName(name).getAddress();
        } else {
            address = new byte[32];
            byte[] base = InetAddress.getByName
                (name.substring(0, slashNdx)).getAddress();
            System.arraycopy(base, 0, address, 0, 16);

            // append a mask corresponding to the num of prefix bits specified
            int prefixLen = Integer.parseInt(name.substring(slashNdx+1));
            if (prefixLen < 0 || prefixLen > 128) {
                throw new IOException("IPv6Address prefix length (" +
                        prefixLen + ") in out of valid range [0,128]");
            }

            // create new bit array initialized to zeros
            BitArray bitArray = new BitArray(MASKSIZE * 8);

            // set all most significant bits up to prefix length
            for (int i = 0; i < prefixLen; i++)
                bitArray.set(i, true);
            byte[] maskArray = bitArray.toByteArray();

            // copy mask bytes into mask portion of address
            for (int i = 0; i < MASKSIZE; i++)
                address[MASKSIZE+i] = maskArray[i];
        }
    }
 
Example 42
Project: jdk8u-jdk   File: CollectionSupplier.java   Source Code and License 5 votes vote down vote up
/**
 * Create a Collection test case.
 *
 * @param name name of the test case
 * @param collection the modifiable test collection
 */
public TestCase(String name, Function<Collection<Integer>, C> supplier, C collection) {
    this.name = name;
    this.supplier = supplier;
    this.expected = Collections.unmodifiableList(
        Arrays.asList(collection.toArray(new Integer[0])));
    this.collection = collection;
}
 
Example 43
Project: auto-value-bundle   File: AutoValue_TestClassBundledGCM.java   Source Code and License 5 votes vote down vote up
public static TestClassBundledGCM unbundle(Bundle bundle, Gson gson) {
    return new AutoValue_TestClassBundledGCM(
            bundle,
            Byte.parseByte(bundle.getString("some_byte")),
            Boolean.parseBoolean(bundle.getString("some_boolean")),
            Short.parseShort(bundle.getString("some_short")),
            Integer.parseInt(bundle.getString("some_int")),
            Long.parseLong(bundle.getString("some_long")),
            bundle.getString("some_char").charAt(0),
            Float.parseFloat(bundle.getString("some_float")),
            Double.parseDouble(bundle.getString("some_double")),
            bundle.getString("some_string"),
            bundle.getString("some_char_sequence"),
            gson.fromJson(bundle.getString("some_parcelable"), Parcelable.class),
            gson.fromJson(bundle.getString("some_parcelable_array_list"), new com.google.common.reflect.TypeToken<java.util.ArrayList<Parcelable>>(){}.getType()),
            gson.fromJson(bundle.getString("some_parcelable_sparse_array"), new com.google.common.reflect.TypeToken<android.util.SparseArray<Parcelable>>(){}.getType()),
            gson.fromJson(bundle.getString("some_serializable"), Serializable.class),
            gson.fromJson(bundle.getString("some_integer_array_list"), new com.google.common.reflect.TypeToken<java.util.ArrayList<Integer>>(){}.getType()),
            gson.fromJson(bundle.getString("some_string_array_list"), new com.google.common.reflect.TypeToken<java.util.ArrayList<String>>(){}.getType()),
            gson.fromJson(bundle.getString("some_char_sequence_array_list"), new com.google.common.reflect.TypeToken<java.util.ArrayList<CharSequence>>(){}.getType()),
            toPrimitive(gson.fromJson(bundle.getString("some_byte_array"), Byte[].class)),
            toPrimitive(gson.fromJson(bundle.getString("some_short_array"), Short[].class)),
            toPrimitive(gson.fromJson(bundle.getString("some_char_array"), Character[].class)),
            toPrimitive(gson.fromJson(bundle.getString("some_float_array"), Float[].class)),
            gson.fromJson(bundle.getString("some_unknown_object"), new com.google.common.reflect.TypeToken<UnknownObject>(){}.getType()),
            gson.fromJson(bundle.getString("some_unknown_object_list"), new com.google.common.reflect.TypeToken<ArrayList<UnknownObject>>(){}.getType()),
            gson.fromJson(bundle.getString("test_enum"), new com.google.common.reflect.TypeToken<TestEnum>(){}.getType()));
}
 
Example 44
Project: jdk8u-jdk   File: TestCipherKeyWrapperTest.java   Source Code and License 5 votes vote down vote up
private void wrapperBlowfishKeyTest() throws InvalidKeyException,
        NoSuchAlgorithmException, NoSuchPaddingException,
        IllegalBlockSizeException, InvalidAlgorithmParameterException {
    // how many kinds of padding mode
    int padKinds;
    // Keysize should be multiple of 8 bytes.
    int KeyCutter = 8;
    int kSize = BLOWFISH_MIN_KEYSIZE;
    String algorithm = "Blowfish";
    int maxAllowKeyLength = Cipher.getMaxAllowedKeyLength(algorithm);
    boolean unLimitPolicy = maxAllowKeyLength == Integer.MAX_VALUE;
    SecretKey key = null;
    while (kSize <= BLOWFISH_MAX_KEYSIZE) {
        for (String mode : MODEL_AR) {
            // PKCS5padding is meaningful only for ECB, CBC, PCBC
            if (mode.equalsIgnoreCase(MODEL_AR[0])
                    || mode.equalsIgnoreCase(MODEL_AR[1])
                    || mode.equalsIgnoreCase(MODEL_AR[2])) {
                padKinds = PADDING_AR.length;
            } else {
                padKinds = 1;
            }
            // Initialization
            KeyGenerator kg = KeyGenerator.getInstance(algorithm);
            for (int k = 0; k < padKinds; k++) {
                String transformation = algorithm + "/" + mode + "/"
                        + PADDING_AR[k];
                if (NOPADDING.equals(PADDING_AR[k]) && kSize % 64 != 0) {
                    out.println(transformation
                            + " will not run if input length not multiple"
                            + " of 8 bytes when padding is " + NOPADDING);
                    continue;
                }
                kg.init(kSize);
                key = kg.generateKey();
                // only run the tests on longer key lengths if unlimited
                // version of JCE jurisdiction policy files are installed
                if (!unLimitPolicy && kSize > LINIMITED_KEYSIZE) {
                    out.println("keyStrength > 128 within " + algorithm
                            + " will not run under global policy");
                } else {
                    wrapTest(transformation, transformation, key, key,
                            Cipher.SECRET_KEY, false);
                }
            }
        }
        if (kSize <= LINIMITED_KEYSIZE) {
            KeyCutter = 8;
        } else {
            KeyCutter = 48;
        }
        kSize += KeyCutter;
    }
}
 
Example 45
Project: openjdk-jdk10   File: IPAddressName.java   Source Code and License 5 votes vote down vote up
private void parseIPv6(String name) throws IOException {

        int slashNdx = name.indexOf('/');
        if (slashNdx == -1) {
            address = InetAddress.getByName(name).getAddress();
        } else {
            address = new byte[32];
            byte[] base = InetAddress.getByName
                (name.substring(0, slashNdx)).getAddress();
            System.arraycopy(base, 0, address, 0, 16);

            // append a mask corresponding to the num of prefix bits specified
            int prefixLen = Integer.parseInt(name.substring(slashNdx+1));
            if (prefixLen < 0 || prefixLen > 128) {
                throw new IOException("IPv6Address prefix length (" +
                        prefixLen + ") in out of valid range [0,128]");
            }

            // create new bit array initialized to zeros
            BitArray bitArray = new BitArray(MASKSIZE * 8);

            // set all most significant bits up to prefix length
            for (int i = 0; i < prefixLen; i++)
                bitArray.set(i, true);
            byte[] maskArray = bitArray.toByteArray();

            // copy mask bytes into mask portion of address
            for (int i = 0; i < MASKSIZE; i++)
                address[MASKSIZE+i] = maskArray[i];
        }
    }
 
Example 46
Project: GitHub   File: GlideRequest.java   Source Code and License 4 votes vote down vote up
@Override
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
  return (GlideRequest<TranscodeType>) super.load(arg0);
}
 
Example 47
Project: GitHub   File: GlideRequest.java   Source Code and License 4 votes vote down vote up
@Override
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
  return (GlideRequest<TranscodeType>) super.load(arg0);
}
 
Example 48
Project: GitHub   File: GlideRequest.java   Source Code and License 4 votes vote down vote up
@Override
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
  return (GlideRequest<TranscodeType>) super.load(arg0);
}
 
Example 49
Project: GitHub   File: GlideRequest.java   Source Code and License 4 votes vote down vote up
@Override
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
  return (GlideRequest<TranscodeType>) super.load(arg0);
}
 
Example 50
Project: GitHub   File: GlideRequest.java   Source Code and License 4 votes vote down vote up
@Override
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
  return (GlideRequest<TranscodeType>) super.load(arg0);
}
 
Example 51
Project: GitHub   File: GlideRequest.java   Source Code and License 4 votes vote down vote up
@Override
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
  return (GlideRequest<TranscodeType>) super.load(arg0);
}
 
Example 52
Project: GitHub   File: GlideRequest.java   Source Code and License 4 votes vote down vote up
@Override
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
  return (GlideRequest<TranscodeType>) super.load(arg0);
}
 
Example 53
Project: GitHub   File: GlideRequest.java   Source Code and License 4 votes vote down vote up
@Override
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
  return (GlideRequest<TranscodeType>) super.load(arg0);
}
 
Example 54
Project: GitHub   File: GlideRequest.java   Source Code and License 4 votes vote down vote up
@Override
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
  return (GlideRequest<TranscodeType>) super.load(arg0);
}
 
Example 55
Project: GitHub   File: GlideRequest.java   Source Code and License 4 votes vote down vote up
@Override
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
  return (GlideRequest<TranscodeType>) super.load(arg0);
}
 
Example 56
Project: GitHub   File: GlideRequest.java   Source Code and License 4 votes vote down vote up
@Override
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
  return (GlideRequest<TranscodeType>) super.load(arg0);
}
 
Example 57
Project: GitHub   File: GlideRequest.java   Source Code and License 4 votes vote down vote up
@Override
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
  return (GlideRequest<TranscodeType>) super.load(arg0);
}
 
Example 58
Project: GitHub   File: GlideRequest.java   Source Code and License 4 votes vote down vote up
@Override
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
  return (GlideRequest<TranscodeType>) super.load(arg0);
}
 
Example 59
Project: SVGAPlayer-Android   File: MovieParams.java   Source Code and License 4 votes vote down vote up
public MovieParams(Float viewBoxWidth, Float viewBoxHeight, Integer fps, Integer frames) {
  this(viewBoxWidth, viewBoxHeight, fps, frames, ByteString.EMPTY);
}
 
Example 60
Project: OpenDA   File: WflowPythonToJavaAdapter.java   Source Code and License 4 votes vote down vote up
/**
 * From wf_DynamicFramework.py:
 *  def wf_supplyVariableRoles(self):
 *    """
 *    returns the a list of variable roles
 *    """
 *
 * From wflow_hbv.py:
 *  def supplyVariableNamesAndRoles(self):
 *    role: 0 = input (to the model)
 *          1 = is output (from the model)
 *          2 = input/output (state information)
 *          3 = model parameter
 *
 * @return int[] variable roles.
 */
public int[] getVariableRoles() {
	try {
		//method jep.getValue for some reason converts a list of integers to a single String,
		//therefore here pass a buffer array of type int[] to Python, copy the integers into
		//that array and get that array back to Java.
		this.jep.eval("tempVariableRoles = dynModelFw.wf_supplyVariableRoles()");
		int numberOfVariableRoles = (Integer) this.jep.getValue("len(tempVariableRoles)");
		int[] integersBuffer = new int[numberOfVariableRoles];
		this.jep.set("integersBuffer", integersBuffer);
		this.jep.eval("for i in range(len(tempVariableRoles)): integersBuffer[i] = tempVariableRoles[i]\n");
		return (int[]) this.jep.getValue("integersBuffer");
	} catch (JepException e) {
		throw new RuntimeException(getClass().getSimpleName() + ": exception during call to python code. Message was: " + e.getMessage(), e);
	}
}