View Javadoc

1   package org.sat4j.pb.tools;
2   
3   
4   public class StringNegator implements INegator<String> {
5   
6   	public static final INegator<String> instance = new StringNegator();
7   
8   	private StringNegator() {
9   		// no access to constructor
10  	}
11  
12  	public boolean isNegated(String thing) {
13  		return thing.startsWith("-");
14  	}
15  
16  	public String unNegate(String thing) {
17  		if (isNegated(thing))
18  			return thing.substring(1);
19  		return thing;
20  	}
21  }