Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

ITT: EXPERT JAVA PROGRAMMERS

Name: Anonymous 2009-02-10 9:52


import java.util.GregorianCalendar;

/**
 * A class created to handle the user's query request and facilitate the collection of
 * bits of information (day, month, year, hour, minute) to a {@link GregorianCalendar} date.
 *
 */
public class SearchCriteria
{
   int startDate;
  
   int startMonth;
  
   int startYear;
  
   int startHour;
  
   int startMin;
   
   int endDate;
    
   int endMonth;
  
   int endYear;
  
   int endHour;
  
   int endMin;
  

   public SearchCriteria(int startDate, int startMonth, int startYear,
                           int startHour, int startMin, int endDate, int endMonth,
                           int endYear, int endHour, int endMin)
   {
      this.startDate = startDate;
      this.startMonth = startMonth;
      this.startYear = startYear;
      this.startHour = startHour;
      this.startMin = startMin;
      this.endDate = endDate;
      this.endMonth = endMonth;
      this.endYear = endYear;
      this.endHour = endHour;
      this.endMin = endMin;
   }

   public GregorianCalendar getStart()
   {
      GregorianCalendar cal = new GregorianCalendar();
      cal.set(startYear, startMonth, startDate, startHour, startMin);
      return cal;
   }
   public GregorianCalendar getEnd()
   {
      GregorianCalendar cal = new GregorianCalendar();
      cal.set(endYear, endMonth, endDate, endHour, endMin);
      return cal;
   }
}


SOME CODE CHANGED TO PROTECT THE GUILTY

Name: Anonymous 2009-02-10 9:53

ENTERPRISE

also

NO EXPECTIONS

Name: Anonymous 2009-02-10 11:49

THAT CODE BOTH CONFUSES AND ANGERS ME

Name: Anonymous 2009-02-10 16:22

omg, you hit enter, way to fucking much.

Name: Anonymous 2009-02-10 17:33

>>4
omg, you hit comma, way to fucking much.

Name: Anonymous 2009-02-10 18:24

>>4-5
omg, you hit English right in the face, way too fucking much.

Name: Anonymous 2009-02-10 19:42

so... much... useless... CODE

Name: Anonymous 2009-02-10 19:58

>>7
You can say that about any programming idiom. Some languages resist the urge to add loads of syntactic sugar, and their designers should be praised for it.

Name: Anonymous 2009-02-10 19:59

>>3
>>7

Wait till you see the GUI event handling code.
Which I can't post because I can't make it generic enough. It's just so terrible.

Name: Anonymous 2009-02-10 20:52

>>9
Dude, it's just some anonymous classes. Not the end of the world

Name: Anonymous 2009-02-10 21:19

What the shit? java.util.Calendar is already pig disgusting, why would you make a useless wrapper for it?

Name: Anonymous 2009-02-10 21:21

ITT: People scared of the true POWER of JAVA.

Name: Anonymous 2009-02-10 22:37

>>11

Not quite on the same level of suck as AWT and Swing are

Name: SWT MEME FAN 2009-02-10 23:18

Use SWT

Name: Anonymous 2009-02-11 3:48


   public void actionPerformed(ActionEvent e)
   {
// Generic file dialogue stuff was here
      if(e.getActionCommand().compareTo("removepreview") == 0)
      {
          if(e.getSource().getClass().getName().compareTo("javax.swing.JButton") == 0)
          {
              JButton button = (JButton)e.getSource();
              if(button.getParent().getParent().getClass().getName().compareTo("gui.Preview") == 0)
              {
                 
                  Preview view = (Preview)button.getParent().getParent();
                  this.removePreview(view.getPreviewLabel());
              }
             
          }
      }
   }

// How does I seperate model and view?
   public void updatePrevies(Vector<String> updatedPreviews)
   {
      for(int i = 0; i < this.getComponentCount(); i++)
      {
         // check to see if its label corresponds to a label in the list
         for(int j = 0; j < updatedPreviews.size(); j++)
         {
            if(this.getComponent(i).getClass().getName().compareTo("gui.Preview") == 0)
            {
               if(((gui.Preview)this.getComponent(i)).getPreviewLabel().compareTo(updatedPreviews.elementAt(j)) == 0)
               {
((gui.Preview)this.getComponent(i)).updatePreview();
               }
            }
         }
      }  
   }


There was also a similar method to the one above but for removing previews. And a few other classes use the whole "this.getClass().getName().compareTo("gui.Preview") == 0" type things (lol actionListeners ONLY) and a completely pointless and worse reimplementation of date pretty printing. The rest of the application is pretty boring badly written java, with lots of hand made gridbag layouts.

However, this application is separated between a backend/frontend and the backend is surprisingly well written.

Name: Anonymous 2009-02-11 10:53

>>15
It's a syndrome of "Holy fuck this toolkit is retarded as shit, let's get this done and over with". I know this syndrome as I suffer from it too.

Name: Anonymous 2009-02-11 10:56

>>15
BTW Can you show me some of the backend code?

Name: Anonymous 2009-02-11 11:21

>>17
I'll show u my backend, if ur haxing my anus

Name: Anonymous 2009-02-11 12:23

>>18
LET THE HAXXING OF UR ANUS BEGIN!

Name: Anonymous 2010-12-09 9:48

Name: Anonymous 2011-02-03 3:20

Name: Anonymous 2011-02-17 20:21

that's cool and all, but check 'em

Don't change these.
Name: Email:
Entire Thread Thread List