text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void inheritAllConstructors()
throws CannotCompileException, NotFoundException
{
CtClass superclazz;
CtConstructor[] cs;
superclazz = getSuperclass();
cs = superclazz.getDeclaredConstructors();
int n = 0;
for (int i = 0; i < cs.length; ++i) {
... | 3 |
public static boolean registerEvent(final IEvent event) {
if(!eventMap.containsKey(event)) {
//We need to set up the Map to not bitch about things
HashSet<Pair<Method, EventListener>> set;
TreeMap<Priority, HashSet<Pair<Method, EventListener>>> value =
new TreeMap<Priority, HashSet<Pair<Method, EventLis... | 3 |
public void setSelectedTimezone(String timezone){
Regions selectedTimezone = Regions.valueOf(timezone);
switch (selectedTimezone){
case Simplified:
updateForStandard();
break;
case All:
updateForAll();
break;
... | 9 |
public void parse(
InputStream stream, ContentHandler handler,
Metadata metadata, ParseContext context)
throws IOException, TikaException, SAXException {
// Process the file straight through once
OggFile ogg = new OggFile(stream);
// To track the streams we find
... | 8 |
public static void rename(Automaton a) {
State[] s = a.getStates();
int maxId = s.length - 1;
Set untaken = new HashSet(), reassign = new HashSet(Arrays.asList(s));
for (int i = 0; i <= maxId; i++)
untaken.add(new Integer(i));
for (int i = 0; i < s.length; i++)
if (untaken.remove(new Integer(s[i].getID(... | 4 |
public static int[] getNextPixel(int orientation_index)
{
// RSLV: find a mathematical expression for the switch statement?
int[] dp = new int[2]; // [0]=dx, [1]=dy
switch(orientation_index)
{
case 0:
dp[0] = 1;
dp[1] = 0;
break;
case 1:
dp[0] = 1;
dp[1] = 1;
break;
case 2:
... | 8 |
public boolean checkDuplicate(String checkThis, int choice) throws ClassNotFoundException, SQLException
{
String query = "";
if(choice == 0)
query = "select suppvname from supplier where suppvname='"+checkThis+"'";
else if(choice==1)//mabelle
query = "select co... | 7 |
@Override
public void mouseDragged(MouseEvent e) {
// TODO Auto-generated method stub
/*System.out.println("Mouse: (" + e.getX() + ", " + e.getY() + ")");
System.out.println("MouseOnScreen: (" + e.getXOnScreen() + ", " + e.getYOnScreen() + ")");
System.out.println("Pane: (" + this.getX() + ", " + this.getY() +... | 8 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
LinkedThread that = (LinkedThread) o;
if (id != that.id) return false;
if (headLine != null ? !headLine.equals(that.headLine) : that.headLine !... | 6 |
private boolean jj_3_6() {
if (jj_3R_24()) return true;
return false;
} | 1 |
public <T> ObjectConstructor<T> get(TypeToken<T> typeToken) {
final Type type = typeToken.getType();
final Class<? super T> rawType = typeToken.getRawType();
// first try an instance creator
@SuppressWarnings("unchecked") // types must agree
final InstanceCreator<T> typeCreator = (InstanceCreator<... | 5 |
public static Rule_EQ parse(ParserContext context)
{
context.push("EQ");
boolean parsed = true;
int s0 = context.index;
ArrayList<Rule> e0 = new ArrayList<Rule>();
Rule rule;
parsed = false;
if (!parsed)
{
{
ArrayList<Rule> e1 = new ArrayList<Rule>();
int s1 = c... | 7 |
public void update(Observable o, Object arg1) {
if (arg1 != null && arg1 instanceof String && ((String) arg1).contains("VS")) // View settings updates
{
m_frame.remove(m_centerPanel);
m_centerPanel.removeAll();
if (ViewPreferences.getInstance().getCenterView() == CenterView.WEEK)
m_centerPanel.add(m_w... | 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 |
int insertKeyRehash(float val, int index, int hash, byte state) {
// compute the double hash
final int length = _set.length;
int probe = 1 + (hash % (length - 2));
final int loopIndex = index;
int firstRemoved = -1;
/**
* Look ... | 9 |
public void setOutlinerDocument(OutlinerDocument doc) {
super.setDocument(doc);
} | 0 |
public boolean siirtoTormays(int xMuutos){
Palikka[][] pelipalikat = peli.getPalikkaTaulukko();
for (Palikka palikka : this.palikat) {
if (pelipalikat[palikka.getY()][palikka.getX()+xMuutos] != null){
return true;
}
}
return false;
} | 2 |
@Override
public void run (){
String line;
BufferedReader fromClient;
DataOutputStream toClient;
boolean verbunden = true;
System.out.println("Thread started: "+this); // Display Thread-ID
try{
fromClient = new BufferedReader // Datastream FRO... | 3 |
@Parameters({"browser"})
@Test(groups = {"newaccount"})
@BeforeClass
public void beforeClass(String browser) throws IOException, InterruptedException
{
if (browser.equals("firefox")) {
driver=browserFirefox();
}
if (browser.equals("chrome")) {
driver=browserChrome();
... | 8 |
public Bird(Vector2 position, float radius, Vector2 velocity,
float maxSpeed, Vector2 heading, float mass, Vector2 scale,
float turnRate, float maxForce, BirdMinigame minigame) {
super(position, radius, velocity, maxSpeed, heading, mass, scale, turnRate,
maxForce);
behavior = new SteeringBehavior(th... | 2 |
private void checkSymbolInRange(int symbol) {
if (symbol < 0 || symbol >= getSymbolLimit())
throw new IllegalArgumentException("Symbol out of range");
} | 2 |
public void run() {
int frames = 0;
int tickCount = 0;
double delta = 0;
double secondsPerTick = 1 / 60.0;
long lastTime = System.nanoTime();
requestFocus();
while(running) {
long now = System.nanoTime();
long elapsedTime = now - lastTime;
lastTime = now;
if (elapsedTime < 0)
e... | 7 |
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain)
throws ServletException, IOException {
HttpServletRequest request = (HttpServletRequest) req;
if (!isTokenValid(request)) {
((HttpServletResponse) resp).sendRedirect("/error.ctrl");
}
saveToken(request);
ch... | 1 |
public static boolean contains( Object[] array, Object value ) {
if( array == null || value == null )
return( false );
for( int i = 0; i < array.length; i++ ) {
if( value.equals( array[ i ] ) )
return( true );
}
return( false );
} | 4 |
private void shortLoop(Raster source,
Raster dest,
Rectangle destRect,
int incr1, int incr2, int s_x, int s_y) {
MultiPixelPackedSampleModel sourceSM =
(MultiPixelPackedSampleModel)source.getSampleModel();
Data... | 9 |
public static Connection getWDMRConnetion(final String url, final String database//
, final String user, final String password//
) {
final String connetUrl = JDBCConnector.JDBC_URI_MYSQL + url + "/" + database;
try {
Class.forName(JDBCConnector.JDBC_DRIVER_MYSQL);
Connection conn = DriverManager.getCon... | 2 |
final void method3505(boolean bool, int i, int i_84_, boolean bool_85_,
int i_86_, boolean bool_87_, int i_88_) {
if (bool_85_ != true)
((Class361) this).anInt4453 = 116;
anInt4434++;
int i_89_ = 256;
if (bool_87_)
i_89_ |= 0x20000;
i_86_ -= ((Class361) this).anInt4453;
i_84_ -= ((Class361) this).a... | 9 |
void kill ()
{
if (Windows.trace)
System.err.println ("kill bus" + this);
// notify any listeners that the bus died, and
// clear backlinks that we control
if (listeners.size () > 0) {
synchronized (devices) {
for (int i = 0; i < devices.length; i++) {
if (devices [i] == null)
conti... | 4 |
public static boolean[] nextPosition(boolean switches[], int numTrue){
String value = "";
boolean retSwitches[] = new boolean [switches.length];
for(int i = 0; i < switches.length; i++){
value += switches[i] == true ? 1 : 0;
}
value = value.replaceAll( "[^\\d]", "" );
int currentValue = Integer.pars... | 7 |
public static WriteYCbCr getInstance() {
if (writeYCbCrSingleton == null) {
writeYCbCrSingleton = new WriteYCbCr();
}
return writeYCbCrSingleton;
} | 1 |
public static int countStringInText(String src, String targetString) {
if (isStringNullOrWhiteSpace(src) || isStringNullOrWhiteSpace(targetString)) return 0;
int start = 0, index = -1, count = 0;
while ((index = src.indexOf(targetString, start)) != -1) {
count++;
start = index + targetString.length();
}
... | 3 |
private void uploadAgenciesData(ArrayList<ArrayList<GenericGtfsData>> all_entities_data, String username, String password){
try{
for (int i=0; i<all_entities_data.size(); i++){
uploadAgencyData(all_entities_data.get(i), username, password);
}
} catch(Exception e){
_log.error(e.getMessage());
return;... | 2 |
public static int getContactDist(Integer pS, Integer pD, int maxDistLim) {
LinkedList<Integer> q = new LinkedList<Integer>();
q.add(pS);
HashSet<Integer> visited = new HashSet<Integer>();
visited.add(pS);
HashSet<Integer> done = new HashSet<Integer>();
HashMap<Integer,Integer> distances = new HashMap<Intege... | 8 |
public String evaluate(int i, LinkedList linkedlist)
{
String s = "";
if(linkedlist == null)
return "";
for(ListIterator listiterator = linkedlist.listIterator(0); listiterator.hasNext();)
{
XMLNode xmlnode = (XMLNode)listiterator.next();
if(xmlnod... | 8 |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
//Get register form data
String firstname = request.getParameter("firstname");
String lastname = request.getParameter("lastname");
String email = request.getParameter("email");
String passw... | 2 |
public void generateDatasetFromBeginning(String datasetFile, HashMap<String, Integer> files, int numOperations) throws IOException {
FileWriter fstream = new FileWriter(datasetFile);
BufferedWriter out = new BufferedWriter(fstream);
int fileNum = files.values().size() + 1;
int totalFiles = fileNum - 1;
Obj... | 7 |
@Override
public void render(Graphics2D graphics) {
final int startPointGridXCoordinate = 150;
final int startPointGridYCoordinate = 20;
final Set<Position> positions = objectTron.getElements().keySet();
for (int i = 0; i < objectTron.getGridWidth(); i++) {
for (int j = 0; j < objectTron.getGridHeight(); j+... | 3 |
public VariableCreator() {
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
if(System.getProperty("resources") == null)
System.setProperty("resources", System.getProperty("user.dir") + "/resources");
setBounds(100, 100, 450, 300);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder... | 6 |
public void highlight(int row, int column) {
highlight(row, column, THRG);
} | 0 |
public void moveSouth()
{
boolean [] temp = WhenShitHits.Enemy2Setpiece(this, 5);
if(temp[2] == false)
{
if(direction != 5)
{
direction = 5;
anamationFrame = 0;
pic = southAnamation()[anamationFrame];
animate = false;
if(animationTimer.is... | 7 |
public static boolean initFunctions(Object obj, List<Func> dst, String funcStr) {
if (StringUtils.isEmpty(funcStr) || StringUtils.isBlank(funcStr)) {
return true;
}
int PRE_ARGS_NUM = -1;
Class<?>[] PRE_ARGS_TYPE = null;
try {
PRE_ARGS_NUM = obj.getClass(... | 9 |
private void trySearch(int k) {
// loai bo cac o de bai
while (k < SIZE * SIZE && matrix[k / SIZE][k % SIZE] != 0) {
k++;
}
if (k == SIZE * SIZE)
return;
int row = k / SIZE, col = k % SIZE;
for (int x = 1; x <= SIZE; x++) { // duyet cac TH
if (isOK(row, col, x)) {
matrix[row][col] = x;
i... | 8 |
public void calcLightDepths(int var1, int var2, int var3, int var4) {
for(int var5 = var1; var5 < var1 + var3; ++var5) {
for(int var6 = var2; var6 < var2 + var4; ++var6) {
int var7 = this.blockers[var5 + var6 * this.width];
int var8;
for(var8 = this.depth - 1; var8 > ... | 8 |
@Override
public HashMap<String, Integer> parsePoints(String seasson, String day) throws IOException {
HashMap<String, Integer> playersPoints = new HashMap<String,Integer>();
URL url = new URL(buildURL(seasson, day));
URLConnection uc = url.openConnection();
InputStreamReader input = new InputStrea... | 7 |
public void print(String ans, int leftCount, int rightCount) {
if (leftCount == 0 && rightCount == 0) {
System.out.println(ans);
return;
}
if (leftCount > 0) {
print(ans + "(", leftCount - 1, rightCount);
}
if (rightCount > leftCount) {
... | 4 |
@Override
public void start()
throws Exception {
String[] args= this.par.getArgs();
int inputNumberValues= args.length - 1; //-1 for command word
if(inputNumberValues != 3)
throw new Exception("Incorrect input for kmeans");
int clusterNumber= Integer.valueOf(args[1]);
int maxIter= Integer.valueO... | 1 |
@Override
public List<Integer> sort(List<Integer> list) {
// checking input parameter for null
if (list == null) {
throw new IllegalArgumentException("Disallowed value");
}
int low = 0;
return sortPartition(list, low, list.size() - 1);
} | 1 |
@Override
public boolean tick(Tickable ticking, int tickID)
{
if(!(affected instanceof MOB))
return super.tick(ticking,tickID);
final MOB mob=(MOB)affected;
if((CMLib.flags().isStanding(mob))
&&(mob.isInCombat())
&&((mob.fetchAbility(ID())==null)||proficiencyCheck(null,0,false))
&&(tickID==Tickable.T... | 7 |
public static boolean validPalindrome(int n) {
final String numberToString = Integer.toString(n);
final int length = numberToString.length();
for (int i = 0; i <= (int) length / 2; i++) {
if (!(numberToString.charAt(i) == numberToString.charAt((length - 1) - i))) {
return false;
... | 2 |
public void method280(int tileZ, int z, int y, Entity entity, byte objectConfig, int uid, int x) {
if (entity == null) {
return;
}
GroundDecoration groundDecoration = new GroundDecoration();
groundDecoration.entity = entity;
groundDecoration.x = x * 128 + 64;
groundDecoration.y = y * 128 + 64;
groundDe... | 2 |
@Override
protected void xread_activated (Pipe pipe_)
{
// There are some subscriptions waiting. Let's process them.
Msg sub = null;
while ((sub = pipe_.read()) != null) {
// Apply the subscription to the trie.
byte[] data = sub.data();
int size = s... | 9 |
public Trace getTrace_v3(int xStart, int yStart, int sourceID, int threshold)
{
// Multiple query to be created based on threshold:
String multiQuery = "";
for (int i=0; i < threshold; i++)
{
for (int j=0; j < threshold; j++)
{
multiQu... | 9 |
private Set<Card> threeSevensAndAceKing() {
return convertToCardSet("3S,AS,KD,9S,TD,3C,3H");
} | 0 |
public void discard(int amount) {
System.out.println("Discarding");
GeometryFactory factory = Helper.getGeometryFactory();
LinkedList<LabelGeneOverlap> overlappingGenes = new LinkedList<LabelGeneOverlap>();
for (int geneI = this.size() - 1; geneI > 0; geneI--) {
LabelGene gene = this.get(geneI);
double ov... | 6 |
public void checkCustomDown(Node node) {
this.down = -1; // reset value to -1
// Prevent out of bounds
if((node.getX()+2) < this.size.getX()) {
if(checkWall(new Node( (node.getX()+2), (node.getY()) ))) {
if(this.closedNodes.size()==0)
this.down = 1;
else {
for(int i = 0; i < this.closedNodes.... | 5 |
@Override
public void actionPerformed(ActionEvent e) {
//System.out.println("SelectAllAction");
OutlinerCellRendererImpl textArea = null;
boolean isIconFocused = true;
Component c = (Component) e.getSource();
if (c instanceof OutlineButton) {
textArea = ((OutlineButton) c).renderer;
} else if (c ins... | 6 |
public AccountTypes() {
AccountType active = new AccountType();
active.setName(ASSET);
// active.setName(getBundle("Balances").getString("ASSET"));
AccountType passive = new AccountType();
passive.setName(LIABILITY);
// passive.setName(getBundle("Balances").getString("LIAB... | 2 |
@Override
public MoonPhase getMoonPhase(Room room)
{
int moonDex = (int)Math.round(Math.floor(CMath.mul(CMath.div(getDayOfMonth(),getDaysInMonth()+1),8.0)));
if(room != null)
{
final Area area = room.getArea();
if((room.numEffects()>0) || ((area != null)&&(area.numEffects()>0)))
{
final List<Abilit... | 8 |
protected <T> String toJson(final T object) {
if (object == null) {
throw new IllegalArgumentException("object parameter is null");
}
Gson gson = GsonFactory.create();
return gson.toJson(object);
} | 1 |
public List<String> getSortedFundCodes(String type, int top, SortMethod sortMethod){
List<String> candidates = new ArrayList<String>();
if(mapBasicInfos == null){
mapBasicInfos = new HashMap<String, List<String>>();
for(String[] basicInfo : basicInfos){
List<String> data = new ArrayList<String>();
dat... | 6 |
protected Icon getIcon() {
java.net.URL url = getClass().getResource("/ICON/blocks.gif");
return new javax.swing.ImageIcon(url);
} | 0 |
private void sortTuts() {
ArrayList<Timeslot>overfilledTuts;
for(Student s: students){
if(!s.getFlaggedForTuts()){
s.setAssignedTut(s.getCombinedTuts().get(0));
s.getCombinedTuts().get(0).addStudent(s);
}
}
Student currentStudent;
overfilledTuts=overFilledTuts();
while(!overfilledTuts.isEmpt... | 8 |
public final Image loadImage(String url, int width, int height) {
Image image = panel.getToolkit().createImage(ClassLoader.getSystemResource(url));
MediaTracker tracker = new MediaTracker(panel);
tracker.addImage(image, 1, width, height);
try {
tracker.waitForAll();
} catch (InterruptedException e) {
th... | 1 |
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 boolean addProcess(SwapProcess proc)
{
SwapProcess tempProc = proc;
int size = tempProc.getSize();
int startIndex = 0,index = nextIndex;
boolean added = false,firstLoop = false;;
while(index < 100 && !added)
{
startIndex = nextHoleIndex(index);
... | 9 |
public void setAdresse(String adresse) {
this.adresse = adresse;
} | 0 |
@Override
public void initTest(boolean argDeserialized) {
if(argDeserialized){
return;
}
Body ground = null;
{
BodyDef bd = new BodyDef();
ground = getWorld().createBody(bd);
PolygonShape shape = new PolygonShape();
shape.setAsEdge(new Vec2(-40.0f, 0.0f), new Vec2(40.0f, 0.0f));
ground.c... | 9 |
public T1 getFoo1()
{
return foo1;
} | 0 |
@Override
public void init(List<String> argumentList) {
offset = Integer.parseInt(argumentList.get(0));
identifier = argumentList.get(1);
} | 0 |
public Match getMatch(int noMatch){
for (Match match : liste) {
if(match.getId() == noMatch)
return match;
}
return null;
} | 2 |
public String toString()
{
if(isRoyalFlush())
return "a Royal Flush";
else if(isStraightFlush())
return "a Straight Flush";
else if(isFour())
return "four of a kind";
else if(isFullHouse())
return "a Full House";
else if(i... | 9 |
public void removePush() {
if (stack != null)
instr = stack.mergeIntoExpression(instr);
if (pushedLocal != null) {
Expression store = new StoreInstruction(new LocalStoreOperator(
pushedLocal.getType(), pushedLocal)).addOperand(instr);
instr = store;
}
super.removePush();
} | 2 |
private void controlsKitParam(){
final int X_SIDE = 235;
final int Y_SIDE = 180;
final int HEIGHT_KIT_PARAM_GROUP = 100;
final int MIN_VALUE = 1;
final int MAX_VALUE = 10;
final int DEF_VALUE = 5;
JPanel groupKitParam = new JPanel();
LayoutManager layout... | 0 |
public static Object getValue(String key,Object obj) {
String error = "";
if ( obj instanceof Map ) {
return ((Map)obj).get(key);
}
try {
BeanInfo binfo = Introspector.getBeanInfo(obj.getClass(), Object.class);
PropertyDescriptor[] props = binfo.getPro... | 6 |
@ManyToOne
@JsonIgnore
public Car getCar() {
return car;
} | 0 |
public double rawItemRange(int index){
if(!this.dataPreprocessed)this.preprocessData();
if(index<1 || index>this.nItems)throw new IllegalArgumentException("The item index, " + index + ", must lie between 1 and the number of items," + this.nItems + ", inclusive");
if(!this.variancesCalculated)thi... | 4 |
@Override
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String user = request.getRemoteUser();
PrintWriter out = response.getWriter();
showBartenderOrdersForm(out);
int p=0;
// u.getAccess()==1
if (user != null) {
try {
p=loggedInUse... | 5 |
public String addBinary(String a, String b) {
if (a == null || a.length() == 0)
return b;
if (b == null || b.length() == 0)
return a;
int i = a.length() - 1;
int j = b.length() - 1;
int carry = 0;
StringBuilder res = new StringBuilder();
while (i >= 0 && j >= 0) {
int digit = (int) (a.charAt(... | 9 |
final public FuncName FuncName() throws ParseException {
Token n;
FuncName f;
n = jj_consume_token(NAME);
f = new FuncName(n.image);
label_4: while (true) {
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case 73:
;
break;
default:
jj_la1[14] = jj_gen;
break label_4;
}
jj_consume_... | 6 |
boolean loadScriptFileInternal(String filename) {
if (filename.toLowerCase().indexOf("javascript:") == 0)
return loadScript(filename, viewer.eval(filename.substring(11)));
Object t = viewer.getInputStreamOrErrorMessageFromName(filename);
if (!(t instanceof InputStream))
return loadError((String) t);
Buffe... | 7 |
public Object getValueAt(int row, int column) {
switch (column) {
case 0:
return variables[row];
case 1:
return firstSets[row];
case 2:
return followSets[row];
}
return null;
} | 3 |
@Override
protected void read(InputBuffer b) throws IOException, ParsingException {
iv = b.get(0, 16);
int curve = Util.getShort(b.get(16, 2));
if (curve != 714) {
throw new ParsingException("Unknown curve: " + 714);
}
int xLength = Util.getShort(b.get(18, 2));
if (xLength > 32 || xLength < 0) {
... | 5 |
private void createRoadsRelations() {
// Cas des villes voisines pour les routes.
for (JTown t: towns) { // Pour chaque ville.
for (JRoad r: t.getRoadNeighbours()) { // Pour chaque route voisine de la ville.
r.addTownNeighbour(t); // Ajouter la ville en tant que ville voisine de la route.
}
}
// Ca... | 6 |
private RGBImage(final int width, final int height, final int type, final PixelSupplier supplier) {
this.width = width;
this.height = height;
this.type = type;
this.pixelValues = new int[width * height * 3];
final ErrorHandler errorHandler = new ErrorHandler();
final Ex... | 7 |
public static List<String> getColumnList(File file, int index, String sep,boolean ignore) {
List<String> ret = new ArrayList<String>();
BufferedReader br = null;
try {
// 构造BufferedReader对象
br = new BufferedReader(new FileReader(file));
int ln = 0;
String line = null;
while ((line = br.readLine()... | 7 |
private void recMinMax(Node currentNode, int player, int depth) {
// depth_lpnode = depth of (l)ast (p)arent node
if (currentNode.empty) {
return;
}
// until last node with children (max_depth -1 means depth_lpnode = last parent node)
// if (currentNode.nodeDepth != ... | 6 |
@Override
public void propertyChange(PropertyChangeEvent pce) {
if (pce.getSource() instanceof AbstractModel) {
registeredViews.forEach(x -> x.modelPropertyChange(pce));
} else if (pce.getSource() instanceof AbstractView) {
registeredModels.forEach(x -> x.viewPropertyChange(p... | 2 |
public String getWord() {
//if more than 90% of the word occurrences are capital,
//then use capital style
if ((mFreq * 0.90) < mCapitalFreq)
return Character.toUpperCase(mWord.charAt(0)) + mWord.substring(1);
else
return mWord;
} | 1 |
private void declareLabel(final Label l) {
String name = (String) labelNames.get(l);
if (name == null) {
name = "l" + labelNames.size();
labelNames.put(l, name);
buf.append("Label ").append(name).append(" = new Label();\n");
}
} | 1 |
public boolean ModificarCultivo(Cultivo p){
if (p!=null) {
cx.Modificar(p);
return true;
}else {
return false;
}
} | 1 |
public Object getValueAt(int row, int col) {
if(row>-1 && col>-1 && data!=null)
return data[row][col];
else
return null;
} | 3 |
private boolean searchTableColumns( String keyword ) {
for ( Column column : table.getColumns() ) {
if ( column.getFldType().equalsIgnoreCase( keyword ) ) {
return true;
}
}
return false;
} | 2 |
public static void postfix(String postfixInput)
{
int result = 0;
int val = 0;
int var1 = 0;
int var2 = 0;
char ch = ' ';
Stack s = new Stack();
for (int i = 0; i < postfixInput.length(); i++) {
ch = postfixInput.charAt(i);
... | 7 |
public void setLevel(int level) {
this.level = level;
} | 0 |
private boolean parseStart(){
// There MUST be tokens left at the start
int[] parsed = parsePrefix();
if (parsed == null){
// Error parsing
return false;
}
NumberToken next = peek();
if (next == null){
// Units, can't ... | 4 |
public Primes() { super("Find Prime Numbers"); } | 0 |
@Override
public void setData(ByteBuffer in) {
size = in.getInt();
width = in.getInt();
height = in.getInt();
planes = in.getShort();
bitsPerPixel = in.getShort();
compression = in.getInt();
sizeOfBitmap = in.getInt();
horzResolution = in.getInt();
... | 7 |
@Override
public void update() {
for(Planet p : planets){
p.update();
}
Set<Ship> toremove = new HashSet<Ship>();
for(Ship s : ships){
s.update();
{
double x = s.getCentrePoint().getX();
double y = s.getCentrePoint().getY();
if(x < 0 || x > width || y < 0 || y > height){
toremove.add(... | 8 |
void initInputFrame(
final ClassWriter cw,
final int access,
final Type[] args,
final int maxLocals){
inputLocals = new int[maxLocals];
inputStack = new int[0];
int i = 0;
if((access & Opcodes.ACC_STATIC) == 0)
{
if((access & MethodWriter.ACC_CONSTRUCTOR) == 0)
{
inputLocals[i++] = OBJECT | cw.add... | 6 |
public int leiaInt()
{
int numero = 0;
String linha ;
BufferedReader entra = new BufferedReader(new InputStreamReader(System.in)) ;
try
{
linha = entra.readLine() ;
numero = Integer.valueOf(linha).intValue();
}
catch (Excep... | 1 |
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.