Special-case sprite positioning

I have several objects which are assigned a certain size and position, works fine. The only problem is that in certain special cases the item has to be positioned a bit to the left and be a bit smaller; I solved this problem as follows:

private void initSprites(){
sprites = new HashMap<String, Sprite>();
sprites.put("lock", new Sprite(new Texture(Gdx.files.internal("lock.png"))));
for(int x = 0; x < creators.size(); x++){
Sprite tmp = new Sprite(new Texture(Gdx.files.internal("sprites/"+creators.get(x)+".png")));
tmp.setSize(creators.get(x).equals("stick")?10f:20f, 20f);
sprites.put(creators.get(x), tmp);
}
}


and

private void addCreator(String name, Stage stage, int location){
Sprite spr = sprites.get(name);//here
Box2DObjectCreator act = new Box2DObjectCreator(locations[location]+(name.equals("stick")?4f:0f), items.get(name), spr, stage, definitions.get(name), camera);
act.setBounds(act.getX(), act.getY(), spr.getWidth(), spr.getHeight());
}


The code works obviously but there are going to be a couple of special cases and the only way I can check for those cases is comparing a string which seems a little ugly. Is there a cleaner way to do this besides something like

   private int method(string str)
return (str.equals("specialCase")?10:20);


or a method that uses switches with all special cases?

That doesn't seem too efficient but seems like my only option if I'm going to have several special cases (which I will, something like 40 normals and 5-10 special cases).

• Could you post your Sprite class? I suspect that the solution lies there. – 200_success Jan 12 '16 at 3:32
• The Sprite class is the one from libGDX and it's here – Vacster Jan 12 '16 at 3:34
• Wouldn't this be more suited for stackoverflow? it's not as much a review question as a programming question – Tschallacka Jan 12 '16 at 7:48