text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void basicSetCardio(Cardio myCardio) {
if (this.cardio != myCardio) {
if (myCardio != null) {
if (this.cardio != myCardio) {
Cardio oldcardio = this.cardio;
this.cardio = myCardio;
if (oldcardio != null)
oldcardio.unsetWorkout();
}
}
}
} | 4 |
public void setURI(String value) {
this.uri = value;
} | 0 |
public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
... | 7 |
protected void setTeamRep() {
User[] userArray = null;
String[][] teamMember = debateSelected.getTeam();
int teamNub = 0, teamNub2 = 0;
for (int i = 0; i < teamMember.length; i++) {
for (int j = 0; j < teamMember[i].length; j++) {
if (teamMember[i][j].equals(userLogin.getName())) {
teamNub = i;
... | 7 |
public int[] update() {
int[] pos = new int[6];
if(oldx != -1) {pos[0] = Math.round(oldx); oldx = -1;}
else {pos[0] = Math.round(x);}
if(oldy != -1) {pos[1] = Math.round(oldy); oldy = -1;}
else {pos[1] = Math.round(y);}
timePassed = System.currentTimeMillis() - lastUpdate;
... | 2 |
public static Boolean locationEqualsXYZW(Location l, Integer x, Integer y, Integer z,String w) {
if(l.getX() == x && l.getY() == y && l.getZ() == z && l.getWorld().getName() == w) return true;
return false;
} | 4 |
private void loadPreviousFonts() {
this.previousFonts = new ArrayList<Font>();
for (int i = this.startFrom; i <= this.endAt; i++) {
this.previousFonts
.add(this.document.getChildren().get(i).getFont());
}
} | 1 |
private static void read(String filePath) {
Scanner s = null;
double[] maxima = null;
boolean isMax = false;
double[][] table = null;
boolean[] onlyPositive = null;
BufferedReader in;
try {
int cols;
int rows;
in = new BufferedReader(new FileReader(filePath));
int correction = getCorrectio... | 9 |
private void acao141(Token token) throws SemanticError {
try{
idAtual = tabela.get(token.getLexeme(), nivelAtual);
if (idAtual instanceof IdentificadorVariavelCampoRegistro) {
if (regAtual.getListaCampos().contains(idAtual)) {
tipoLadoEsquerdo = ((IdentificadorVariavel) idAtual).getTipo();
} else {
... | 3 |
@Override
public Component getListCellRendererComponent(
JList<? extends State> list,
State value,
int index,
boolean isSelected,
boolean cellHasFocus) {
State state = value;
this.setFont(fFont);
... | 6 |
void testHyperlinks()
{
WorkBookHandle tbo = new WorkBookHandle();
String sheetname = "Sheet1";
WorkSheetHandle sheet1 = null;
try
{
sheet1 = tbo.getWorkSheet( sheetname );
}
catch( WorkSheetNotFoundException e )
{
System.out.println( "couldn't find worksheet" + e );
}
try
{
tbo.copyWo... | 5 |
public ArrayList<String> getNeighbours()
{
ArrayList<String> neighbours = new ArrayList<String>();
for (Edge e : this.startingEdges)
{
neighbours.add(e.getDestination().getName());
}
return neighbours;
} | 1 |
public static byte[] hash(byte[] data) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.update(data);
return md.digest();
} | 0 |
public void write(OutputStream os, int tempo, int sps) throws IOException
{
int ndur = (int) ((60.0 / (double) tempo) * sps * beats);
if (name == ' ')
{
for (int x = 0; x < ndur; x++)
os.write(0);
return;
}
String noteName = String.format("%c%c%s",scale < 10 ? scale + '0' : scale,name,sharp ? "#" :... | 7 |
public static String getBanReason(String playerName){
String reason = "Not Banned";
if(isBanned(playerName)){
try {
SQL_STATEMENT = SQL_CONNECTION.createStatement();
SQL_RESULTSET = SQL_STATEMENT.executeQuery("SELECT * FROM bans WHERE username='" + playerName + "'");
// This loop che... | 4 |
private void jbtnCreerThemeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnCreerThemeActionPerformed
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
} catch (ClassNotFoundException ex) {
JOptionPane.showMessageDialog(this, "Driver non t... | 8 |
final public Column Column() throws ParseException {
String name1 = null;
String name2 = null;
String name3 = null;
// [schema.][tabella.]colonna
name1 = RelObjectName();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 93:
jj_consume_token(93);
name2 = RelObjectName(... | 7 |
public static BufferedImage toBufferedImage(Image image) {
if (image instanceof BufferedImage) {
return (BufferedImage) image;
}
// This code ensures that all the pixels in the image are loaded
image = new ImageIcon(image).getImage();
// Determine if the image has transparent pixels; for this method's
... | 5 |
@Override
public boolean supports(Class<?> arg0) {
return Image.class.equals(arg0);
} | 1 |
public boolean isIon()
{
for(int i = 0; i < ions.length; i++)
if(this.equals(new MiniCompound(ions[i])))
return true;
return false;
} | 2 |
public void paintComponent(Graphics g){
if (mapDrawer != null){
if (mapImage == null ||
this.getWidth() != mapImage.getWidth(this) ||
this.getHeight() != mapImage.getHeight(this) ||
this.repaintMap){
mapImage = new Buffer... | 7 |
public PercSerializationInstantiator(Class type) {
// Find the first unserializable parent class
Class unserializableType = type;
while(Serializable.class.isAssignableFrom(unserializableType)) {
unserializableType = unserializableType.getSuperclass();
}
try {
// Get th... | 5 |
@Test
public void testLipidPercentage() {
MealRepartition mr = new MealRepartition();
try {
mr.setLipidPercentage(0.34);
fail("A BadLipidPercentageException should have been thrown.");
} catch (BadLipidPercentageException e) {}
try {
mr.setLipidPercentage(0.41);
fail("A BadLipidPercentageException ... | 3 |
public Loc<T> location(final Path... path) {
Loc<T> l = this.root();
for (Path p : path) {
switch (p) {
case DOWN: l = l.down(); break;
case LEFT: l = l.left(); break;
case RIGHT: l = l.right(); break;
case UP: l = l.up(); break;
case LEFT_MOST: l = l.leftMost(); break;
... | 8 |
public PartialMessage read(PartialMessage read) {
try {
int buffLength = 4096 * 2;
int len = 0;
byte[] b = new byte[buffLength];
//rawIn is a Socket.getInputStream();
while(!this.socket.isClosed()){ //Read the first two bytes of the message, the frame type byte - and the payload len... | 5 |
public static void javaOutputForeach(Cons loop) {
{ Stella_Object continuationtest = loop.rest.value;
Cons valueassignments = ((Cons)(loop.rest.rest.value));
Cons nextassignments = ((Cons)(loop.fourth()));
int nofnextassignments = nextassignments.length();
Cons body = ((Cons)(loop.fifth()));... | 8 |
private void reDrawList(int x, int y)
{
if(type == 0)
{
//Initialize head
if(head == null)
{
if(myInfo.getHead() != null)
head = new linkedButton(myInfo.getHead(),null);
tail = head;
}
//Inserts new buttons if nesscessary
if(head != null && tail.getInfo() != myInfo.getTail())
{
... | 8 |
public static List<String> getClassNamesFromPackage(String packageName, ClassLoader classLoader) throws IOException {
URL packageURL;
ArrayList<String> names = new ArrayList<>();
packageName = packageName.replace(".", "/");
packageURL = classLoader.getResource(packageName);
if(... | 9 |
public void unreadFrame() throws BitstreamException
{
if (wordpointer==-1 && bitindex==-1 && (framesize>0))
{
try
{
source.unread(frame_bytes, 0, framesize);
}
catch (IOException ex)
{
throw newBitstreamException(STREAM_ERROR);
}
}
} | 4 |
private void jButtonParcourirINActionPerformed(
final java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
final String mss = "Bouton Parcourir : "
+ "action interdite car";
final int nb = 300;
switch (etat) {
case INIT_JSON_XML:
selct = new SelecteurDeFichier(jsonFilter, this);
... | 7 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final User other = (User) obj;
if (!Objects.equals(this.username, other.username)) {
return false;
... | 4 |
public static void lagKompaktGrid(Container parent, int rows, int cols, int initialX, int initialY, int xPad, int yPad) {
SpringLayout layout;
try {
layout = (SpringLayout) parent.getLayout();
} catch (ClassCastException exc) {
System.err.println("The first argument to la... | 7 |
private static double[][] generateIdentity(int l){
double[][] T = new double[l][l];
for(int i = 0; i<l; i++){
for(int j = 0; j<l; j++){
if(i == j)
T[i][j] = 1;
else
T[i][j] = 0;
}
}
return T;
} //end generateIdentity | 3 |
public static void copyTo(File file, String filePath)
{
System.out.println("Copying file "+file.getAbsolutePath()+ " to "+filePath);
//System.exit(0);
try
{
int b;
inputStream = new FileInputStream(file);
outputStream = new FileOutputStream(filePa... | 4 |
public static double findAccuracy(Set<RepairedCell> truth, Set<RepairedCell> found){
if(found.size()!=0){
HashMap<Integer,HashSet<String>> truthMap = new HashMap<Integer,HashSet<String>>();
for(RepairedCell cell:truth){
HashSet<String> columnIds = null;
if(truthMap.get(cell.getRowId())==null){
colu... | 6 |
private void testReferrers(String[] referrerStrings, Application expectedApplication) {
for (String agentString : referrerStrings) {
assertEquals(expectedApplication, Application.parseReferrerString(agentString));
}
} | 1 |
public boolean equalsExpr(final Expr other) {
return (other != null) && (other instanceof ArithExpr)
&& (((ArithExpr) other).operation == operation)
&& ((ArithExpr) other).left.equalsExpr(left)
&& ((ArithExpr) other).right.equalsExpr(right);
} | 4 |
@EventHandler
public void onClick(InventoryClickEvent event) {
if (event.getSlot() == 999)
event.getWhoClicked().closeInventory();
for (Inventory inv : ClashOfBlocks.getInstance().getInventoryManager().getInventories()) {
if (inv == null) break;
if (inv.isInventory(event.getInventory())) {
event.setCa... | 7 |
public void draw(Graphics2D g) {
for (Entity entity : entities) {
entity.draw(g);
}
super.draw(g);
} | 1 |
public void create() throws IrodsException {
try {
JargonCollection parent = getParentCollection();
if (parent != null && !parent.exists()) {
parent.create();
}
conn.irodsFileSystem.mkdir(irodsFile, false);
} catch (JargonException ex) {
throw new IrodsException(ex);
}
} | 3 |
@Override
public String send(String msg) throws ConnectionException {
FileReader fileReader = null;
//DatagramSocket socket = null;
Socket socket = null;
String output = null;
try {
String serverString = "";
String portString = "";
fileRead... | 5 |
public static String readPassword(String pPrompt){
if(System.console() == null) {
//Hack for JDev debugging as it doesn't provide a console when running
if("DEV".equals(ScriptRunnerVersion.getVersionNumber())){
return readArg(pPrompt, false);
}
throw new ExFatalError("Could not locat... | 4 |
public final void setMaxMeasuredValueDecimals(final int MAX_MEASURED_VALUE_DECIMALS) {
final int DECIMALS = MAX_MEASURED_VALUE_DECIMALS > 5 ? 5 : (MAX_MEASURED_VALUE_DECIMALS < 0 ? 0 : MAX_MEASURED_VALUE_DECIMALS);
if (null == maxMeasuredValueDecimals) {
_maxMeasuredValueDecimals = MAX_MEASU... | 3 |
public String getResultRunCompiledPHPCode(String fileSource)
{
if(cekAnnotation(fileSource))
{
return getFilteredPHPSource(fileSource) + " $ob = new " + getClassName(getFilteredPHPSource(fileSource)) + ";$ob -> "
+ getMethodName(getAnnotationClientMethod(fileSource));... | 1 |
public boolean matches( Class<?> clazz )
{
return Modifier.isInterface( clazz.getModifiers() ) && !clazz.isAnnotation();
} | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
User other = (User) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
retur... | 6 |
public void mouseExited(MouseEvent e) {
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
} | 0 |
public void distributeWithOrders() {
logger.info("Starting distributing...");
do {
// 1. get all orders from the container
List<Order> orderList = null;
try {
orderList = sharedWorkspace.getUnfinishedOrders();
// add marked "order" to the end of the order list
// if the for loop reaches this "o... | 9 |
public void init() {
System.out.println("###### Applet init() #######");
started = false;
stopping = false;
currentDisk = null;
if (cpu == null) {
SIDMixer.DL_BUFFER_SIZE = 16384;
System.out.println("starting CPU");
cpu = new CPU(imon, getCodeBase().toString(), new SELoader());
... | 7 |
public long duration() {
return (now()-startTime);
} | 0 |
public void collides(GameObject source, Collection<GameObject> objects){
for(GameObject object : objects){
if(source.collidesWith(object)){
gameEventListener.handleGameEvent(new CollisionEvent(this, Type.COLLISION, source, object));
}
}
} | 2 |
public void createNodesForThisGraph()
{
int paperListLength = Array.getLength(paperList);
System.out.println("NODES CREATION,paperlist hossza: " + paperListLength);
//here we set the attributes for each node from the paperlist
for (int i = 0;i < 3;i++)
{
try
... | 4 |
private void generateAllDeploymentAlternatives() {
if (project.getDeploymentAlternatives().size() == 0) {
List<HardwareSet> sequenceHardwareSets = new LinkedList<>();
int hardwarePossibilities[] = new int[project.getComponents().size()];
int repetitions[] = new int[project.getComponents().size()];
int k =... | 5 |
public static void main(String[] args)
{
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e)
{
e.printStackTra... | 1 |
public static void checkQuizTakingAchievements(String username, int percent, int quizId, int elapsed) {
List<Score> quizzes = UserInfo.getHistory(username);
List<Integer> achs = UserInfo.getAchievements(username);
List<Score> top = UserInfo.getTopTen(quizId);
if (quizzes.size() >= QUIZ_MACHINE_VALUE && !achs.co... | 9 |
public void removeFileDownloadItem(FileDownloadItem item){
items.remove(item);
} | 0 |
public void combineFilterSummaries(String folder){
File Folder = new File(folder);
Map<Integer,File> M = new HashMap<>();
General g = new General();
ArrayList<Integer> thresholds = new ArrayList<>();
// first create a map of all files and thresholds found in this folder
... | 7 |
public Object getValueAt(int row, int col) {
if (data == null) {
return null;
}
if (row < 0 || col < 0) {
return null;
}
return data[row][col];
} | 3 |
public static void main(String[] args) {
int[] rat = { 2, 1, 3 };
int[] avg = { 1, 2, 3 };
double[][] cov = new double[3][3];
int row = 0;
for (int i = 0; i < 3; i++) {
int col = 0;
for (int j = 0; j < 3; j++) {
if (i <= j) {
double numerator = 0.0;
System.out.println("numerator = (" + r... | 7 |
public int canCompleteCircuit(int[] gas, int[] cost) {
int i = 0,len = gas.length;
if(gas == null || cost == null || len < 0)
return -1;
for(i = 0; i< len; i++){
int k = i;
int myGas = 0;
int j = 0;
for(;j < len;j++)
{
//from i to i;
myGas += gas[k];
if(myGas < cost[k])
break;
... | 8 |
private ClosureTaker() {
} | 0 |
public void addProperty() {
DatastoreService datastore = DatastoreServiceFactory
.getDatastoreService();
Entity past_string = null;
try {
Key key = KeyFactory.createKey("past_string", "onlyOne");
past_string = datastore.get(key);
} catch (Throwable t) {
}
past_string.setProperty("past_update", new... | 2 |
protected void onSetChannelLimit(String channel, String sourceNick, String sourceLogin, String sourceHostname, int limit) {} | 0 |
public LoadFileProtocolClassCommand(String name) {
super(name);
} | 0 |
public void writeLine(String line) {
try {
BufferedWriter CSVFile = new BufferedWriter(new FileWriter(fileName));
CSVFile.write(line);
CSVFile.newLine();
CSVFile.close();
} catch (IOException ex) {
System.out.println(ex);
}
... | 1 |
private Path handleImage(Path img, int resnumber) {
assert FileUtil.control(img) && (resnumber > 0);
Path ret = null;
if (FileUtil.control(img)) {
try {
ret = Bitmap.convertToBMP(img, this.imageDir, "" + resnumber);
if (!img.getFileName().toString().e... | 4 |
private String readField(Field field) {
try {
Class<?> type = field.getType();
if (type.equals(int.class))
return String.valueOf(field.getInt(this));
else if (type.equals(boolean.class))
return String.valueOf(field.getBoolean(this));
else if (type.equals(double.class))
return String.valueOf(... | 6 |
public final void quant(final float[] lsp,
final float[] qlsp,
final int order,
final Bits bits)
{
int i;
float tmp1, tmp2;
int id;
float[] quant_weight = new float[MAX_LSP_SIZE];
for (i = 0; i < order; i++)
qlsp[... | 8 |
public void check() {
RunIterator itr = iterator();
int[] curr = itr.hasNext() ? itr.next() : null;
if (curr == null)
return;
long sum = (long)curr[0];
while (itr.hasNext()) {
int[] next = itr.next();
if (curr[0] == next[0] && curr[1] == next[1] && curr[2] == next[2]
&& curr[3] == next[3]) {
... | 8 |
private void processEvents() {
while (true) {
WatchKey key;
try {
key = watcher.take();
} catch (InterruptedException x) {
logger.debug("'WatchDir' thread was interrupted!");
return;
}
Path dir = keys.get(key);
if (dir == null) {
System.err.println("WatchKey not recognized!!");
... | 9 |
public double elapsedTime() {
long now = System.currentTimeMillis();
return (now - start) / 1000.0;
} | 0 |
@Override
public int getSlotSpacingY() {
return isNotPlayerInventory() ? 0 : 18;
} | 1 |
public static String getJavaMethodParameter(Method var0) {
Class[] var1 = var0.getParameterTypes();
Class[] var2 = var0.getExceptionTypes();
String var3 = "";
String var4 = "";
for (int len = 0; len < var1.length; ++len) {
var3 += var1[len].getName() + (len == var1.le... | 5 |
public static Map<Integer, Map<String, Object>> decodeUserPositions() {
Map<Integer, Map<String, Object>> ComputationResponse = new HashMap<Integer, Map<String, Object>>();
String JSONRaw = JSONRawMain[1];
if(JSONRaw.trim().equals("false")){
Util.logC("Warning: There are no users currently online");
ret... | 5 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Color)) {
return false;
}
Color other = (Color) obj;
if (a != other.a) {
return false;
}
if (b != other.b) {
return false;
}
if (g != other.g) {... | 6 |
@Override
public String toString() {
StringBuilder s = new StringBuilder("---------------\n");
s.append("Players ("+players.size()+"):\n");
for (Player player : players) {
s.append(player.getNumber()+" "+player.getNickname()+": "+player.getPoints()+"\n");
}
s.append("\nGame state: ready "+isReady()+" run... | 8 |
public static List<Appointment> findByMonth(long uid, long month)
throws SQLException {
List<Appointment> aAppt = new ArrayList<Appointment>();
long month2 =
DateUtil.getStartOfMonth(month + 32 * DateUtil.DAY_LENGTH);
long endOfMonth = month2 - DateUtil.DAY_LENGTH;
// once
aAppt.addAll(Appointment.fin... | 0 |
public static float dayValue(World world) {
final float time = worldTime(world) ;
if (time <= morning_end ) return (time + HF) / fade ;
if (time <= evening_start) return 1 ;
if (time <= evening_end ) return (evening_end - time) / fade ;
if (time <= morning_start) return 0 ;
else ... | 4 |
private JLabel getJLabel1() {
if (jLabel1 == null) {
jLabel1 = new JLabel();
jLabel1.setText("EXECUTE SUCCESSFUL!");
}
return jLabel1;
} | 1 |
public static Color getBanding(boolean primary) {
return primary ? Color.WHITE : new Color(232, 255, 232);
} | 1 |
@Test
public void out_a_car_when_it_parking_second_park() {
for(int i = 0; i < 5; i ++) {
parkBoy.in(new Car(String.valueOf(i)));
}
Car car = new Car();
Ticket ticket = parkBoy.in(car);
Assert.assertEquals(parkBoy.getParkSize(1), this.SECOND_PARK_SIZE - 1);
... | 1 |
public boolean checkObjectiveType(UQuest plugin, String type) {
for(Objective objective : this.objectives){
if(objective.getType() == type)
return true;
}
return false;
} | 2 |
public static void menu_Eventos() {
do {
System.out.println("********************************************");
System.out.println("* Menu Eventos *");
System.out.println("* *");
System.out.println(... | 9 |
protected void printTopWord(int k, String topWordFile) {
System.out.println("TopWord FilePath:" + topWordFile);
Arrays.fill(m_sstat, 0);
for (_Doc d : m_trainSet) {
for (int i = 0; i < number_of_topics; i++)
m_sstat[i] += m_logSpace ? Math.exp(d.m_topics[i])
: d.m_topics[i];
}
Utils.L1Normalizat... | 8 |
private void drawMap(GameMap map) throws GLException {
gl.glPushMatrix();
//gl.glTranslatef(-map.getHeight() / 2, -map.getWidth() / 2, 0.0f);
if (vViewChange == null) {
vViewChange = Vector.O;
gs.cnt = vViewChange;
}
for (int i = 0; i < map.getHeight(); i+... | 9 |
public static GeneralValidator isLessEqualsToThan() {
return LESS_THAN_EQUALS_TO_VALIDATOR;
} | 0 |
public Location getAdjacentLocation(int direction) {
// reduce mod 360 and round to closest multiple of 45
int adjustedDirection = (direction + HALF_RIGHT / 2) % FULL_CIRCLE;
if (adjustedDirection < 0)
adjustedDirection += FULL_CIRCLE;
adjustedDirection = (adjustedDirection / HALF_RIGHT) * HALF_RIGHT;
int... | 9 |
public boolean contains(Point point) {
if((point.x > x && point.x < x + sprite.getWidth()) && (point.y > y && point.y < y + sprite.getHeight()))
return true;
return false;
} | 4 |
public void save() {
variable = "@Variable:" + nameField.getText() + ":";
if(stringField.isEnabled()) {
variable += stringField.getText();
} else if(intSpinner.isEnabled()) {
variable += getAdjustType() + ":" + intSpinner.getValue();
} else if(booleanBox.isEnabled()) {
variable += booleanBox.isSelected... | 4 |
public void logToFile(String msg){
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(new File(getDataFolder(),"BlacklistCheck.log"),true));
writer.write(msg);
writer.newLine();
writer.close();
}catch (java.io.IOException e) {
logMessage("Unable to write to BlacklistCheck.log: "+e.getMe... | 1 |
@Override
public boolean onCommand(final CommandSender sender, final Command cmd, final String label, final String[] args) {
String subCmd = null;
final String[] newArgs = new String[Constants.GENERAL_ARRAY_SIZE];
ProcessState state = null;
if ( args.length > 1 ) {
subCmd = args[0];
for (int i = 1;... | 8 |
public void testConstructor_int_int_int_int_int_int_int_DateTimeZone() throws Throwable {
DateTime test = new DateTime(2002, 6, 9, 2, 0, 0, 0, PARIS); // +02:00
assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
assertEquals(TEST_TIME_NOW, test.getMillis());
try {
... | 7 |
@Override
public void actionPerformed(ActionEvent ae) {
Object source = ae.getSource();
if (source == classements.getRetour() ){
this.setVisible(false);
Fenetre topFrame = (Fenetre) SwingUtilities.getWindowAncestor(this);
if (topFrame.getJeu() == null)
... | 2 |
public String getNewValue(){
return newValue.getText();
} | 0 |
private void processAttack(){
if(!(this.friendVictory)){
if (!(this.enemyVictory)){
if (jList1.getSelectedIndex() != -1){
Attack friendlyAttack = this.character.getAttacks().get(jList1.getSelectedIndex());
int friendlyDamage = this.character.getAttacks().get(jList1.ge... | 8 |
@Override
public int getHeight() { return height; } | 0 |
public void readFromNBT(NBTTagCompound nbtTagCompound) {
super.readFromNBT(nbtTagCompound);
if (nbtTagCompound.hasKey("teDirection")) {
this.orientation = ForgeDirection.getOrientation(nbtTagCompound
.getByte("teDirection"));
}
if (nbtTagCompound.hasKey("teState")) {
this.state = nbtTagCompound.get... | 4 |
private void setLocationWithTile(Tile tile, int position) {
int xLocation, yLocation;
if ( position == 1 || position == 4) {
xLocation = tile.getX()+(position == 1?Tile.IMG_WIDTH:-Tile.IMG_WIDTH);
yLocation = tile.getY();
} else {
xLocation = tile.getX()+(position == 0 || position == 2?Tile.IMG_WIDTH/2:-... | 7 |
public void ensureCapacity(int minimumCapacity)
{
int[ ] biggerArray;
if (data.length < minimumCapacity)
{
biggerArray = new int[minimumCapacity];
System.arraycopy(data, 0, biggerArray, 0, manyItems);
data = biggerArray;
}
} | 1 |
@Test
public void getChildrenIngredients_should_say_chicken_is_poultry(){
List<Ingredient> children = rep.getChildrenIngredients(poultry);
for(Ingredient ingredient : children){
if(ingredient.getName().equalsIgnoreCase("chicken")){
return;
}
}
Assert.fail();
} | 2 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.