text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void moveCell(int aFromIndex, int aToIndex)
{
if (aFromIndex < aToIndex)
aToIndex --;
if ( aFromIndex >= 0 && aFromIndex < cellList.size()
&& aToIndex >= 0 && aToIndex < cellList.size() )
{
// swap
AnimationCell cell = cellL... | 7 |
public void fillIndexes(String... indexes) {
if (indexes == null || indexes.length > MAX_IDX) {
throw new IllegalArgumentException("Indexes are incorrect");
}
for (int i = 0; i < indexes.length; i++) {
switch (i) {
case IDX_1:
index1 = ... | 8 |
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerCommand(PlayerCommandPreprocessEvent e){
Player player = e.getPlayer();
String[] args = e.getMessage().split(" ");
if(e.getMessage().equalsIgnoreCase("/oitc")) return;
if(e.getMessage().equalsIgnoreCase("/oitc help")) return;
if(e.getMessage(... | 7 |
public FlowNetwork(int V) {
this.V = V;
adj = (Bag<FlowEdge>[]) new Bag[V];
for (int v = 0; v < V; v++)
adj[v] = new Bag<FlowEdge>();
} | 1 |
public void sendGamestate(int turnNumber, int dimension, String mapData[][],
AIConnection playerlist[]){
JSONObject root = new JSONObject();
try {
root.put("message", "gamestate");
root.put("turn", turnNumber);
JSONArray players = new JSONArray();
for(AIConnection ai: playerlist){
... | 4 |
public DragonBaneSword(){
this.name = Constants.DRAGONBANE_SWORD;
this.attackScore = 15;
this.attackSpeed = 10;
this.money = 789;
} | 0 |
public boolean attack(Unit enemy)
{
//this != enemy: this cannot be enemy if different teams, should be redundant check
if(canAttack(enemy))
{
int expGain = Calculator.expGain(lv, enemy.getLV());
int tDmg = Calculator.dmgAmt(atk + wepATK(), enemy.getDEF()) * 0;
... | 1 |
public double[][] rankedAttributes ()
throws Exception {
int i, j;
if (m_attributeList == null || m_attributeMerit == null) {
throw new Exception("Search must be performed before a ranked "
+ "attribute list can be obtained");
}
int[] ranked = Utils.sort(m_attrib... | 7 |
public void parseAndExecute(String[] args) {
initOptions(options);
// create the parser
CommandLineParser parser = new GnuParser();
try {
// parse the command line arguments
CommandLine line = parser.parse(options, args);
parse(line);
}
... | 2 |
public void paint1(Graphics g) {
// g.drawImage(fondo.getImage(), 0, 0,1300,700, this);
g.setFont(new Font("default", Font.BOLD, 16));
g.setColor(Color.white);
if (vidas > 0) {
if (bola != null) {
g.drawImage(fondo, 0, 0, 1024, 640, this)... | 9 |
public static void main(String[] args) {
boolean l = false; //left right disabled by default. If enabled, even => right handed | odd => left handed
int numPhilosophers = 4; // also the number of forks
int numCycles = 10; //num think/eat cycles
long thinkTime = 0; // milliseconds
... | 7 |
private double getExchangeRateFromDB(Currency toCurrency, Currency fromCurrency, Connection connection, Date date) {
try {
String query = "select cambio from historico_cambios "
+ "where divisa_desde='" + fromCurrency.getCode() + "' and divisa_a='" + toCurrency.getCode() + "'";
... | 2 |
public Rectangular(int length, int width) {
this.length = length;
this.width = width;
} | 0 |
public boolean deleteElementField(ElementField element) {
if (element instanceof Ball) {
return _balls.remove((Ball) element);
} else if (element instanceof DestructibleBrick) {
return _dBricks.remove((DestructibleBrick) element);
} else if (element instanceof BoundaryFie... | 6 |
private void initSearch()
{
for (Map.Entry<String, String> entry: conditions.entrySet())
{
ArrayList<Long> conditionIds = generateIdsForCondition(entry.getKey(), entry.getValue());
intersect(conditionIds);
}
} | 1 |
void rehash() {
int oldCapacity = table.length;
Entry oldMap[] = table;
int i;
for (i = oldCapacity; --i >= 0;) {
Entry e, next, prev;
for (prev = null, e = oldMap[i]; e != null; e = next) {
next = e.next;
Object obj = e.ref.get();... | 9 |
public Object[][] readExcel(String fileName, String sheetNumber) throws IOException {
Object[][] data = null;
FileInputStream file = new FileInputStream(new File(fileName));
HSSFWorkbook workbook = new HSSFWorkbook(file);
HSSFSheet sheet = workbook.getSheet(sheetNumber);
HSSFRow row = sheet.getRow(0);
... | 5 |
public Rectangle( int h, int w, int t, int l) {
height = h;
width = w;
top = t;
left = l;
} | 0 |
public File getImage() {
return image;
} | 0 |
public final int getPort() {
return _port;
} | 0 |
@Override
public ArrayList<Excel> getColoredExes() {
return coloredEx;
} | 0 |
public static Set<String> getDomainSet()
{
return config.keySet();
} | 0 |
public Value newValue(final Type type) {
if (type == null) {
return BasicValue.UNINITIALIZED_VALUE;
}
boolean isArray = type.getSort() == Type.ARRAY;
if (isArray) {
switch (type.getElementType().getSort()) {
case Type.BOOLEAN:
case... | 9 |
public static boolean isdni(String dni){
boolean aux=false;
if(dni.length()!=9){//tiene que tener 9 caracteres
aux=false;
}else if((dni.charAt(dni.length()-1))>90 ||(dni.charAt(dni.length()-1))<65){//mirar si el ultimo es letra
aux=false;
}else{//mirar que los 8 primeros sean numeros
int i=0;
do... | 6 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public WordReader(String dictPath) {
super();
loadDict(dictPath);
} | 0 |
private Faction buildFactionFromXML(StringBuffer buf, String factionID)
{
final Faction F=(Faction)CMClass.getCommon("DefaultFaction");
F.initializeFaction(buf,factionID);
for(final Enumeration<FRange> e=F.ranges();e.hasMoreElements();)
{
final Faction.FRange FR=e.nextElement();
final String CodeName=(FR... | 7 |
public static ArrayList<ItemSet<String>> readFile(String filename) throws IOException
{
BufferedReader reader=new BufferedReader(new FileReader(new File(filename)));
ArrayList<String> attributeNames=new ArrayList<String>();
ArrayList<ItemSet<String>> itemSets=new ArrayList<ItemSet<String>>();
String line=reade... | 7 |
@Override
public Element generateDataElement(LauncherAction action) {
JavaAppDesc desc = (JavaAppDesc)action.getLaunchDesc();
org.w3c.dom.Element e = createInitialElement(desc);
//check to see if we used an AppDescURL
if(desc.getAppDescURL() != null) {
e.se... | 9 |
public Image loadImage (String file) // this method reads and loads the image
{
try
{
InputStream m = this.getClass().getResourceAsStream(file);
return (ImageIO.read (m));
}
catch (IOException e)
{
System.out.println ("Error: File " + f... | 1 |
private boolean open() {
boolean result = false;
if (!isValid()) {
try {
Class.forName("com.mysql.jdbc.Driver");
this.connection = DriverManager.getConnection(this.url, this.user, this.password);
if (isValid())
if (isDBExisted() || createDB())
if (isTableExisted() || createTable())
... | 7 |
public ControlPanel(ConfigurationController controller) {
this.controller = controller;
initView();
} | 0 |
@Override
public Usuario ListById(int id_usuario) {
Connection conn = null;
PreparedStatement pstm = null;
ResultSet rs = null;
Usuario u = new Usuario();
try{
conn = ConnectionFactory.getConnection();
pstm = conn.prepareStatement(LISTBYID);
... | 3 |
public static Test suite() {
return new TestSuite(AppTest.class);
} | 0 |
void processFile(File file){
if(file.exists() == false){
return ;
}
if(file.isDirectory()){
for(String path : file.list()){
processFile(new File(path));
}
}
else{
try {
FileInputStream fis = new FileI... | 6 |
public List<IceCream> produceAllKnownIceCream(){
List<IceCream> list = new ArrayList<IceCream>();
for(Class<? extends IceCream> ice: getAllIceCreamTypes()){
for(Taste taste: getSomeTaste()){
//IceCream ice = new IceCream(taste, type);
try {
list.add(ice.getDeclaredConstructor(Taste.class).newIns... | 9 |
@Override
public boolean equals(Object o) {
if (this.getClass() != o.getClass()){
return false;
}
PlayedNoteToken oPlayed = (PlayedNoteToken) o;
if (this.getType().equals(oPlayed.getType()) &&
this.getNumerator().equals(oPlayed.getNumerator()) &&
... | 8 |
@Override
public void actionPerformed(ActionEvent e)
{
if(e.getActionCommand().equals("Start the Match Scouting Server"))
{
//Check for Valid Data
if(wG.validData())
{
//Start the MainGUI
wG.pullThePlug();
JPanel p = new JPanel(null);
MainGUI mG = new MainGUI(p);
mG.setVisible(true);... | 6 |
public static void main(String[] args)
{
JFrame frame = new JFrame("Realms of Caelum");
Canvas canvas = new Canvas();
Dimension size = new Dimension(1280, 720); //TODO add size to settings later
canvas.setMinimumSize(size);
canvas.setMaximumSize(size);
canvas.setPreferredSize(size);
canvas.setSize(siz... | 1 |
void Statement() {
printer.startProduction("Statement");
if (la.kind == 8) {
Get();
this.generator.startIf();
Expect(9);
this.enterParenthesis(BOOLEAN);
Expr();
Expect(10);
if (this.currentType != BOOLEAN) {
// ERROR, non-boolean expression in conditional
printer.print("Error in ... | 8 |
private void btOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btOkActionPerformed
String nome = txPesqNome.getText();
ConsultaController pc
= new ConsultaController();
modelo.setNumRows(0);
for (Consulta p : pc.listByNome(nome)) {
String ... | 5 |
public void handle(Input input, Robot robot) {
// jumpForce applique pour faire sauter le personnage
float jumpForce = 50000;
if (robot.auSol()) {
if ((input.isKeyPressed(get_key()) && robot.getEnergie() > 0 && !robot
.getPlusEnergie()) || (input.isKeyPressed(get_key()))) {
if (robot.getDirectionDroi... | 8 |
private String getSelectedText(){
String text = "";
if(activField.equals("textArea"))
text = textArea.getSelectedText();
if(activField.equals("fieldNameFile"))
text = fieldNameFile.getSelectedText();
if(activField.equals("fieldCommandLine"))
text = fie... | 3 |
public static void addJarsInDir(String dirPath) {
File dir = new File(dirPath);
if (!dir.exists()) {
return;
}
File[] files = dir.listFiles();
if (files == null) {
return;
}
for (int i = 0; i < files.length; i++) {
if (files[i].... | 4 |
public static BufferedImage readImage(String remoteurl) {
BufferedImage image = null;
boolean flag = false;
long startTime = System.currentTimeMillis();
do {
try {
URLConnection connection = getURLConnection(remoteurl);
image = ImageIO.read(connection.getInputStream());
if (flag)
System.out.... | 4 |
public void printGraph(Writer w) throws Exception {
for(Entry<Value, HashSet<Value>> v : adjacencyList.entrySet()) {
Value node = v.getKey();
HashSet<Value> edges = v.getValue();
// first write the node so that nodes that have no edges
// connecting them will be ... | 2 |
public boolean esPotAfegir(CjtRestAssignatura cjtResAssig,CjtRestGrupSessio cjtResGS) {
ArrayList<Restriccio> llista = new ArrayList();
llista = cjtResAssig.getCjtRes();
int size = llista.size();
for(int i = 0; i < size; ++i){
Restriccio res = llista.get(i);
... | 9 |
public void run()
{
ServerMessage m;
try {
m = (ServerMessage) input.readObject();
String message = m.getCommand();
if(message.equals("JOIN"))
{
//Add to the list of users
this.dataAccess.join(m.getUser());
System.out.println("got join request");
}else if(message.equals("LEAVE")... | 7 |
public static String encodeFromFile(String filename)
throws java.io.IOException {
String encodedData = null;
Base64.InputStream bis = null;
try {
// Set up some useful variables
java.io.File file = new java.io.File(filename);
byte[] buffer = new byte[Math.max((int) (file.length() * 1.4 + 1),
40)... | 3 |
public boolean floorAdjacent(int x, int y) {
//this doesn't check diagonals cause it would look ugly
if (getTile(x + 1, y).isPassable()) {
return true;
}
if (getTile(x - 1, y).isPassable()) {
return true;
}
if (getTile(x, y + 1).isPassable()) {
... | 4 |
public boolean getSeenFossil() {
return this.seenFossil;
} | 0 |
public void fusionWithAdd(CPLayer fusion, CPRect rc) {
CPRect rect = new CPRect(0, 0, width, height);
rect.clip(rc);
for (int j = rect.top; j < rect.bottom; j++) {
int off = rect.left + j * width;
for (int i = rect.left; i < rect.right; i++, off++) {
int color1 = data[off];
int alpha = (color1 >>> ... | 3 |
private void addCharacter(char c) {
switch(style) {
case PLAIN_TEXT:
text = text + c;
break;
case INTEGERS:
try {
Integer.parseInt(text + c);
text = text + c;
} catch (NumberFormatException e) {}
break;
default:
break;
}
} | 3 |
private void buildAntTask(String AntDirectory, ArrayList<TDeployLine> DeployLines, Integer orgindex) {
TStringList packagexml = new TStringList();
packagexml.add("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
packagexml.add("<Package xmlns=\"http://soap.sforce.com/2006/04/metadata\">");
TStringList classesxml ... | 8 |
Destination getDefaultDestination() {
final Unit carrier = getUnit();
PathNode path = null;
// If in Europe, stay in Europe
if (carrier.getLocation() instanceof Europe) {
return new Destination();
}
// Otherwise should be on the map
if (carrier.getTi... | 8 |
public void paint(Graphics g)
{
if (bounds != null)
{
if (connectIcon != null)
{
g.drawImage(connectIcon.getImage(), bounds.x, bounds.y,
bounds.width, bounds.height, null);
}
else if (handleEnabled)
{
g.setColor(Color.BLACK);
g.draw3DRect(bounds.x, bounds.y, bounds.width - 1,
... | 3 |
@Override
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_W:
System.out.println("Move up!");
break;
case KeyEvent.VK_S:
currentSprite = characterDown;
if (robot.isJumped() == false) {
robot.setDucked(true);
robot.setSpeedX(0);
}
break;
case KeyEvent.V... | 9 |
public Graphics2D clearOffscreenAndReturn() {
Dimension d = getSize();
Graphics offG = getOffScreenGraphics();
offG.setColor(getBackground());
offG.fillRect(0, 0, d.width, d.height);
return (Graphics2D)offG;
} | 0 |
protected final void setCurrentFailure(Failure currentFailure) {
this.currentFailure.set(currentFailure);
} | 0 |
@Override
public Color colorReprisentation(int value) {
// if(colorMap.containsKey(value)){
// return colorMap.get(value);
// }
if(value == 6){
return Color.red;
}
if(value == 5){
return Color.yellow;
}
if (isTileTypeSolid(value)) {
return Color.black;
}
return Color.white;
} | 3 |
@RequestMapping(value = {"/posts"}, method = RequestMethod.GET)
public String posts(Model model, @RequestParam(required = false) String isPostCreated,
@RequestParam(required = false) String isPostUpdated,
@RequestParam(required = false) String isError) {
User... | 8 |
public static void uploadJMX() {
Thread jmxUploader = new Thread(new JMXUploader());
jmxUploader.start();
try {
jmxUploader.join();
} catch (InterruptedException ie) {
BmLog.debug("JMX Uploader was interrupted");
}
} | 1 |
public int numberOfStudents(String name) {
try{
openDatabase();
}catch(Exception e){}
String query = "SELECT COUNT(*) FROM t8005t2 .takes WHERE ID IN (SELECT ID FROM t8005t2 .modules WHERE name= '"
+ name + "')";
int count = 0;
try {
stmt = conn.createStatement();
ResultSet rs = stmt... | 4 |
public int getProperty(Ability.Property property) {
if (properties.containsKey(property)) {
return properties.get(property);
} else {
return property.getDefaultValue();
}
} | 1 |
public void run() {
while (true) {
// Bob needs his rest.
try {
Thread.sleep(sleepTime);
} catch (Exception e) {
e.printStackTrace();
}
// Bob needs info on his paddle.
int paddlePosition = paddle.getPosition()[0];
int mySize = Paddle.getSize()[0];
// Bob needs info on the ball's location.... | 4 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final OutputSpEmployeeTargetPK other = (OutputSpEmployeeTargetPK) obj;
if (!Objects.equals(this.szMonth, other.... | 4 |
public QueueSysResult calculate(int m) {
double p0 = 0.0;
double rho = lambda / mu;
double[] rho_pow = new double[N + 1];
rho_pow[0] = 1.0;
for (int i = 1; i < rho_pow.length; ++i) {
rho_pow[i] = rho_pow[i - 1] * rho;
}
double[] m_pow = new double[N ... | 5 |
private Boolean evalBracketClose(CalculatorReader expressionReader) throws BinaryOperatorException, CalculatorException {
String el = expressionReader.getSymbol();
if (el.equals(")")) {
//System.out.println("--evalBracketClose = " + el);
if (0 == expressionStack.bracketStack.size... | 3 |
public void setPrpValorTotal(Integer prpValorTotal) {
this.prpValorTotal = prpValorTotal;
} | 0 |
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
pm = Common.getPM();
//getBuses();
try {
User googler = Common.getGoogleUser();
if (googler == null)
resp.sendRedirect(Common.getGoogleLoginUrl());
else {
resp.setContentType("text/html");
PrintWriter... | 8 |
@Override
public void keyReleased(KeyEvent e) {
int keyCode = e.getKeyCode();
if (keyCode == controls.get(MappableAction.PLAYER1_UP)) {
g.firstPlayerShip.setAccelerating(false);
} else if (keyCode == controls.get(MappableAction.PLAYER1_LEFT)) {
g.firstPlayerShip.setTurningLeft(false);
} else if (keyCo... | 9 |
public static boolean delID(String c_id) {
String sql = "delete from member where id=?";
boolean flag=false;
Connection conn = null;
PreparedStatement psmt = null;
FileOutputStream fos = null;
try {
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection("jdbc:mysql://" + Server... | 9 |
public static boolean removeContactNym(String contactID,int index){
boolean status = false;
AddressBook addressBook = Helpers.getAddressBook();
if (addressBook == null) {
System.out.println("removeContactNym - addressBook returns null");
return false;
}
fo... | 5 |
private List<DBObject> ConstructFinvizObj(List<String> finvizReturn) {
LinkedList<DBObject> MongoObjList = new LinkedList<DBObject>();
int headerFlag = 0;
String[] headers = new String[]{""};
for (String finvizValues : finvizReturn){
finvizValues = finvizValues.replaceAll... | 5 |
public static String numberToString(Number number)
throws JSONException {
if (number == null) {
throw new JSONException("Null pointer");
}
testValidity(number);
// Shave off trailing zeros and decimal point, if possible.
String string = number.toString();
... | 6 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
IndexRange that = (IndexRange) o;
if (empty != that.empty) return false;
if (fromIndex != that.fromIndex) return false;
... | 6 |
public void viderListeJoueur(){
int indice=list.size();
list.clear();
fireTableRowsDeleted(0,indice-1);
//l'�criture dans le fichier
PrintWriter out=null;
try{
out=new PrintWriter(new FileWriter("Ressources/Data/score.dat"));
out.print("");
out.close();
}catch(Exception e){
JOptionPane.showMe... | 1 |
@Override
public boolean visitObject(Map<?, ?> map) {
print('{');
boolean first = true;
for (Map.Entry<?, ?> entry : map.entrySet()) {
if (ignoreNull && entry.getValue() == null) {
continue;
}
if (!first) {
print(',');
... | 8 |
@Override
public void run()
{
try
{
while(true)
{
HttpsURLConnection connection = (HttpsURLConnection)url.openConnection();
connection.setHostnameVerifier( DO_NOT_VERIFY );
SSLContext context = SSLContext.getInstance("TLS");
context.init(null, null, new java.security.SecureRandom()... | 4 |
public String selectSingleParameter(String objectName,String parameter)
{
StringBuilder sb = new StringBuilder();
Object o= list.get(objectName);
if(o!=null){
if(o.getName()[0]==parameter){
sb.append("Name- "+o.getObjectName()+" ");
if(o.getType()[... | 9 |
public void updatePotentialSolutionsBar(final List<String> answers) {
final int a = answers.size();
final String[] answersToPrint = new String[5];
for(int i = 0; i < a && i < 5; i++){
final double z = Math.random();
answersToPrint[i] = answers.get((int)(answers.size()*z));
answers.remove((int)(answer... | 7 |
public ArrayList<WorkloadJob> generateWorkload() {
if(jobs == null) {
jobs = new ArrayList<WorkloadJob>();
// create a temp array
fieldArray = new String[MAX_FIELD];
try {
if (fileName.endsWith(".gz")) {
readGZIPFile(fileName);
}
... | 5 |
@Override
public List<DataRow> select(DataRow parameters)
{
List<DataRow> wynik = new ArrayList<>();
try
{
con = DriverManager.getConnection(url, login, password);
String stm;
String tabelName = parameters.getTableName();
L... | 5 |
public void buildConnectionCSV(String outputFilename)
throws UnsupportedEncodingException, FileNotFoundException, IOException
{
String regexp =
"^\\(" +
"\\(" +
"(?:\\(\\(\\(([^ )]+)?(?: ([^ )]+))?(?: ([^ )]+))?(?: ([^ )]+))?\\)(?: ?([^ )]+)?(?: ([^ )]+))?(?: ([^ )]+))?)\\)\\) )?" +
"\\(\\(\\(([... | 8 |
public static RemoteResourcesServer newInstance(String[] args, boolean local) {
// Disable chimpchat log
java.util.logging.Logger.getLogger("com.android.chimpchat").setLevel( //$NON-NLS-1$
java.util.logging.Level.OFF);
// load configuration file
loadConfigurationFile();
// process command line arguments -... | 3 |
@Override
public void remove_child(Sentence_tree child){
Sentence_tree[] new_children = new Sentence_tree[this.children.length - 1];
int j = 0;
for(int i = 0; i < this.children.length; i++){
if(this.children[i] != child){
new_children[j] = this.children[i];
j++;
}
}
this.children = new_childre... | 2 |
private void cleanUpTable() {
for (int i = 0; i < commands.size(); ++i) {
commands.get(i).name = commands.get(i).name.toLowerCase();
if ( commands.get(i).name.isEmpty() ) {
commands.remove(i);
tableModel.removeRow(i);
--i;
}
... | 2 |
private static void clinit() {
_disabled = true;
final ArrayList<Package> list = new ArrayList<Package>();
for (final Package p : Package.getPackages())
if (p.getName().startsWith("net.minecraft.server"))
list.add(p);
if (list.size() == 1) {
_minecraft = list.get(0).getName();
... | 5 |
@After
public void dbRestore(){
Main.clearTable();
int c=0;
for (Item i : originalItemList){
i.setQuantity(quantityList.get(c));
Main.modifyItem(i);
c++;
}
} | 1 |
public static long getLongBE(final byte[] array, final int index, final int size) {
switch (size) {
case 0:
return 0;
case 1:
return Bytes.getInt1(array, index);
case 2:
return Bytes.getInt2BE(array, index);
case 3:
return Bytes.getInt3BE(array, index);
case 4:
return Bytes.getInt4B... | 9 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((comment == null) ? 0 : comment.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
} | 3 |
private void loadRoads() {
File file = null;
for (int i = 0; i < listOfFiles.length; i++) {
if (listOfFiles[i].getName().equals("roadID-roadInfo.tab")) {
file = listOfFiles[i];
break;
}
}
try {
Scanner sc = new Scanner(file);
sc.nextLine();
while (sc.hasNextLine()) {
String line = sc... | 4 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final TMasterSalesman other = (TMasterSalesman) obj;
if (!Objects.equals(this.salesIdScy, other.salesIdScy)) {
... | 3 |
private String getToolTipText(Component component,
ComponentAdapter adapter) {
if ((stringValues == null) || stringValues.isEmpty()) {
return null;
}
String text = "";
for (int i = 0; i < stringValues.size(); i++) {
int mode... | 7 |
@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 Question)) {
return false;
}
Question other = (Question) object;
if ((this.idQuestion == null && other.idQuesti... | 5 |
public void checkTripleBuffer()
{
mxRectangle bounds = graph.getGraphBounds();
int width = (int) Math.ceil(bounds.getX() + bounds.getWidth() + 2);
int height = (int) Math.ceil(bounds.getY() + bounds.getHeight() + 2);
if (tripleBuffer != null)
{
if (tripleBuffer.getWidth() != width
|| tripleBuffer.ge... | 4 |
double getIntegralValue(Range boundaries) {
List<Range> valueRanges = new ArrayList<Range>();
for (Range range : ranges) {
if (range.includes(boundaries.getLeft())
|| range.includes(boundaries.getRight())
|| boundaries.includes(range.getLeft())
|| boundaries.includes(range.getRight()))
{
... | 8 |
public FooObject(String name, int id, long age, FooObject friend) {
this.name = name;
this.id = id;
this.age = age;
this.friend = friend;
} | 0 |
public int getBlackjackValue() {
int val; // The value computed for the hand.
boolean ace; // This will be set to true if the
// hand contains an ace.
int cards; // Number of cards in the hand.
val = 0;
ace = false;
cards = getCardCount();... | 5 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
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.