method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
1eabdef9-6ca6-423c-920e-ef043c0e10f5 | 1 | public StagShopPlayer(StageManager stageManager, Map<String, String> data) {
super(stageManager, data);
PlayerData.load();
players = new ArrayList<>();
buttons = new BufferedImage[2][2];
try {
addPlayer("/graphics/entity/MCPlayerAnimation.xml", ImageIO.read(getClass().getResourceAsStream("/graphics/entity/... |
13142705-f06a-4cae-9010-afb7c7742432 | 7 | @Override
public Object getValueAt(int rowIndex, int columnIndex) {
ComponentIn in = ins.get(rowIndex);
switch (columnIndex) {
case 0:
return in.getComponent().getId();
case 1:
return in.getDate();
case 2:
return in.... |
43c2bfd4-0280-4e06-96f7-a14e9488bce5 | 5 | @EventHandler
public void onArenaStart(PAStartEvent e){
FileConfiguration config = Main.getConfig();
HashSet<ArenaTeam> Teams = e.getArena().getTeams();
for (ArenaTeam t : Teams) {
HashSet<ArenaPlayer> Players = t.getTeamMembers();
if (t.getName().equalsIgnoreCase(config.getString("PVPArena.BlueTeamN... |
e099bde6-48ba-4b4f-be0a-9476a15a2e1b | 5 | @Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (tagLabel != null ?
tagLabel.hashCode() : 0);
result = 31 * result + (parentLink != null ?
parentLink.hashCode() : 0);
result = 31 * result + (creatio... |
de00a344-bb01-4970-8905-89575f66e1b7 | 3 | public void run() {
try {
// this will handle our XML
voyageHandler voyagesHandler = new voyageHandler();
// get a parser object
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
// get an InputStream from somewhere (could be HttpConnec... |
4752e874-2d19-4afa-8225-6029d38c002e | 6 | public final void levelDone() {
if (!inGameState("InGame") || inGameState("LevelDone")
|| inGameState("LifeLost") || inGameState("GameOver") ) return;
// System.err.println(
// "Warning: levelDone() called from other state than InGame." );
//}
clearKey(key_continuegame);
removeGameState("StartLevel");
r... |
5ff7e486-396b-43ab-bfe3-f7fec3533c01 | 7 | public Move giveMove(){
//update the weights for the new state
double[][] w = newGenerateWeights(super.currentGameState.getStatus());
//double[][] w1 = generateWeights(super.currentGameState.getStatus());
Iterator<String> i = super.currentGameState.getDict().iterator();
for(int j =0; j<5;j++){
Letterpress.p... |
df2f1384-3ae9-4895-bb2f-cace02905393 | 4 | public static void main(String[] args) {
//TODO think if we want to remove it
System.setProperty("java.net.preferIPv4Stack" , "true");
try {
prop.load(new FileInputStream(CONFIG_FILE));
startSMTPNotifictionThread();
startLisning();
} catch (NumberFormatException e) {
System.out.println("Plz ch... |
88810608-1b84-402b-a4a6-10fafe8c4661 | 4 | public boolean isMove()
{
return (fromTable!=null && toTable!=null&& toName != null && fromName!= null && toName.equals(fromName));
} |
cf1949e2-98e2-4f99-bbb5-651dbbe60159 | 1 | public void onStart() {
preStop = false;
preStart = false;
isStarted = true;
DodgeballPlayer parray[] = new DodgeballPlayer[1];
parray = playerList.toArray(parray);
Player pl = (parray[rand.nextInt(parray.length)]).getPlayer();
pl.setItemInHand(new ItemStack(Mater... |
4795252e-153a-4e74-a29a-3606567379b3 | 0 | public void setAmount(double amount) {
this.amount = amount;
} |
b603fdfd-7537-458e-8d3b-3db2ee303303 | 9 | @SuppressWarnings("unused")
private void i(String input[]) throws SecurityException,
NoSuchFieldException, IllegalArgumentException,
IllegalAccessException, InstantiationException {
if (inspObject.isNull() || inspObject.isPrimitive() || input.length < 2
|| input.length > 3) {
InfoPrinter.printNothingTo... |
fc3f081b-e3ee-4641-bd3f-ff1bde69c00b | 7 | public List<String> getmenuItemsCourseType() {
List<String> menuItemsCourseType = new ArrayList<String>() {
private static final long serialVersionUID = 3109256773218160485L;
{
try {
//Connect to database
conn... |
706cb321-b42d-4c1e-ad1f-44f4f9747ce2 | 0 | public Iterable<String> keysWithPrefix(String prefix) {
Queue<String> q = new LinkedList<String>();
Node x = get(root, prefix, 0);
collect(x, new StringBuilder(prefix), q);
return q;
} |
70e9122a-cd75-42bb-add5-2707721040da | 2 | public Quantity sub (Quantity target) throws IllegalArgumentException
{
if(target.unit == null || !target.unit.equals(this.unit))
{ throw new IllegalArgumentException(); }
Quantity result = new Quantity (this.value - target.value, target.numerator, target.denominator);
return result;
} |
b8aa18c7-c6a7-4520-9899-253c0063c4ef | 7 | private final MaplePortal getFreePortal() {
final List<MaplePortal> freePortals = new ArrayList<MaplePortal>();
for (final MaplePortal port : town.getPortals()) {
if (port.getType() == 6) {
freePortals.add(port);
}
}
Collections.sort(freePortals, new Comparator<MaplePortal>() {
@Override
pub... |
e50af1c7-76d6-4eb9-bed7-1e244718cb87 | 2 | private Tree compoundStatementPro(){
Tree statements = null;
if(accept(Symbol.Id.PUNCTUATORS,"\\{")!=null){
statements = statementsPro();
if(accept(Symbol.Id.PUNCTUATORS,"\\}")!=null){
return statements;
}
}
return null;
} |
5383bbd7-c69e-4416-95b5-b2c2c184ede1 | 7 | public void receive(Message msg) {
Address sender=msg.getSrc();
if(bridge.getAddress().equals(sender)) // discard my own messages
return;
RelayHeader hdr=msg.getHeader(id);
switch(hdr.type) {
case DISSEMINATE: // should not occur here, but... |
0127bf81-dd93-4860-872c-b16d56a01f1a | 4 | public void generation(String srcWord, int length)
{
generated.add(srcWord);
System.out.println(srcWord);
//processQueue(srcWord);
checkOneLetterOff(srcWord);
if(length != 0)
{
if(tmp4.size() > location)
{
if(!(tmp4.get(location).isEmpty()) && location <tmp4.size()-1)
{
location++;
... |
dc2fcfa5-4bc3-42cd-bae1-469dfdac3cd4 | 7 | public static void makeCompactGrid(Container parent,
int rows, int cols,
int initialX, int initialY,
int xPad, int yPad) {
SpringLayout layout;
try {
layout = (SpringLayout)pa... |
21e76c95-41a1-437b-8b88-82c92551df38 | 0 | public void start () {
engine.start();
} |
652da659-7c94-4dd6-8c01-896bd419efbe | 9 | public void processQueries(String strInputFilePath, String strOutputFilePath)
throws IOException {
oBufferedReader = new BufferedReader(new FileReader(strInputFilePath));
oBufferedWriter = new BufferedWriter(new FileWriter(strOutputFilePath));
calcuateTFIDF(oBufferedReader);
oBufferedReader.close();
oBuff... |
3d93df1d-c354-45f9-8bbc-3968fe8abd14 | 2 | public void addDish(Dish dish) {
if (storage.avaiable(dish)) {
queue.add(dish);
storage.prepare(dish);
}
if(queue.size()>10){
getFirstDish();
}
} |
28e3ab81-27bc-43b6-8a6f-76b94c56e599 | 9 | private boolean checkRightDiagonalWin(int playerNumber) {
int criticalNumber = 0;
int i = 0;
int j = gameField.getFieldSize() - 1;
switch(playerNumber) {
case 1: {
while (i < gameField.getFieldSize()) {
if(gameField.isX(i,j)) {
... |
66186027-8cde-4d90-9812-7bded636747b | 4 | public Gridlet getNextGridlet(int userID) throws NoMoreGridletsException
{
if ((_configs == null) || (_currentConfig == null))
throw new NoMoreGridletsException();
if (_currentConfigGridletsCount >= _currentConfig.getCount())
{
if (!_itCurrentGC.hasNext())
... |
ebe03a2b-bdb3-42ad-99c9-5501de955f7f | 0 | public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
System.out.println("Blip3.readExternal");
s = (String)in.readObject();
i = in.readInt();
} |
33a5f13d-782b-43ac-a93e-ffb4be65d479 | 6 | @EventHandler(priority= EventPriority.NORMAL)
public void onInventoryOpenEvent(InventoryOpenEvent e){
if(e.getPlayer().hasPermission("pexp.everywhere")){
return;
}
if(!(e.getPlayer() instanceof Player)){
if(e.getVie... |
151fbf7b-3bd1-4196-95be-563c1a2128f3 | 1 | public static DataLayerManager getInstance() {
if (instance == null)
instance = new DataLayerManager();
return instance;
} |
817ed029-b322-4121-842e-e3b452e61ac9 | 6 | public int getInt(String itemTxt)
{
int num = 0;
if(itemTxt.equals("inv1"))
{
num = 1;
}
else if(itemTxt.equals("inv2"))
{
num = 2;
}
else if(itemTxt.equals("inv3"))
{
num = 3;
}
else if(itemTxt.equals("inv4"))
{
num = 4;
}
else if(itemTx... |
c71a8b84-0708-4809-94f3-b9f88002f346 | 5 | public void detectOther(Sprite other) {
if(isRemovable) return;
if( other == detected) return;
detected = other;
if(getCenter().distance(other.getCenter()) <=
getWidth() / 2 + other.getWidth()/2){
collide(other);
other.collide(this);
}else{
... |
30350fd3-8fb3-4a48-9016-4a69a9e795d4 | 0 | public RedrawButtonListener(GraphDrawer d) {
this.d = d;
} |
c9dc68c3-4bab-477a-92bf-97e55ad4f9d8 | 2 | private Runnable createConsumer(final CloudNode cloudNode) {
return () -> {
logger.info("Consumer thread started.");
while (!this.isMaster(cloudNode)) {
try {
final String task = HazelcastHelper.this.getTaskQueue().take();
logger.in... |
5a2f0023-8012-476b-86dc-638fa255aa85 | 9 | private void setShapeDefault(Attributes attrs) {
// find the value to be set, then set it
if (attrs.getValue(0).equals("fill"))
shapeDef.setFill(Boolean.valueOf(attrs.getValue(1)));
else if (attrs.getValue(0).equals("color"))
shapeDef.setColor(new Color((Integer.valueOf(attrs.getValue(1)
.substring(1),... |
9efec55b-765f-45bb-86b7-b4317ca0f74f | 3 | private Tree constructorCallPro(){
Tree argumentListOpt=null;
Symbol identifier;
if((identifier = accept(Symbol.Id.IDENTIFIER_NAME))!=null){
if(accept(Symbol.Id.PUNCTUATORS,"\\(")!=null){
argumentListOpt = argumentListPro();
if(accept(Symbol.Id.PUNCTUATORS,"\\)")!=null){
return new ConstructorCal... |
765acdcd-c393-48a3-9eca-03701157a370 | 4 | public Collection<Merchant> getMerchants(Token t)
{
HTTPClient client = GoCoin.getHTTPClient();
client.setRequestOption(HTTPClient.KEY_OPTION_PATH,"/merchants/");
client.addAuthorizationHeader(t);
try
{
//make the GET request
client.doGET(client.createURL(HTTPClient.URL_TYPE_API));
... |
71d920d2-d5d7-44a7-9d5e-25b67328d3e1 | 9 | public Domain cap(Domain d) {
if (!(d instanceof IntDomain))
return EMPTY;
IntDomain new_d = new IntDomain();
IntDomain d0 = this;
IntDomain d1 = (IntDomain) d;
try {
int[] interval;
int min0, max0, min1, max1;
int i0 = 0;
int i1 = 0;
while (i0 < d0.intervals.size() && i1 < d1.intervals.size... |
8071dcf1-5de3-4735-ad20-02464b02924f | 9 | public static void main(String[] args) throws Exception {
{
File json = new File("/home/markus/Country.json");
FileUtils.write(json, "{\n", true);
Country[] countries = Country.values();
for (Country country : countries) {
FileUtils.write(json, "\"... |
9e7d521a-5bca-4d61-abcb-9045d6046f62 | 1 | public void print(){
for(Term term: this){
System.out.println("Iterator Found: " + term.getName());
}
} |
24c43e27-b252-4806-b94d-200f5bf5cd9a | 8 | public RulesMainCLI(String[] args)
{
if (args.length < 1)
{
System.out.println(HEADER);
System.out.println(FOOTER);
System.out.println("Use -h or --help for command line options.");
return;
}
CommandLine cl = null;
Options options = new Options();
options.addOption("p"... |
1a0ad4e2-1732-4951-9d1b-ceb739dac4ca | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Perfil)) {
return false;
}
Perfil other = (Perfil) object;
if ((this.id == null && other.id != null) || (this.i... |
a6c513e6-24e0-458a-8f81-5d0a918022de | 8 | private void gameRender() {
if (dbImage == null) {
dbImage = createImage(PWIDTH, PHEIGHT);
g = dbImage.getGraphics();
}
// clear screen
g.setColor(Color.WHITE);
g.fillRect(0, 0, PWIDTH, PHEIGHT);
// green board
g.setColor(new Color(62, 156, 76));
g.fillRect(BORDER, BORDER, PWIDTH - 2 * BORDER, P... |
d10da846-eb74-4ceb-8bce-4bfdfb7573c0 | 2 | public Locale dequeue() throws Exception {
Locale retVal = null;
// Check for underflow.
if (! this.isEmpty()) {
retVal = arr[frontPtr];
// Shift every element towards the front.
for(int i = 0; i < backPtr; i++) {
arr[i] = arr[i+1];
... |
def0a5f1-3279-480a-abe1-0a8cb325e7e3 | 9 | private boolean isStandardProperty(Class clazz) {
return clazz.isPrimitive() ||
clazz.isAssignableFrom(Byte.class) ||
clazz.isAssignableFrom(Short.class) ||
clazz.isAssignableFrom(Integer.class) ||
clazz.isAssignableFrom(Long.class) ||
clazz.isAssignab... |
35cfdfc6-5d6e-4d8e-8120-0ea3bc31d94e | 1 | public ShellLink setLanguage(String s) {
ConsoleFEData cd = (ConsoleFEData)extra.get(ConsoleFEData.signature);
if (cd == null) {
cd = new ConsoleFEData();
extra.put(ConsoleFEData.signature, cd);
}
cd.setLanguage(s);
return this;
} |
3b0b7b38-9be3-4e9a-a8cd-2e4d0388e73c | 8 | private static void abortPhase(Registry registry, LogItem logItem)
{
try
{
boolean failedServer = false;
ICoreServer primary = null;
for (String serverName : registry.list())
{
//For every server, check it is alright to commit, and pass it the log
try {
ICoreServer currentServer = ((ICor... |
504bde08-ea57-49b3-be11-ddcddec6adef | 3 | protected static boolean isSkeletonSpecial(OggPacket packet) {
byte[] d = packet.getData();
// Is it a Skeleton Fishead or Fisbone packet?
if (d.length < 52) return false;
if (IOUtils.byteRangeMatches(MAGIC_FISHEAD_BYTES, d, 0)) return true;
if (IOUtils.byteRangeMatches(MAGIC_... |
c1295e91-ad13-4f13-8adc-ad2954c6616b | 3 | @Override
public void onPlayerItemUse(ChunkyPlayerItemUseEvent event) {
try {
if (!Permissions.PLAYER_BUILD_ANYWHERE.hasPerm(event.getChunkyPlayer().getPlayer())) return;
} catch (ChunkyPlayerOfflineException e) {
return;
}
if (event.getAccessLevel().equals(Ac... |
6c7792e9-8236-47cf-9d0f-23e15a13f0b6 | 1 | public void closeStatement(){
try
{
stmnt.close();
}
catch (SQLException ex)
{
handleSqlExceptions(ex);
}
} |
675b8882-517f-43cf-8697-404a37c3178e | 9 | public CalculateAccordingUser(ReadData data) throws IOException {
FileOutputStream fos = new FileOutputStream("comments_2.csv");
OutputStreamWriter osw = new OutputStreamWriter(fos, "GBK");
BufferedWriter bw = new BufferedWriter(osw);
HashMap<String, ArrayList<Comment>> userCommentMap = data.getUserCommentMap(... |
95448f84-8b42-4e26-b2f8-ad385da91155 | 4 | private String makeBoardMove(CardGame game) {
switch (moveTypeTo) {
case TO_ACE_PILES:
return game.moveCardOntoAceFromBoard(indexFrom, indexTo);
case TO_KING_PILES:
return game.moveCardOntoKingFromBoard(indexFrom, indexTo);
case TO_HAND:
... |
5bd4a133-118c-49f5-9c84-58b02645ccad | 2 | private String[] getPersonData(String name) throws Exception {
for (String[] item : data) {
if (item[NAME_INDEX].trim().equals(name)) {
return item;
}
}
throw new Exception("Data for " + name + " not found!");
} |
47bff214-98ef-437d-ac0a-d639785994f2 | 2 | public Duck(HuntField field) {
boolean searchPosition = true;
this.field = field;
while (searchPosition) {
position = new Position(new Random().nextInt(field.getXLength()), new Random().nextInt(field.getYLength()));
if (field.setItem(this, position)) {
sea... |
5d2d6773-710b-404f-a202-9f957dbca2a2 | 2 | public int getUnreadMessage(){
int remaining = 0;
try {
PreparedStatement checkCount = connection.prepareStatement(
"select min(msg_seq) from hl7_q where read_flag is null");
ResultSet rs = checkCount.executeQuery();
while (rs.next()){
... |
0789da7a-45f3-4900-841b-523e9fa38360 | 7 | public void uimsg(String msg, Object... args) {
if (msg == "pop") {
is_ready = true;
final int xoff = 50;
if (inputs != null) {
for (Widget w : inputs)
w.unlink();
for (Widget w : outputs)
w.unlink();
... |
811a0de4-69e7-4cf2-87a1-65585949900f | 5 | public Matrix backSubstitution(Matrix y) {
if(rows != cols) {
throw new IllegalArgumentException("Matrica nije kvadratna!");
}
if(y.rows != rows || y.cols != 1) {
throw new IllegalArgumentException("Krivi format vektora!");
}
double[] x = new double[rows];
for(int i = rows - 1; i >= 0; i--) {... |
dfff8686-d197-4b53-947a-dd04032461ce | 7 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(!Chant.chantAlignmentCheck(this,mob,false,auto))
return false;
final Room R=mob.location();
if((R!=null)&&(!auto))
{
this.alwaysRandomArea=true;
if(super.getPlanarAbility(R.getArea())... |
5532804f-61b4-496a-9ec3-becdeccc73a1 | 8 | public String encodeSolution() throws EncodeException {
StringBuilder res = new StringBuilder();
if (this.solution != null && this.solution.length > 0) {
if (solution[0] instanceof Integer) {
res.append("int");
} else if (solution[0] instanceof Double) {
... |
68820129-e988-44b6-bbff-0d70f4d46071 | 8 | @Override
public Response serve(IHTTPSession session) {
Method method = session.getMethod();
String uri = session.getUri();
Map<String, String> parms = session.getParms();
File rootDirectory = new File("www");
Response res = new NanoHTTPD.Response("jErgoViewer - Not Found");
if (uri.endsWith(".do")) {
... |
df655aee-d1a6-45e0-8cb4-4482ed2bdb19 | 3 | public void setRight(PExp node)
{
if(this._right_ != null)
{
this._right_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
... |
4b2994d6-a074-49f8-a705-9009fc07c2fe | 4 | private static void scanNetworkInterfaces()
{
Enumeration<NetworkInterface> enumNI = null;
NetworkInterface niTmp = null;
EzimNetwork.nifs = new Hashtable<NetworkInterface, List<InetAddress>>();
try
{
enumNI = NetworkInterface.getNetworkInterfaces();
while(enumNI.hasMoreElements())
{
niTmp = e... |
1ac9c5fe-6597-4801-8ac5-f2e587d06303 | 4 | public static Solucao eliminarRedundancia(Solucao solucao){
Multimap<Float, Integer> colunas = TreeMultimap.create();
for(Coluna coluna : solucao.getColunas()){
Float custo = coluna.getCusto();
colunas.put((custo*(-1)), coluna.getNome());
}
Solucao testa... |
21039797-7a1a-4c49-a469-9496bd917e84 | 6 | @EventHandler
public void PlayerSlow(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getPlayerConfig().getDouble("Player.Slow.Dodge... |
c696b8f9-31cd-4fda-847a-1ed5067f218b | 2 | public void redo() {
if (!redo.empty()) {
ArrayList<Delta> toDo = redo.pop();
for (Delta d : toDo) {
d.unundo(colorArr);
}
undo.push(toDo);
}
} |
28d12c45-dc73-4a8b-82c7-6155a7081bc3 | 2 | public void init() throws IOException{
if(targetDirs.size() == 0){
logger.error("No target is set");
return;
}
this.filesInTargetsNotInSource = new ArrayList<ArrayList<Path>>();
this.filesInSourceNotInTargets = new ArrayList<ArrayList<Path>>();
for(Path... |
56f818ad-07f0-4fca-819a-819282b6e38c | 5 | @Test
public void getBillLinesByStudentTest() throws InstanceNotFoundException {
Calendar cb3 = Calendar.getInstance();
Booking b3 = new Booking(cb3, familyService.findStudent(0),
bookingService.findDiningHall(0));
HashSet<Activity> activityForS = new HashSet<Activity>();
HashSet<Booking> bookingForS = n... |
2103fc9d-b5fb-4df1-b7fa-470546b99474 | 2 | public void update() {
for (GameObject obj : myObjects) {
obj.update();
}
for (GameObject obj : objects) {
obj.update();
}
} |
30278bae-dae4-41b8-8b98-816396d0d3f4 | 9 | public static void main(String args[]) throws Throwable {
primes[0]=primes[1]=true;
for(int i=0,c=0;i<MAX;i++)
if(!primes[i]) {
if(c<MAX_PRIMES)
lstPrimes[c++]=i;
for(int j=i+i;j<MAX;j+=i)
primes[j]=true;
}
int MAX_SOL=10001;
int[] euler=new int[MAX_SOL];
for(int i=0;i<MAX_SOL;i++)
... |
f8922213-4e71-47d2-8b44-df9cba741db1 | 8 | public void setStrokeParts(float w, int cap, int join, float limit, float[] ary, float phase) {
if (w == NOWIDTH) {
w = state.stroke.getLineWidth();
}
if (cap == NOCAP) {
cap = state.stroke.getEndCap();
}
if (join == NOJOIN) {
join = state.stro... |
9bff5e1c-83ec-46ec-9757-a8bf1d97ac8a | 3 | @Override
public ArrayList<String> getTerminationSprites() {
ArrayList<String> result = new ArrayList<String>();
if(stype1 != null) result.add(stype1);
if(stype2 != null) result.add(stype2);
if(stype3 != null) result.add(stype3);
return result;
} |
5890b75c-6ce9-4ad0-a532-abfeeda194fe | 0 | public Boolean isUsed() {
return used;
} |
baf10b8c-7a5c-438a-9b4b-b957868f6e3a | 9 | public void run(){
//System.err.println(this+":run >");
Buffer buf=new Buffer(rmpsize);
Packet packet=new Packet(buf);
int i=-1;
try{
while(isConnected() &&
thread!=null &&
io!=null &&
io.in!=null){
i=io.in.read(buf.buffer,
14,
... |
962038e7-c8c2-4b53-9bd0-ef1e683015e5 | 0 | public String getName()
{
return name;
} |
e268cf2f-3689-4393-bc41-f846da4869eb | 3 | private void refreshTable() {
if (modelHR.getRowCount() > 0) {
for (int i = modelHR.getRowCount() - 1; i > -1; i--) {
modelHR.removeRow(i);
}
}
try {
populateTable();
} catch (Throwable e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} |
ea08df2f-91ac-404c-a57d-03c55f2deabd | 9 | public ChessPanel() {
super();
this.mainPanel.setLayout(null);
this.setContentPane(this.mainPanel);
this.initBackground(this.mainPanel);
this.initBlockLabel(this.mainPanel);
this.mainPanel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
... |
228bda3a-6401-44a8-8320-edd92ea903dd | 4 | protected void redirectToCo(String[] validatedInput,
HttpServletResponse resp) throws IOException {
// エンコード。"(" と ")" を戻している。
// 前工程で正規化が済んでいる点に注意。
String encodedInput1 = URLEncoder.encode(validatedInput[1], "utf-8")
.replaceAll("%28", "(").replaceAll("%29", ")");
String encodedInput2 = URLEncoder.encod... |
bbd7a2a3-c89a-409c-96ac-5b1cc029eb4a | 3 | public void paint(Graphics g) {
switch (player.dir) {
case 1:
g.drawImage(image, player.getX()+30, player.getY()+15, player.gameScreen);
break;
case 2:
g.drawImage(image, player.getX()+3, player.getY()+15, player.gameScreen);
break;
case 3:
g.drawImage(image, player.getX()-5, player.getY(... |
b44f553e-7385-469f-ae77-510e40db4a8b | 4 | public void remove(Packet p) {
if(!activePackets.remove(p)) {
if(!passivePackets.remove(p)) {
// The packet was in neither list
return; // nothing changed, the interference did not change
}
}
if(Configuration.asynchronousMode && !Configuration.interferenceIsAdditive) {
testForInterference();
}
... |
ae9c959f-352e-48a7-83ac-376e6c800820 | 5 | public void keyPressed(KeyEvent e){
if (e.getKeyChar() >= '0' && e.getKeyChar() <= '9'){
if (answerLabel.getText() != ""){
answerLabel.setText(answerLabel.getText() + String.valueOf(e.getKeyChar()));
}
else{
answerLabel.setText(String.valueOf(e.getKeyChar()));
}
if(Integer.valueOf(answe... |
26a233d1-40c9-4a07-902f-ae93222a770d | 7 | @Override
public Success<Expression> parse(String s, int p) {
// Parse the '{'.
if (s.charAt(p++) != '{')
return null;
p = optWS(s, p);
// Handle empty sequences.
if (s.charAt(p) == '}')
return new Success<Expression>(new LiteralSequence(Expression.NO... |
cd6f70c2-0c22-44c2-b0b1-57ab15645f71 | 0 | public String getGame() {
return game;
} |
9085f82d-b902-4fcc-a71e-0fa6026a0486 | 1 | public void setRemoteTarget(String remoteIP, int targetPacketRate) {
try {
ipAddr = InetAddress.getByName(remoteIP);
packetRate = targetPacketRate;
} catch (Exception e) {
System.out.println(e.toString());
}
} |
7b237242-cd7f-4530-b5a4-2dac888872e0 | 4 | private String createPlayersJson(List<OfflinePlayer> players) {
StringBuilder json = new StringBuilder();
json.append("[");
for (OfflinePlayer player : players) {
if (player instanceof Player) {
json.append(createPlayerJson((Player)player)).append(",");
} else if (!player.isOnline()) {
json... |
d6cbdc63-26be-41c8-9bfd-8f8b957e6bc3 | 9 | public void testMetaVariables() {
System.out.println();
String[] testStrings =
{ ":X", ":XX", ":X-X", ":ABC-234", ":ABC-ABC", ":UIO-123-UIO", ":a"};
String[] testsThatShouldFail = { ":-", "::234", "", "XX", "qawerpiouasdf", "::",
"::X", ":1", ":.", ":@", ":!", ":234a2354dsf", ":234-ABC", "::23... |
f6d50b04-f97e-4a8c-b7b9-ea9619d78ffd | 6 | public DiceTaskXmlDriver(String xmlStr) throws DocumentException,
XmlTypeErrorException {
super();
if (!isDiceTaskXml(xmlStr)) {
throw new XmlTypeErrorException("not a valid diceTask Xml");
}
document = DocumentHelper.parseText(xmlStr);
timestamp = documen... |
d9f1e9bd-8e5e-4890-9c9d-a834cc538dc0 | 5 | @Override
public void addRecord( BiffRec rec, int[] rc )
{
// check to see if there is a BiffRec already at the address add the rec to the Cell,
// set as value if it's a val type rec
rec.setSheet( this );// create a new BiffRec if none exists
rec.setRowCol( rc );
rec.setIsValueForCell( true );
rec.setSt... |
3c401537-af73-48ff-bd09-0aeb704efb44 | 3 | public Dimension getPreferredSize()
{
int x = 0, y = 0;
for (int i = 0; i < zelements.size(); i++) {
x = getElement(i).getX() + getElement(i).getWidth() > x ? getElement(
i).getX()
+ getElement(i).getWidth()
: x;
y =... |
0e67a34c-0a8c-4bec-bb0c-3cc2d07c0f68 | 7 | private String addContent(String content, boolean isHtml,
String nodeContent, boolean isHtmlNode) {
if (isHtml) {
final String start[] = BODY_END.split(content, -2);
content = start[0];
if (!isHtmlNode) {
final String end[] = BODY... |
6df6f302-0950-4002-90fd-1c7a762ee621 | 9 | void compress(int init_bits, OutputStream outs) throws IOException {
int fcode;
int i /* = 0 */;
int c;
int ent;
int disp;
int hsize_reg;
int hshift;
// Set up the globals: g_init_bits - initial number of bits
... |
62bcd007-9552-468d-a165-5ecb9ae861be | 6 | private void kasitteleSeuraava()
throws IllegalStateException, IllegalArgumentException {
if (seuraavanaLuku()) {
kasitteleLuku();
} else if (seuraavanaNegatiiviMiinus()) {
kasitteleNegatiiviMiinus();
} else if (seuraavanaLaskutoimitus()){
... |
900b9d3c-9117-48af-a5c0-4bb2f277e35d | 2 | private void declareFrameTypes(final int n, final Object[] o) {
for (int i = 0; i < n; ++i) {
if (o[i] instanceof Label) {
declareLabel((Label) o[i]);
}
}
} |
da65e449-822b-45f4-8f37-a8fc535f5236 | 0 | public AbstractOutlinerMenuItem() {
} |
6a7c9854-8a16-444d-a33e-e54b054b5a91 | 0 | public void setRegion(String region) {
this.region = region;
} |
37d71e05-6e0f-45af-97c4-cb18cb92b1e4 | 8 | public void paint( Graphics graphics )
{
Dimension size = size();
graphics.setColor( getBackground() );
switch ( type )
{
case SOLID:
graphics.setColor( getForeground() );
for ( int i = 0; i < thickness; ++i )
graphics.drawRect(
i, i, size.width - i * 2 - 1, size.height - i * 2 - 1 );
... |
ac1d9082-60df-4fe8-abc3-fcab1b634cb8 | 5 | public static void ReadFromFile(String fileName){
BufferedReader br = null;
try{
br = new BufferedReader(new FileReader(fileName));
String line = null;
while((line = br.readLine()) != null){
HashMap<Integer, ArrayList<Double>> geneEntry = new Ha... |
f33221cb-05d6-4422-908f-0a09feb53598 | 5 | public int untransform(int info){
if(info==InteractivePanel.UP)
return properties.getUpCtrl();
else if(info==InteractivePanel.LEFT)
return properties.getLeftCtrl();
else if(info==InteractivePanel.RIGHT)
return properties.getRightCtrl();
else if(info==InteractivePanel.SHOOT)
return properties.getShoo... |
c3bfc033-28cd-4860-a69a-6fe5d541bbcc | 2 | public void setTableModel(TableModel tableModel)
{
if (this.tableModel != null)
{
this.tableModel.removeTableModelListener(tableModelListener);
}
this.tableModel = tableModel;
if (this.tableModel != null)
{
this.tableModel.addTableModelListener(tableModelListener);
}
clearSortingState();
fire... |
329298e9-78bf-4178-9a43-7d083bebb27f | 2 | public void loadPropertiesFromFile(File fileName) throws IOException {
FileInputStream in = new FileInputStream(fileName);
Properties properties = new Properties();
properties.loadFromXML(in);
int x1 =(new Integer(properties.getProperty("x1")));
int y1 =(new Integer(properties.g... |
f88ab090-071b-486e-ad56-fc0600c8dcb5 | 6 | public void initialisation(final int[][] keysTable) throws KeyTableSizeException, KeyValueException {
if (keysTable.length != xSize || keysTable[0].length != ySize) {
throw new KeyTableSizeException();
} else {
for (int i = 0; i < xSize; ++i) {
for (int j = 0; j < ySize; ++j) {
switch (keysTable[i][j... |
caa3ccc4-a08d-4450-ac66-283ad626dcf1 | 7 | * @return boolean
*/
public static boolean trueP(Proposition self) {
{ TruthValue truthvalue = ((TruthValue)(Stella_Object.accessInContext(self.truthValue, self.homeContext, false)));
if (truthvalue == Logic.TRUE_TRUTH_VALUE) {
return (true);
}
else if (truthvalue == Logic.DEFAULT_TR... |
83924542-d224-4f64-b31e-b33a6b4c34fa | 3 | private boolean isFriendOrSelf(String name) {
if (name == null) {
return false;
}
for (int i = 0; i < friendsCount; i++) {
if (name.equalsIgnoreCase(friendsNames[i])) {
return true;
}
}
return name.equalsIgnoreCase(Client.myPlay... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.