Always case insensitive

This commit is contained in:
Olof Larsson 2013-01-29 19:00:10 +01:00
parent d9c6abe12b
commit 9068618e8c
6 changed files with 12 additions and 69 deletions

View File

@ -2,7 +2,7 @@ package com.massivecraft.mcore5.cmd.arg;
import java.util.Collection;
public class ARStringMatchFullCI extends ARAbstractStringMatch
public class ARStringMatchFull extends ARAbstractStringMatch
{
// -------------------------------------------- //
// IMPLEMENTATION
@ -18,7 +18,7 @@ public class ARStringMatchFullCI extends ARAbstractStringMatch
// CONSTRUCT
// -------------------------------------------- //
public ARStringMatchFullCI(String typename, Collection<Collection<String>> altColls)
public ARStringMatchFull(String typename, Collection<Collection<String>> altColls)
{
super(typename, altColls);
}

View File

@ -1,25 +0,0 @@
package com.massivecraft.mcore5.cmd.arg;
import java.util.Collection;
public class ARStringMatchFullCS extends ARAbstractStringMatch
{
// -------------------------------------------- //
// IMPLEMENTATION
// -------------------------------------------- //
@Override
public Integer matches(String arg, String alt)
{
return alt.equals(arg) ? 0 : null;
}
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public ARStringMatchFullCS(String typename, Collection<Collection<String>> altColls)
{
super(typename, altColls);
}
}

View File

@ -2,7 +2,7 @@ package com.massivecraft.mcore5.cmd.arg;
import java.util.Collection;
public class ARStringMatchStartCI extends ARAbstractStringMatch
public class ARStringMatchStart extends ARAbstractStringMatch
{
// -------------------------------------------- //
// IMPLEMENTATION
@ -27,7 +27,7 @@ public class ARStringMatchStartCI extends ARAbstractStringMatch
// CONSTRUCT
// -------------------------------------------- //
public ARStringMatchStartCI(String typename, Collection<Collection<String>> altColls)
public ARStringMatchStart(String typename, Collection<Collection<String>> altColls)
{
super(typename, altColls);
}

View File

@ -1,32 +0,0 @@
package com.massivecraft.mcore5.cmd.arg;
import java.util.Collection;
public class ARStringMatchStartCS extends ARAbstractStringMatch
{
// -------------------------------------------- //
// IMPLEMENTATION
// -------------------------------------------- //
@Override
public Integer matches(String arg, String alt)
{
if (alt.startsWith(arg))
{
return alt.length() - arg.length();
}
else
{
return null;
}
}
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public ARStringMatchStartCS(String typename, Collection<Collection<String>> altColls)
{
super(typename, altColls);
}
}

View File

@ -11,8 +11,8 @@ import com.massivecraft.mcore5.MCore;
import com.massivecraft.mcore5.MPlugin;
import com.massivecraft.mcore5.Predictate;
import com.massivecraft.mcore5.cmd.arg.ARStringEntity;
import com.massivecraft.mcore5.cmd.arg.ARStringMatchFullCI;
import com.massivecraft.mcore5.cmd.arg.ARStringMatchStartCI;
import com.massivecraft.mcore5.cmd.arg.ARStringMatchFull;
import com.massivecraft.mcore5.cmd.arg.ARStringMatchStart;
import com.massivecraft.mcore5.cmd.arg.ArgReader;
import com.massivecraft.mcore5.util.MUtil;
import com.massivecraft.mcore5.util.PlayerUtil;
@ -134,12 +134,12 @@ public class PlayerColl<E extends PlayerEntity<E>> extends Coll<E, String>
public ArgReader<String> argReaderPlayerNameFull()
{
return new ARStringMatchFullCI("player", this.forgeAltColls());
return new ARStringMatchFull("player", this.forgeAltColls());
}
public ArgReader<String> argReaderPlayerNameStart()
{
return new ARStringMatchStartCI("player", this.forgeAltColls());
return new ARStringMatchStart("player", this.forgeAltColls());
}
public ArgReader<E> argReaderPlayerFull()

View File

@ -10,8 +10,8 @@ import org.bukkit.command.CommandSender;
import com.massivecraft.mcore5.MPlugin;
import com.massivecraft.mcore5.Predictate;
import com.massivecraft.mcore5.cmd.arg.ARStringEntity;
import com.massivecraft.mcore5.cmd.arg.ARStringMatchFullCI;
import com.massivecraft.mcore5.cmd.arg.ARStringMatchStartCI;
import com.massivecraft.mcore5.cmd.arg.ARStringMatchFull;
import com.massivecraft.mcore5.cmd.arg.ARStringMatchStart;
import com.massivecraft.mcore5.cmd.arg.ArgReader;
import com.massivecraft.mcore5.mixin.Mixin;
import com.massivecraft.mcore5.util.MUtil;
@ -148,12 +148,12 @@ public class SenderColl<E extends SenderEntity<E>> extends Coll<E, String>
public ArgReader<String> argReaderSenderIdFull()
{
return new ARStringMatchFullCI("player", this.forgeAltColls());
return new ARStringMatchFull("player", this.forgeAltColls());
}
public ArgReader<String> argReaderSenderIdStart()
{
return new ARStringMatchStartCI("player", this.forgeAltColls());
return new ARStringMatchStart("player", this.forgeAltColls());
}
public ArgReader<E> argReaderEntityFull()